-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix conformance errors & update setup commands
- Loading branch information
1 parent
0e9fa73
commit d241bad
Showing
8 changed files
with
77 additions
and
72 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#!/bin/bash | ||
|
||
flow-c1 transactions send ./cadence/transactions/evm/create_account.cdc 100.0 | ||
flow transactions send ./cadence/transactions/evm/create_account.cdc 100.0 | ||
|
||
flow-c1 accounts add-contract ./cadence/contracts/utils/ArrayUtils.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/utils/StringUtils.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/utils/ScopedFTProviders.cdc | ||
flow accounts add-contract ./cadence/contracts/utils/ArrayUtils.cdc | ||
flow accounts add-contract ./cadence/contracts/utils/StringUtils.cdc | ||
flow accounts add-contract ./cadence/contracts/utils/ScopedFTProviders.cdc | ||
|
||
flow-c1 accounts update-contract ./cadence/contracts/standards/EVM.cdc | ||
flow accounts update-contract ./cadence/contracts/standards/EVM.cdc | ||
|
||
# Create COA in emulator-account | ||
|
||
# Deploy the Factory contract - NOTE THE `deployedContractAddress` IN THE EMITTED EVENT | ||
flow-c1 transactions send ./cadence/transactions/evm/deploy.cdc \ | ||
flow transactions send ./cadence/transactions/evm/deploy.cdc \ | ||
--args-json "$(cat ./cadence/args/deploy-factory-args.json)" | ||
|
||
# Deploy initial bridge contracts | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/BridgePermissions.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/ICrossVM.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/CrossVMNFT.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeConfig.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/BridgePermissions.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/ICrossVM.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/CrossVMNFT.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeConfig.cdc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,60 @@ | ||
# Provided address is the address of the Factory contract deployed in the previous txn | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeUtils.cdc \ | ||
flow accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeUtils.cdc \ | ||
<REPLACE WITH DEPLOYED FACTORY EVM ADDRESS> | ||
|
||
flow-c1 accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeNFTEscrow.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeTemplates.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeNFTEscrow.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/FlowEVMBridgeTemplates.cdc | ||
# Add the templated contract code chunks for FlowEVMBridgedNFTTemplate.cdc contents | ||
flow-c1 transactions send ./cadence/transactions/bridge/admin/upsert_contract_code_chunks.cdc \ | ||
flow transactions send ./cadence/transactions/bridge/admin/upsert_contract_code_chunks.cdc \ | ||
--args-json "$(cat ./cadence/args/bridged-nft-code-chunks-args.json)" --gas-limit 1600 | ||
|
||
flow-c1 accounts add-contract ./cadence/contracts/bridge/IEVMBridgeNFTMinter.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/IEVMBridgeNFTMinter.cdc | ||
|
||
# Deploy Serialization Utils | ||
flow accounts add-contract ./cadence/contracts/utils/SerializationInterfaces.cdc | ||
flow accounts add-contract ./cadence/contracts/utils/Serialize.cdc | ||
flow accounts add-contract ./cadence/contracts/utils/SerializeNFT.cdc | ||
|
||
# Deploy main bridge interface & contract | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/IFlowEVMNFTBridge.cdc | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/FlowEVMBridge.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/IFlowEVMNFTBridge.cdc | ||
flow accounts add-contract ./cadence/contracts/bridge/FlowEVMBridge.cdc | ||
|
||
# Deploy the bridge router directing calls from COAs to the dedicated bridge | ||
flow-c1 accounts add-contract ./cadence/contracts/bridge/EVMBridgeRouter.cdc 0xf8d6e0586b0a20c7 FlowEVMBridge | ||
flow accounts add-contract ./cadence/contracts/bridge/EVMBridgeRouter.cdc 0xf8d6e0586b0a20c7 FlowEVMBridge | ||
|
||
# Create `example-nft` account 179b6b1cb6755e31 with private key 96dfbadf086daa187100a24b1fd2b709b702954bbd030a394148e11bcbb799ef | ||
flow-c1 accounts create --key "351e1310301a7374430f6077d7b1b679c9574f8e045234eac09568ceb15c4f5d937104b4c3180df1e416da20c9d58aac576ffc328a342198a5eae4a29a13c47a" | ||
flow accounts create --key "351e1310301a7374430f6077d7b1b679c9574f8e045234eac09568ceb15c4f5d937104b4c3180df1e416da20c9d58aac576ffc328a342198a5eae4a29a13c47a" | ||
|
||
# Create `user` account 0xf3fcd2c1a78f5eee with private key bce84aae316aec618888e5bdd24a3c8b8af46896c1ebe457e2f202a4a9c43075 | ||
flow-c1 accounts create --key "c695fa608bd40821552fae13bb710c917309690ed69c22866abad19d276c99296379358321d0123d7074c817dd646ae8f651734526179eaed9f33eba16601ff6" | ||
flow accounts create --key "c695fa608bd40821552fae13bb710c917309690ed69c22866abad19d276c99296379358321d0123d7074c817dd646ae8f651734526179eaed9f33eba16601ff6" | ||
|
||
# Create `erc721` account 0xe03daebed8ca0615 with private key bf602a4cdffb5610a008622f6601ba7059f8a6f533d7489457deb3d45875acb0 | ||
flow-c1 accounts create --key "9103fd9106a83a2ede667e2486848e13e5854ea512af9bbec9ad2aec155bd5b5c146b53a6c3fd619c591ae0cd730acb875e5b6e074047cf31d620b53c55a4fb4" | ||
flow accounts create --key "9103fd9106a83a2ede667e2486848e13e5854ea512af9bbec9ad2aec155bd5b5c146b53a6c3fd619c591ae0cd730acb875e5b6e074047cf31d620b53c55a4fb4" | ||
|
||
# Give the user some FLOW | ||
flow-c1 transactions send ./cadence/transactions/flow-token/transfer_flow.cdc 0xf3fcd2c1a78f5eee 100.0 | ||
flow transactions send ./cadence/transactions/flow-token/transfer_flow.cdc 0xf3fcd2c1a78f5eee 100.0 | ||
|
||
# Give the erc721 some FLOW | ||
flow-c1 transactions send ./cadence/transactions/flow-token/transfer_flow.cdc 0xe03daebed8ca0615 100.0 | ||
flow transactions send ./cadence/transactions/flow-token/transfer_flow.cdc 0xe03daebed8ca0615 100.0 | ||
|
||
# Create a COA for the user | ||
flow-c1 transactions send ./cadence/transactions/evm/create_account.cdc 10.0 --signer user | ||
flow transactions send ./cadence/transactions/evm/create_account.cdc 10.0 --signer user | ||
|
||
# Create a COA for the erc721 | ||
flow-c1 transactions send ./cadence/transactions/evm/create_account.cdc 10.0 --signer erc721 | ||
flow transactions send ./cadence/transactions/evm/create_account.cdc 10.0 --signer erc721 | ||
|
||
# user transfers Flow to the COA | ||
flow-c1 transactions send ./cadence/transactions/evm/deposit.cdc 10.0 --signer user | ||
flow transactions send ./cadence/transactions/evm/deposit.cdc 10.0 --signer user | ||
|
||
# erc721 transfers Flow to the COA | ||
flow-c1 transactions send ./cadence/transactions/evm/deposit.cdc 10.0 --signer erc721 | ||
flow transactions send ./cadence/transactions/evm/deposit.cdc 10.0 --signer erc721 | ||
|
||
# Setup User with Example NFT collection - Will break flow.json config due to bug in CLI - break here and update flow.json manually | ||
flow-c1 accounts add-contract ./cadence/contracts/example-assets/ExampleNFT.cdc --signer example-nft | ||
flow accounts add-contract ./cadence/contracts/example-assets/ExampleNFT.cdc --signer example-nft | ||
|
||
flow-c1 transactions send ./cadence/transactions/example-assets/setup_collection.cdc --signer user | ||
flow-c1 transactions send ./cadence/transactions/example-assets/mint_nft.cdc f3fcd2c1a78f5eee example description thumbnail '[]' '[]' '[]' --signer example-nft | ||
flow transactions send ./cadence/transactions/example-assets/setup_collection.cdc --signer user | ||
flow transactions send ./cadence/transactions/example-assets/mint_nft.cdc f3fcd2c1a78f5eee example description thumbnail '[]' '[]' '[]' --signer example-nft | ||
|
||
# Deploy ExampleERC721 contract with erc721's COA as owner - NOTE THE `deployedContractAddress` EMITTED IN THE RESULTING EVENT | ||
flow-c1 transactions send ./cadence/transactions/evm/deploy.cdc \ | ||
flow transactions send ./cadence/transactions/evm/deploy.cdc \ | ||
--args-json "$(cat ./cadence/args/deploy-erc721-args.json)" --signer erc721 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Mint an ERC721 with ID 42 to the user's COA | ||
flow-c1 transactions send ./cadence/transactions/example-assets/safe_mint_erc721.cdc \ | ||
flow transactions send ./cadence/transactions/example-assets/safe_mint_erc721.cdc \ | ||
<REPLACE WITH COA EVM ADDRESS OWNED BY USER> 42 "URI" <REPLACE WITH THE ERC721 ADDRESS DEPLOYED IN LAST STEP> 200000 \ | ||
--signer erc721 |