Skip to content

Commit

Permalink
Merge pull request #107 from onflow/testnet-deployment-followup
Browse files Browse the repository at this point in the history
Testnet deployment followup
  • Loading branch information
sisyphusSmiling authored Aug 19, 2024
2 parents 8623710 + 0c2899f commit a9d52f9
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 30 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ addresses:
|Contracts|PreviewNet|Testnet|Mainnet|
|---|---|---|---|
|All Cadence Bridge contracts|`0x7792cfb75d8dfdd8`|`0xdfc20aee650fcbdf`|TBD|
|[`FlowEVMBridgeFactory.sol`](./solidity/src/FlowBridgeFactory.sol)|`0xb0885c08995a053d8dcadce1c66b2fb11e40b868`|TBD|TBD|
|[`FlowEVMBridgeDeploymentRegistry.sol`](./solidity/src/FlowEVMBridgeDeploymentRegistry.sol)|`0xfadbc0c156f6679d1ac9eb271d4e55dce7de8802`|TBD|TBD|
|[`FlowEVMBridgedERC20Deployer.sol`](./solidity/src/FlowEVMBridgedERC20Deployer.sol)|`0x9d5fe779e35d1f13abd875dd6c2b49f20e813054`|TBD|TBD|
|[`FlowEVMBridgedERC721Deployer.sol`](./solidity/src/FlowEVMBridgedERC721Deployer.sol)|`0x211f54ca1e325a3946ed67aeefcc6cc32b1e833d`|TBD|TBD|
|[`FlowEVMBridgeFactory.sol`](./solidity/src/FlowBridgeFactory.sol)|`0xb0885c08995a053d8dcadce1c66b2fb11e40b868`|`0xf8146b4aef631853f0eb98dbe28706d029e52c52`|TBD|
|[`FlowEVMBridgeDeploymentRegistry.sol`](./solidity/src/FlowEVMBridgeDeploymentRegistry.sol)|`0xfadbc0c156f6679d1ac9eb271d4e55dce7de8802`|`0x8781d15904d7e161f421400571dea24cc0db6938`|TBD|
|[`FlowEVMBridgedERC20Deployer.sol`](./solidity/src/FlowEVMBridgedERC20Deployer.sol)|`0x9d5fe779e35d1f13abd875dd6c2b49f20e813054`|`0x716c4ffae66e1105afd550a3f23775f010f2df7e`|TBD|
|[`FlowEVMBridgedERC721Deployer.sol`](./solidity/src/FlowEVMBridgedERC721Deployer.sol)|`0x211f54ca1e325a3946ed67aeefcc6cc32b1e833d`|`0xcfda0226e323cc250d21744512eb353f6024bfb2`|TBD|

## Interacting with the bridge

Expand Down
29 changes: 29 additions & 0 deletions cadence/scripts/utils/get_registry_address.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import "EVM"

import "FlowEVMBridgeConfig"
import "FlowEVMBridgeUtils"

access(all)
fun main(coaHost: Address): String {
let coa = getAuthAccount<auth(BorrowValue) &Account>(coaHost)
.storage
.borrow<auth(EVM.Call) &EVM.CadenceOwnedAccount>(from: /storage/evm)
?? panic("Could not borrow CadenceOwnedAccount from host=".concat(coaHost.toString()))
let res = coa.call(
to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(),
data: EVM.encodeABIWithSignature("getRegistry()", []),
gasLimit: FlowEVMBridgeConfig.gasLimit,
value: EVM.Balance(attoflow: UInt(0))
)

assert(
res.status == EVM.Status.successful,
message: "getRegistry call to FlowEVMBridgeFactory failed"
)

let decodedRes = EVM.decodeABI(types: [Type<EVM.EVMAddress>()], data: res.data)

assert(decodedRes.length == 1, message: "Invalid response length")

return (decodedRes[0] as! EVM.EVMAddress).toString()
}
8 changes: 8 additions & 0 deletions cadence/tests/scripts/create_empty_usdc_vault.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import "USDCFlow"

