Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aptos CLI #1121

Open
wants to merge 219 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 199 commits
Commits
Show all changes
219 commits
Select commit Hold shift + click to select a range
204469c
aptos-v2-examples
abaltes-lz Nov 9, 2024
c4184b5
add Aptos Move build and test automation scripts
AlexanderLiteplo Nov 12, 2024
7227bbd
adding turbo (FULL TURBO)
AlexanderLiteplo Nov 13, 2024
511521f
Nov 25 OFT Examples Updates (#1081)
abaltes-lz Nov 26, 2024
f4bca05
adding endpoint
AlexanderLiteplo Nov 26, 2024
bccba2e
wip
AlexanderLiteplo Nov 26, 2024
7fe4aa9
wip
AlexanderLiteplo Nov 26, 2024
25f267a
wip
AlexanderLiteplo Nov 26, 2024
c6277e5
wip
shankars99 Nov 26, 2024
66879e9
wip
AlexanderLiteplo Nov 26, 2024
a1c66ff
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
AlexanderLiteplo Nov 26, 2024
73bbb35
test works
AlexanderLiteplo Nov 26, 2024
116d4c6
adding package updates
AlexanderLiteplo Nov 26, 2024
7178ae1
deploment file type
shankars99 Nov 26, 2024
d486067
feat: deployment script
shankars99 Nov 26, 2024
e5b0d65
pnpm i argparse
shankars99 Nov 26, 2024
70ae1c6
feat: builds oft
shankars99 Nov 26, 2024
bf4704c
wip
AlexanderLiteplo Nov 26, 2024
50a7f6e
sample: deployments
shankars99 Nov 26, 2024
2f5f35b
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Nov 26, 2024
878e343
aptos
shankars99 Nov 26, 2024
6db4315
wip
AlexanderLiteplo Nov 27, 2024
2d5fc34
updating utils
AlexanderLiteplo Nov 27, 2024
5381a27
pnpm i hardhat and ethers stuff
shankars99 Nov 27, 2024
6d18910
deployed test OFT
shankars99 Nov 27, 2024
bb8d5f8
uncomment namedAccounts
shankars99 Nov 27, 2024
dc2c6ed
wip
shankars99 Nov 27, 2024
14fa43b
evm wiring
shankars99 Nov 27, 2024
3333ee7
eid to network url
shankars99 Nov 27, 2024
7b7d605
todo: fetch the aptos oft address dynamicaly
shankars99 Nov 27, 2024
73c3bd1
updating configs
AlexanderLiteplo Nov 27, 2024
f165491
todo: cleanup
shankars99 Nov 27, 2024
e7504e0
updating wire + merge
AlexanderLiteplo Nov 27, 2024
848fc0e
todo: aptos mapping based on network.type
shankars99 Nov 27, 2024
a38a34b
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Nov 27, 2024
440a2b3
merge conflicts resolved
shankars99 Nov 27, 2024
b3a1ea9
add set enforced options and libs
AlexanderLiteplo Nov 27, 2024
90188f1
updated readme
AlexanderLiteplo Nov 27, 2024
6016bbe
pnpm lock
shankars99 Nov 27, 2024
99ceb98
tsconfig paths
shankars99 Nov 27, 2024
d285ab4
overload createEidToNetworkMapping
shankars99 Nov 27, 2024
f4763df
pre check balance across all evm networks before setPeerX
shankars99 Nov 27, 2024
8fe908d
fixed build
shankars99 Nov 27, 2024
2f0b584
evm-oft
shankars99 Nov 28, 2024
3fa03b7
evm-oft
shankars99 Nov 28, 2024
425130a
evm-oft deployment
shankars99 Nov 28, 2024
8a588b1
ignore cache
shankars99 Nov 28, 2024
bbe1774
chore: types for evm wire
shankars99 Nov 28, 2024
5245552
checkBalance and setPeer
shankars99 Nov 28, 2024
4b34f2a
wip: wire evm
shankars99 Nov 28, 2024
b691d83
wire functionality completed
AlexanderLiteplo Nov 28, 2024
053e9c5
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
AlexanderLiteplo Nov 28, 2024
dce510e
@layerzerolabs/lz-definitions-v3
shankars99 Nov 28, 2024
d188f17
default folder created at aptos-sandbox
shankars99 Nov 28, 2024
ae265a6
using lz-def-v3
shankars99 Nov 28, 2024
b74a17e
cleanup: arg parser
shankars99 Nov 28, 2024
3b6d49b
cleanup: deploy
shankars99 Nov 28, 2024
88d5228
bsc-sandbox oft deployment file
shankars99 Nov 28, 2024
ba6e50e
lz-defs and lz-utils to v3
shankars99 Nov 28, 2024
d2de2ff
remove: copy of aptos config
shankars99 Nov 28, 2024
9256da5
refactor to match new packages
shankars99 Nov 28, 2024
b2e2615
split lz config
shankars99 Nov 28, 2024
4128f9e
unify aptos and evm lz config
shankars99 Nov 28, 2024
4b8cbba
new pnpm lock
shankars99 Nov 28, 2024
cf25a21
adding ulnConfig parsing
AlexanderLiteplo Nov 28, 2024
12f4fec
merging
AlexanderLiteplo Nov 28, 2024
2173898
committing in order to pull shankars branch
AlexanderLiteplo Nov 28, 2024
c8a481c
wip
AlexanderLiteplo Nov 28, 2024
82febf5
diff printer
shankars99 Nov 28, 2024
32ce108
merge branch
shankars99 Nov 28, 2024
0481adb
removed hardhat
shankars99 Nov 28, 2024
1457259
First working version of aptos: build,deploy,wire completed
AlexanderLiteplo Nov 28, 2024
557c64e
feat: eth deployment
shankars99 Nov 28, 2024
c9add4d
ethereum sandbox added:
shankars99 Nov 28, 2024
7698333
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Nov 28, 2024
553f221
creates setPeer transactions
shankars99 Nov 29, 2024
fc06b67
batch executes all transactions
shankars99 Nov 29, 2024
4158db8
wip
shankars99 Nov 29, 2024
c6945b9
wip
shankars99 Nov 29, 2024
bb3634d
lz configs
shankars99 Nov 29, 2024
d7e97ee
type imports
shankars99 Nov 29, 2024
f696c5e
wip sending transactions at end of script
AlexanderLiteplo Nov 29, 2024
0120905
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
AlexanderLiteplo Nov 29, 2024
d090763
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Nov 29, 2024
5852c69
reads account configs from lz config
shankars99 Nov 29, 2024
2e245bc
add account config obj
shankars99 Nov 29, 2024
dff75d0
simulates all transactions
shankars99 Nov 29, 2024
fd4ce05
obtain signer from contract factory
shankars99 Nov 29, 2024
82d9c87
rename: transaction executor
shankars99 Nov 29, 2024
5b5dae2
feat: transaction similator
shankars99 Nov 29, 2024
8c84cb0
update: does not use signer as a field in the WireEVM type
shankars99 Nov 29, 2024
3bb570f
chore: improve console logging
shankars99 Nov 29, 2024
af2c308
add: delegate and owner addresses
shankars99 Nov 29, 2024
a934aa6
feat: delegate set
shankars99 Nov 29, 2024
2a3fb59
update: diffPrinter
shankars99 Nov 29, 2024
5a32ee1
wip
shankars99 Nov 29, 2024
2ef90e4
wip extracted setters
AlexanderLiteplo Nov 29, 2024
aea3154
wip extracted setters
AlexanderLiteplo Nov 29, 2024
e3e57d1
config setting and diffing supported
AlexanderLiteplo Dec 2, 2024
ae0914f
added initialization script
AlexanderLiteplo Dec 2, 2024
346750c
cleanup
AlexanderLiteplo Dec 2, 2024
55b54c8
set delegate + transfer ownership created + read delegate and owner f…
AlexanderLiteplo Dec 3, 2024
2d8c440
Fixed printing for options and allowed diffprinter to handle nested o…
AlexanderLiteplo Dec 3, 2024
e8c9ec5
wire aptos OFT in working state
AlexanderLiteplo Dec 3, 2024
f8e421a
cleanup
AlexanderLiteplo Dec 3, 2024
3e3448f
cleanup + send from aptos to evm script
AlexanderLiteplo Dec 3, 2024
bb31f92
dynamic address retrieval, cleanups, updated readme
AlexanderLiteplo Dec 5, 2024
b58bbd8
retrieving endpoint address from config in wire script
AlexanderLiteplo Dec 5, 2024
f1dadbc
diffPrinter orange boxes the entire diff
shankars99 Dec 6, 2024
f536a3c
Wire and send functionality working on testnet
AlexanderLiteplo Dec 6, 2024
24a1607
native drop as enforced options
shankars99 Dec 6, 2024
58296f0
remove extra blank lines
shankars99 Dec 6, 2024
d9f5158
feat: new types for migration of evmWire
shankars99 Dec 6, 2024
9d51693
setPeer upgraded
shankars99 Dec 6, 2024
ccdc3e4
txSimulator upgraded
shankars99 Dec 6, 2024
58d547e
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Dec 6, 2024
72cb1a8
upgrade eth-sandbox to eth-testnet
shankars99 Dec 6, 2024
f6fa588
use eth-testnet config
shankars99 Dec 6, 2024
fce0b83
wireEVMOFT uses testnets instead of sandbox
shankars99 Dec 6, 2024
9702ea0
docs
shankars99 Dec 6, 2024
55faa73
minor readme change
AlexanderLiteplo Dec 6, 2024
3b20e8d
merge
AlexanderLiteplo Dec 6, 2024
cc71994
fixed bug in get ReceiveLibraryTimeout
AlexanderLiteplo Dec 7, 2024
ef95562
keep eth-testnet in aptos config
shankars99 Dec 7, 2024
a8d627d
refactor location
shankars99 Dec 7, 2024
de85d44
update imports
shankars99 Dec 7, 2024
b2dd6c8
pnpm-lock.yaml
shankars99 Dec 7, 2024
1ac80a5
todo: dynamic width for diffPrinter for smaller width terminals
shankars99 Dec 7, 2024
be96b9d
setDelegate
shankars99 Dec 7, 2024
dea963c
feat: include upgraded setDelegate
shankars99 Dec 7, 2024
0266acf
enforcedOptionParam typing
shankars99 Dec 8, 2024
0d610ce
docs
shankars99 Dec 8, 2024
87fd883
pnpm
shankars99 Dec 8, 2024
39b222d
feat: enforced options
shankars99 Dec 8, 2024
95a64a3
docs + enforced options
shankars99 Dec 8, 2024
9166e95
LZRead as an enforcedOption
shankars99 Dec 8, 2024
58d6d18
cleaner handling when delegate is not part of config
shankars99 Dec 8, 2024
153b4b8
using sandbox
shankars99 Dec 8, 2024
758bce3
sendLibAddress
shankars99 Dec 8, 2024
8df9ba1
setDelegate checks for optional paramters configAccount.delegate
shankars99 Dec 8, 2024
9cd8cc6
contains EVM EndpointV2 deployment
shankars99 Dec 8, 2024
74ca12a
ContractMetadata generalized for addresses and contracts
shankars99 Dec 8, 2024
bbc0fe7
using simplemessagelib for alternate send lib
shankars99 Dec 8, 2024
d285d34
creates ethers contract for EndpointV2
shankars99 Dec 8, 2024
0baac9b
feat: setSendLibrary
shankars99 Dec 8, 2024
1bc4c01
chore: add ReceiveLibParams
shankars99 Dec 8, 2024
48336ed
chore: using SimpleMsgLib for receiveLibrary
shankars99 Dec 8, 2024
69d685f
feat: setReceiveLibrary
shankars99 Dec 8, 2024
b896161
docs: natspec comments
shankars99 Dec 8, 2024
4658cc3
fix readme
AlexanderLiteplo Dec 8, 2024
681cf28
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
AlexanderLiteplo Dec 8, 2024
91425f6
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Dec 9, 2024
dbc9df4
cleanups
AlexanderLiteplo Dec 9, 2024
a925c15
deploys recvuln302
shankars99 Dec 9, 2024
f14b4d4
uses custom ReceiveUln302 for timeout testing
shankars99 Dec 9, 2024
00de5e9
using SimpleMessageLib as custom alternate MessageLib
shankars99 Dec 9, 2024
00570f3
update deployments
shankars99 Dec 9, 2024
e089ecf
type: RecvLibraryTimeoutConfig
shankars99 Dec 9, 2024
750a0e5
todo: handle default libs
shankars99 Dec 9, 2024
55dd2dc
using SimpleMessageLib for all Libs
shankars99 Dec 9, 2024
fca7fab
feat: setReceiveLibraryTimeout
shankars99 Dec 9, 2024
7bfd0ff
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Dec 9, 2024
0e0d76e
using deployed SimpleMessageLib
shankars99 Dec 9, 2024
ab47dad
feat: anvil fork
shankars99 Dec 9, 2024
e3e853b
deployments
shankars99 Dec 9, 2024
7b05cfa
Account information - gasprice, nonce, signer
shankars99 Dec 9, 2024
64c689e
do not check default lib
shankars99 Dec 9, 2024
c129cdd
chore: improve diffPrinter result
shankars99 Dec 9, 2024
dc74153
fix: handling of expiry
shankars99 Dec 9, 2024
951bd07
feat: unified simulation and transaction submission
shankars99 Dec 9, 2024
216855a
feat: integrated the new transaction executor
shankars99 Dec 9, 2024
ac27d19
cleanup
shankars99 Dec 9, 2024
b7a18ae
docs + cleanup
shankars99 Dec 9, 2024
6f3fd83
reasoning for not handling Zero Address
shankars99 Dec 9, 2024
6e5888f
ready for Krak testing
AlexanderLiteplo Dec 9, 2024
a1a355d
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
AlexanderLiteplo Dec 9, 2024
cdd64fa
removing old aptos folders from examples
AlexanderLiteplo Dec 9, 2024
a11cb5c
cleanups
AlexanderLiteplo Dec 9, 2024
e64d15c
cleanups
AlexanderLiteplo Dec 9, 2024
39a84ac
cleanups
AlexanderLiteplo Dec 9, 2024
38432b3
creating message builders and other cleanups
AlexanderLiteplo Dec 9, 2024
1896c0d
cleaning up tests, renaming folder, adding test commands
AlexanderLiteplo Dec 10, 2024
ef43ce1
cleanup
AlexanderLiteplo Dec 10, 2024
f12e2c0
reverting artifact
AlexanderLiteplo Dec 10, 2024
ff8b91c
cleanup
AlexanderLiteplo Dec 10, 2024
770c8b6
send config
shankars99 Dec 10, 2024
f4c6865
send config
shankars99 Dec 10, 2024
fed4065
merge
shankars99 Dec 10, 2024
84b84ae
Merge branch 'aptos-cli' of https://github.com/LayerZero-Labs/devtool…
shankars99 Dec 10, 2024
867bdfd
decompose utils and types into aptos utils and evm utils, types
shankars99 Dec 10, 2024
40e4968
decompose utils and types into aptos utils and evm utils, types
shankars99 Dec 10, 2024
a7afdcb
refactor
shankars99 Dec 10, 2024
54b0db2
pnpm lock file
shankars99 Dec 10, 2024
5a0aaa9
path fixes
AlexanderLiteplo Dec 10, 2024
dd0b0df
cleanup
AlexanderLiteplo Dec 10, 2024
e71e3fb
reverting accidental change
AlexanderLiteplo Dec 10, 2024
608aeae
reverting toolbox changes
AlexanderLiteplo Dec 10, 2024
ef4ba36
Merge branch 'main' into aptos-cli
AlexanderLiteplo Dec 10, 2024
36be65e
running pnpm i after merging with main to updated lock file
AlexanderLiteplo Dec 10, 2024
49903a0
wire evm dynamic address retrieval
AlexanderLiteplo Dec 11, 2024
06c5c26
cleanups
AlexanderLiteplo Dec 11, 2024
b68ed0d
pnpm i ts-node
shankars99 Dec 11, 2024
aba13a2
fix: total transaction counter
shankars99 Dec 11, 2024
b319170
remove: SetReceiveLibraryTimeout
shankars99 Dec 11, 2024
09f1314
migrate to testnet
shankars99 Dec 11, 2024
95c7ad4
dyanmicially read EndpointV2 abi and address per network:
shankars99 Dec 11, 2024
1d7d621
pnpm i @layerzerolabs/lz-evm-sdk-v2
shankars99 Dec 11, 2024
e8d793f
receive config
shankars99 Dec 13, 2024
562684f
checksum addresses
shankars99 Dec 13, 2024
b2dcb0e
check if setting the same config
shankars99 Dec 13, 2024
2b31a98
generalize config utils
shankars99 Dec 13, 2024
8d29d93
refactor utils into utils folder
shankars99 Dec 13, 2024
ef4fd1d
feat: setReceiveConfig
shankars99 Dec 13, 2024
7365a19
from->curr and to->new
shankars99 Dec 13, 2024
8133bde
move promptForConfirmation to shared utils
shankars99 Dec 13, 2024
dabcd7d
ZEROEVMADDRESS is no longer in shared utils
shankars99 Dec 13, 2024
eff41fe
takes user input before submitting transactions
shankars99 Dec 13, 2024
c3ab04b
handles when totalTransactions=0
shankars99 Dec 13, 2024
1c25ff8
clean imports
shankars99 Dec 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/oft-aptos/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PUBLIC_KEY=
PRIVATE_KEY=
6 changes: 6 additions & 0 deletions examples/oft-aptos/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
*/build
*/node_modules
.aptos
cache/hardhat
deployments/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deployments folder shouldn't be in gitignore, it also isn't in other code examples we have in devtools please cross check

135 changes: 135 additions & 0 deletions examples/oft-aptos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# Aptos OFT Deployment
### connecting to aptos via cli
To install aptos cli, run the following command:
```
brew install aptos
```
If you need to generate a new key, run the following command:
```
aptos key generate --output-file my_key.pub
```
Then initialize the aptos cli and connect to the aptos network:
```
aptos init --network=testnet --private-key=<your-private-key>
```
You can then verify that your initialization was successful by running the following command:
```
cat .aptos/config.yaml
```
If successful the config will be populated with the RPC links and your account private key, account address, and network.
## Build the OFT:
We reccomend using the account address in printed by `cat .aptos/config.yaml` as the deployer and admin during the build and deploy steps to ensure wiring is successful. Afterwards you can use the transfer ownership script to set your desired admin.
```
ts-node tasks/move/build.ts --package-dir=oft --named-addresses oft=<account-address-of-deployer>,oft_admin=<account-address-of-admin>
```
## Deploy the OFT:
```
ts-node tasks/move/deploy.ts --package-dir oft --address-name oft --named-addresses oft_admin=<account-address-of-your-admin>
```

Make sure to set the account that will be used for administrative functions such as settting the peers should be set in the move.toml as OFT_ADMIN

Account Descriptions:
- oft is the owner of the deployer object which gives the account that owns the object the abilitiy to upgrade the object and also burn and mint the fungible asset.
- oft_admin is the account that is responsible for administrative functions such as setting the peers, set uln config... etc.

The address of the deployed oft is printed out in the terminal:
```
Code was successfully deployed to object address 0xaebb730cc67b4b0987ec99cd20b9eaf7c5c0d517f4424ab4f4b1450c6c8d9bb4.
{
"Result": "Success"
}
```
## Set the delegate:
Run the following command to set the delegate to the oft. Ensure first that you have specified the delegate address in the layerzero.config.ts file.
```
npx hardhat run tasks/move/setDelegate.ts
```
## Initialize the OFT:
Inside the file tasks/move/initAptosOFT.ts, set the following parameters:
```typescript
const tokenName = '<your-token-name>'
const tokenSymbol = '<your-token-symbol>'
const iconUri = '<your-icon-uri>'
const projectUri = '<your-project-uri>'
const sharedDecimals = <your-shared-decimals>
const localDecimals = <your-local-decimals>
```
Then run the following command to initialize the oft:
```
ts-node tasks/move/initAptosOFT.ts
```
## Wiring your aptos OFT:

#### layerzero.config.ts:
ensure that all of the contracts you wish to wire your aptos oft to are included under the contracts array and connections array. For example, if you want to wire your aptos oft to fuji, you would include both contracts under the contracts array, and specify them like this:
```typescript
const aptosContract: OmniPointHardhat = {
eid: EndpointId.APTOS_TESTNET,
contractName: 'oft',
}

const fujiContract: OmniPointHardhat = {
eid: EndpointId.AVALANCHE_V2_TESTNET,
contractName: 'MyOFT',
}

const config: OAppOmniGraphHardhat = {
contracts: [
{
contract: fujiContract,
},
{
contract: aptosContract,
config: {
delegate: '<your-aptos-account-address>',
owner: '<your-aptos-owner-address>',
},
},
],
connections: [
{
from: aptosContract,
to: fujiContract,
},
{
from: aptosContract,
to: sepoliaContract,
},
],
}
```

IMPORTANT: Before running the wire script ensure that you have run aptos init and configuered your desired network such as custom, testnet, mainnet, etc. and have also deployed the oft to that network.
```
npx hardhat run tasks/move/wireAptosOFT.ts
```

## Scripts For internal testing:
These scripts will not be shipped in the final version of the aptos cli. They are only for internal testing purposes.
shankars99 marked this conversation as resolved.
Show resolved Hide resolved
### Mint Aptos OFT:
First add this function to oft/sources/internal_oft/oft_impl.move in order to expose minting functionality to our aptos sdk script:
```
public entry fun mint(
admin: &signer,
recipient: address,
amount: u64,
) acquires OftImpl {
assert_admin(address_of(admin));
primary_fungible_store::mint(&store().mint_ref, recipient, amount);
}
```
Then run the following command to mint the aptos oft:
```
npx hardhat run tasks/move/mintAptosOFT.ts
```
### Send Aptos OFT:
Currently running into bugs with this script. Particularly around quoting send.
```
npx hardhat run tasks/move/sendFromAptosOFT.ts
```

# Movement OFT Deployment:
```
aptos init --network custom --rest-url https://aptos.testnet.porto.movementlabs.xyz/v1 --faucet-url https://faucet.testnet.bardock.movementnetwork.xyz/
```
161 changes: 161 additions & 0 deletions examples/oft-aptos/aptos.layerzero.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
import { EndpointId } from '@layerzerolabs/lz-definitions-v3'
import { ExecutorOptionType } from '@layerzerolabs/lz-v2-utilities-v3'
shankars99 marked this conversation as resolved.
Show resolved Hide resolved
import { bscConfig } from './evmOAppConfig'
import { ethConfig } from './evmOAppConfig'

import type { OAppOmniGraphHardhat, OmniPointHardhat } from '@layerzerolabs/toolbox-hardhat'

const ethereumContract: OmniPointHardhat = {
eid: EndpointId.ETHEREUM_V2_TESTNET,
contractName: 'MyOFT',
}

const bscContract: OmniPointHardhat = {
eid: EndpointId.BSC_V2_TESTNET,
contractName: 'MyOFT',
}

const aptosContract: OmniPointHardhat = {
eid: EndpointId.APTOS_V2_TESTNET,
contractName: 'oft',
}

const ethereumSandboxContract: OmniPointHardhat = {
Copy link
Contributor

@DanL0 DanL0 Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove or hide all sandbox related information from devtools. Devtools is publicly facing and in other examples we only use testnets AFAIK.

eid: EndpointId.ETHEREUM_V2_SANDBOX,
contractName: 'MyOFT',
}

const bscSandboxContract: OmniPointHardhat = {
eid: EndpointId.BSC_V2_SANDBOX,
contractName: 'MyOFT',
}

const aptosSandboxContract: OmniPointHardhat = {
eid: EndpointId.APTOS_V2_SANDBOX,
contractName: 'oft',
}

const config: OAppOmniGraphHardhat = {
contracts: [
{
shankars99 marked this conversation as resolved.
Show resolved Hide resolved
contract: ethereumContract,
config: ethConfig.accountConfig,
},
{
contract: bscContract,
config: bscConfig.accountConfig,
},
{
contract: ethereumSandboxContract,
config: ethConfig.accountConfig,
},
{
contract: bscSandboxContract,
config: bscConfig.accountConfig,
},
{
contract: aptosContract,
config: {
delegate: '58b730d07e98a22f2b357bee721115c986e4dc873c1884763708ee3d4006f74e',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove prepopulated address for delegate and owner

If we leave it here we risk someone by mistake deploys and transfers their rights to this address from example config

owner: '58b730d07e98a22f2b357bee721115c986e4dc873c1884763708ee3d4006f74e',
},
},
],
connections: [
{
from: aptosContract,
to: bscContract,
config: {
enforcedOptions: [
{
msgType: 1,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 1000, // gas limit in wei for EndpointV2.lzReceive
AlexanderLiteplo marked this conversation as resolved.
Show resolved Hide resolved
value: 0, // msg.value in wei for EndpointV2.lzReceive
},
{
msgType: 2,
optionType: ExecutorOptionType.LZ_RECEIVE,
gas: 1000, // gas limit in wei for EndpointV2.lzCompose
value: 0, // msg.value in wei for EndpointV2.lzCompose
},
// {
// msgType: 1,
// optionType: ExecutorOptionType.NATIVE_DROP,
// amount: 0, // amount of native gas token in wei to drop to receiver address
// receiver: '0x0000000000000000000000000000000000000000',
// },
],
sendLibrary: '0xbe533727aebe97132ec0a606d99e0ce137dbdf06286eb07d9e0f7154df1f3f10',
receiveLibraryConfig: {
// Required Receive Library Address on Aptos
receiveLibrary: '0xbe533727aebe97132ec0a606d99e0ce137dbdf06286eb07d9e0f7154df1f3f10',
// Optional Grace Period for Switching Receive Library Address on Aptos
gracePeriod: BigInt(0),
},
// Optional Receive Library Timeout for when the Old Receive Library Address will no longer be valid on Aptos
receiveLibraryTimeoutConfig: {
lib: '0xbe533727aebe97132ec0a606d99e0ce137dbdf06286eb07d9e0f7154df1f3f10',
expiry: BigInt(696969669),
AlexanderLiteplo marked this conversation as resolved.
Show resolved Hide resolved
},
sendConfig: {
executorConfig: {
maxMessageSize: 10000,
// The configured Executor address on Aptos
executor: '0xeb514e8d337485dd9ce7492f70128ef5aaa8c34023866e261a24ffa3d61a686d',
},
ulnConfig: {
// The number of block confirmations to wait on Aptos before emitting the message from the source chain.
confirmations: BigInt(300),
// The address of the DVNs you will pay to verify a sent message on the source chain.
// The destination tx will wait until ALL `requiredDVNs` verify the message.
requiredDVNs: ['0xd6f420483a90c7db5ce2ec12e8acfc2bfb7b93829c9e6a3b0760bca330be64dd'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does it work if here in aptos config there are requiredDVNs to BSC but in BSC config (evmOAppConfig) it says requiredDVNs [0x0]? Btw for EVM config we should stick to EVM config format so empty DVNs should be requiredDVNs: []

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah lets remove 0x0 and just leave it as an empty array

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// The address of the DVNs you will pay to verify a sent message on the source chain.
// The destination tx will wait until the configured threshold of `optionalDVNs` verify a message.
optionalDVNs: ['0xd6f420483a90c7db5ce2ec12e8acfc2bfb7b93829c9e6a3b0760bca330be64dd'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't usually provide optional dvns by default in other examples, we probably shouldnt add optional dvn here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Will remove

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DanL0 do you mean we should just fully remove it or have an empty array?

// The number of `optionalDVNs` that need to successfully verify the message for it to be considered Verified.
optionalDVNThreshold: 1,
},
},
// Optional Receive Configuration
// @dev Controls how the `from` chain receives messages from the `to` chain.
receiveConfig: {
ulnConfig: {
// The number of block confirmations to expect from the `to` chain.
confirmations: BigInt(300),
// The address of the DVNs your `receiveConfig` expects to receive verifications from on the `from` chain.
// The `from` chain's OApp will wait until the configured threshold of `requiredDVNs` verify the message.
requiredDVNs: ['0x0'],
// The address of the `optionalDVNs` you expect to receive verifications from on the `from` chain.
// The destination tx will wait until the configured threshold of `optionalDVNs` verify the message.
optionalDVNs: ['0xd6f420483a90c7db5ce2ec12e8acfc2bfb7b93829c9e6a3b0760bca330be64dd'],
// The number of `optionalDVNs` that need to successfully verify the message for it to be considered Verified.
optionalDVNThreshold: 1,
},
},
},
},
{
from: bscContract,
to: aptosContract,
config: bscConfig.oappConfig,
},
{
from: ethereumContract,
to: aptosContract,
config: ethConfig.oappConfig,
},
{
from: bscSandboxContract,
to: aptosSandboxContract,
config: bscConfig.oappConfig,
},
{
from: ethereumSandboxContract,
to: aptosSandboxContract,
config: ethConfig.oappConfig,
},
],
}

export default config
54 changes: 54 additions & 0 deletions examples/oft-aptos/config/deploymentAddresses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"sandbox-addresses": {
"oft_common": "0x49eec680042ba13d54b2343f1551aadfb3dbf549da4f5a3ab55dd49316c1732f",
"router_node_0": "0xde8f887ac62c3ddad6de4df32e30977f0327c8cfeca56e5981dec1f111e189c1",
"simple_msglib": "0xbb29964fac328dc2cd1dbf03982e51fad9de67e2a525c35d6e52cde4b66e7997",
"blocked_msglib": "0xfe58a1557dd30f5f69df9ebd0466f514840fba81a4c6fbcd536f088fe9e58100",
"uln_302": "0x3f2714ef2d63f1128f45e4a3d31b354c1c940ccdb38aca697c9797ef95e7a09f",
"router_node_1": "0x3dc5c01fde9a92724de233adc32878638ddc98b2178282d137ba2bafb1f4b935",
"endpoint_v2_common": "0xf8ce9f0030cb1fa5fb48f481d9b2da3909cd922992e7085e76a196653a707bbf",
"endpoint_v2": "0x824f76b2794de0a0bf25384f2fde4db5936712e6c5c45cf2c3f9ef92e75709c",
"layerzero_admin": "0x75de231a1ea32a14ed5be6a52475b16d7d8eeac35d378afd4c361979c0ae1531",
"layerzero_treasury_admin": "0x75de231a1ea32a14ed5be6a52475b16d7d8eeac35d378afd4c361979c0ae1531",
"msglib_types": "0x147b2ca35d8d6101a49690b3c108e67b174665d13b0fbba515e3b99d48b9fe42",
"treasury": "0xd83cb5c494daec692964a3599c3b36d4bd618dc54e7bcb2bbe444a7f9732f740",
"worker_peripherals": "0x75de231a1ea32a14ed5be6a52475b16d7d8eeac35d378afd4c361979c0ae1531",
"price_feed_router_0": "0x86c53b1187769b354e59b44111d90ab74f3162240d3f35ea1ca451281137cf2c",
"price_feed_router_1": "0xd78078a798d87940a9783ea4b8b09eb47117f36f23f57fe31a96faeb775046c4",
"price_feed_module_0": "0x894473c4f48d05a65d5bfb106ab91bc0881c7a1c7e9c66fbea2859c2ba9bff83",
"worker_common": "0x9d8a2cc4cd5563028107b792fd3c7f4068064405ef1bc4fce1cbc3af916032e8",
"executor_fee_lib_router_0": "0x551bd1f03eaba95f5aae59c0f382acf74e051b3d0890d63574069e45fce0118e",
"executor_fee_lib_router_1": "0xf1265e9c0ae38b49f099355587290d830ab46484df87d95cbad66c4ee3af8967",
"dvn_fee_lib_router_0": "0xc09c085aafdb39e4aa66f3311f3d293fe67ee88dab2aec772df9c2f0a1d60abd",
"dvn_fee_lib_router_1": "0xd9df2854349456b32d482d25db0b3917964f6fbae9737b3b4b62bf6d0a27ed51",
"executor_fee_lib_0": "0xff72f529a579e922e0edba30f384b4c9c86d05020cbd2401a23fe708f29c6664",
"dvn_fee_lib_0": "0xf63f6b01ea6688189e09e2be035bef512049288ff1d307c2470a913f3831330f",
"dvn": "0x1f79b324153abe0ca18a279822f3b561acbaabb4d68d47ed3639b5a53e4d3470"
},
"testnet-addresses": {
"oft_common": "0x1fa2c7365c88f7db4995f10ce5ffa93043e04f7ec797fb97c022d52d5ed870b9",
"router_node_0": "0x864554801ac1fd3611c1f9470c5d62fae447233933564667ff947c5b446237af",
"simple_msglib": "0xfa0ca06bf52334a3e9e040e807bbd532d90fc7651e594a42cdae919605a94d31",
"blocked_msglib": "0x197b99f723c6ea412bc7adebb840d38113252296bc80612f6a92e3d56678b87e",
"uln_302": "0xbe533727aebe97132ec0a606d99e0ce137dbdf06286eb07d9e0f7154df1f3f10",
"router_node_1": "0x169216d2983bfbee456d20e6a902d17cc2b09c2a936c1d2d43d057047dababab",
"endpoint_v2_common": "0x7832affd0909f4ae3363efc372d7b86dd3be80ed5efe9cbb9b250ffb89a6e4b",
"endpoint_v2": "0xa53352d6eb261173560111b83eb898611a8e87f7dabada415159f749fbd185e4",
"layerzero_admin": "0xde46aadc73f380cf51005afaf0a32c58d8e8d63c6dc36155935a3d0422e93c37",
"layerzero_treasury_admin": "0xde46aadc73f380cf51005afaf0a32c58d8e8d63c6dc36155935a3d0422e93c37",
"msglib_types": "0x302b77de23fd4189623e587fe48b87ec807db57c410e0f0a1f140b99be80f6b1",
"treasury": "0x6b3c61050170fd85a9ebe324688d092502bad3255856d61ecabec15c54b6ff90",
"worker_peripherals": "0xde46aadc73f380cf51005afaf0a32c58d8e8d63c6dc36155935a3d0422e93c37",
"price_feed_router_0": "0xc952a002c95ee5880a54e054764fbda13a2eda3b9698528629863921f6c2c74c",
"price_feed_router_1": "0x2dd6cca9b6220ed18ed5c1e611c8989efc0a0d2a441dd24074180509db6d9926",
"price_feed_module_0": "0x36536dc5f158e3701521614e4e2b2fff07fff15877f36123196bb37356afe404",
"worker_common": "0xc3cd6ba2758a9acf604c9e5382a6f76ee71598b863b93efc7c4fe542a397a9db",
"executor_fee_lib_router_0": "0xfa6f8d82188bfe34cb37e0aeba3bcf5a21610116d01c187d7779817a9441f3ad",
"executor_fee_lib_router_1": "0x221a5f2158d7aa67c5939a57cce0ce0e3d5915ae4a575fa7ce50c76d115023",
"dvn_fee_lib_router_0": "0x709b216b828fe42596d860d0126907b43f89564ae4bc81ec153b02fe492174a4",
"dvn_fee_lib_router_1": "0x27c840aa072206a4e190042158c1ce4cf23b3f04fa22dcd5c092859ab1e54c48",
"executor_fee_lib_0": "0xcd94220a2632ea96e2b05bd5056a8234a418cf647abfe92949a8f7623732dbce",
"dvn_fee_lib_0": "0xf3e18cf48c09fdd1fe529e23861fb4d63fad70068c64dd4b8237daf3e136ed26",
"dvn": "0xd6f420483a90c7db5ce2ec12e8acfc2bfb7b93829c9e6a3b0760bca330be64dd"
}
}
Loading
Loading