access(all)
fun main() {
let v <- USDCFlow.createEmptyVault(vaultType: Type<@USDCFlow.Vault>())
log("Vault creation successful")
destroy v
}
48 changes: 23 additions & 25 deletions flow.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"aliases": {
"crescendo": "9a0766d93b6608b7",
"emulator": "f8d6e0586b0a20c7",
"mainnet": "f233dcee88fe0abe",
"previewnet": "b6763b4399a888c8",
"testing": "0000000000000001"
"testing": "0000000000000001",
"testnet": "9a0766d93b6608b7"
}
},
"CrossVMNFT": {
Expand Down Expand Up @@ -44,8 +46,8 @@
"aliases": {
"crescendo": "8c5303eaa26202d6",
"emulator": "f8d6e0586b0a20c7",
"mainnet": "e467b9dd11fa00df",
"previewnet": "b6763b4399a888c8",
"mainnet": "0xe467b9dd11fa00df",
"testnet": "8c5303eaa26202d6"
}
},
Expand Down Expand Up @@ -325,10 +327,10 @@
"USDCFlow": {
"source": "./cadence/contracts/handled-tokens/USDCFlow.cdc",
"aliases": {
"crescendo": "4516677f8083d680",
"crescendo": "64adf39cbc354fcb",
"emulator": "f8d6e0586b0a20c7",
"testing": "0000000000000007",
"testnet": "4516677f8083d680"
"testnet": "64adf39cbc354fcb"
}
},
"ViewResolver": {
Expand Down Expand Up @@ -356,8 +358,7 @@
"address": "dfc20aee650fcbdf",
"key": {
"type": "file",
"location": "./crescendo-flow-evm-bridge.pkey",
"index": 1
"location": "./crescendo-flow-evm-bridge.pkey"
}
},
"crescendo-service-account": {
Expand All @@ -366,18 +367,13 @@
"type": "file",
"signatureAlgorithm": "ECDSA_secp256k1",
"hashAlgorithm": "SHA2_256",
"location": "./crescendo-service-account.pkey",
"index": 2
"location": "./crescendo-service-account.pkey"
}
},
"emulator-account": {
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"emulator-service-account": {
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"emulator-flow": {
"address": "0ae53cb6e3f42a79",
"key": "c1e4c9d9dca9e4d5e9b0b5a9a8e8b9c5d6f4a8b9c5d6f4a8b9c5d6f4a8b9c5d6"
Expand All @@ -386,15 +382,9 @@
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"previewnet-service-account": {
"address": "b6763b4399a888c8",
"key": {
"type": "file",
"signatureAlgorithm": "ECDSA_secp256k1",
"hashAlgorithm": "SHA2_256",
"location": "./previewnet-service-account.pkey",
"index": 0
}
"emulator-service-account": {
"address": "f8d6e0586b0a20c7",
"key": "fe809cc837ddcd7e761a482721c050aae43657448db859f4eb8fc421e9609938"
},
"previewnet-flow-evm-bridge": {
"address": "7792cfb75d8dfdd8",
Expand All @@ -404,6 +394,15 @@
"resourceID": "projects/dl-flow-admin/locations/global/keyRings/flow-vm-bridge/cryptoKeys/flow-fvm-evm-bridge-previewnet/cryptoKeyVersions/1"
}
},
"previewnet-service-account": {
"address": "b6763b4399a888c8",
"key": {
"type": "file",
"signatureAlgorithm": "ECDSA_secp256k1",
"hashAlgorithm": "SHA2_256",
"location": "./previewnet-service-account.pkey"
}
},
"testnet-flow-evm-bridge": {
"address": "dfc20aee650fcbdf",
"key": {
Expand All @@ -418,8 +417,7 @@
"type": "file",
"signatureAlgorithm": "ECDSA_secp256k1",
"hashAlgorithm": "SHA2_256",
"location": "./testnet-service-account.pkey",
"index": 2
"location": "./testnet-service-account.pkey"
}
}
},
Expand Down Expand Up @@ -466,8 +464,8 @@
"name": "FlowEVMBridgeUtils",
"args": [
{
"type": "String",
"value": "f23c8619603434f7f71659820193c8e491feb1d9"
"value": "f23c8619603434f7f71659820193c8e491feb1d9",
"type": "String"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func main() {
dir,
"cadence/args/bridged-token-code-chunks-args-"+network+".json",
)
nftChunkPath := filepath.Join(dir, "cadence/args/bridged-token-code-chunks-args-"+network+".json")
nftChunkPath := filepath.Join(dir, "cadence/args/bridged-nft-code-chunks-args-"+network+".json")
tokenChunks := getCodeChunksFromArgsJSON(tokenChunkPath)
nftChunks := getCodeChunksFromArgsJSON(nftChunkPath)
tokenChunkUpsert := o.Tx("bridge/admin/templates/upsert_contract_code_chunks",
Expand Down

0 comments on commit a9d52f9

Please sign in to comment.