From 78c3d7f3dc58638381dd525c6443fe74a2141143 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:44:05 -0600 Subject: [PATCH 1/7] update deployment script --- main.go | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/main.go b/main.go index bf6ce45e..d515d93a 100644 --- a/main.go +++ b/main.go @@ -179,6 +179,16 @@ func main() { contractCode, err := os.ReadFile(contractPath) checkNoErr(err) + // If the contract is already deployed as-is, skip deployment + a, err := o.GetAccount(ctx, "flow-evm-bridge") + checkNoErr(err) + log.Printf("Checking if contract %s is already deployed...", name) + if a.Contracts[name] != nil { + log.Printf("Contract %s already deployed, skipping...", name) + continue + } + log.Printf("Contract %s not found on %s, deploying...", name, network) + var args []cadence.Value if name == "FlowEVMBridgeUtils" { args = []cadence.Value{cadence.String(factoryAddr)} @@ -197,23 +207,8 @@ func main() { WithArg("pause", true), ) checkNoErr(pauseResult.Err) - log.Printf("Bridge paused, configuring token handlers...") - - // TODO: Blocked on FiatToken staging - uncomment once the updated contract is staged & migrated - // Add TokenHandler for specified Types - // fiatToken, err := o.State.Config().Contracts.ByName("FiatToken") - // checkNoErr(err) - // fiatTokenAddress := fiatToken.Aliases.ByNetwork(o.GetNetwork()).Address - // fiatTokenVaultIdentifier := "A." + fiatTokenAddress.String() + ".FiatToken.Vault" - // fiatTokenMinterIdentifier := "A." + fiatTokenAddress.String() + ".FiatToken.MinterResource" - // handlerCreationResult := o.Tx("bridge/admin/token-handler/create_cadence_native_token_handler", - // WithSigner("flow-evm-bridge"), - // WithArg("vaultIdentifier", fiatTokenVaultIdentifier), - // WithArg("minterIdentifier", fiatTokenMinterIdentifier), - // ) - // checkNoErr(handlerCreationResult.Err) - - log.Printf("Token handlers configured...continuing EVM setup...") + + // TODO: Add any TokenHandlers here if needed /* --- Finish EVM Contract Setup --- */ From 9dd36f5c196c714cfd917a542dddd515b2edbb68 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:03:50 -0600 Subject: [PATCH 2/7] fix script doc comment --- cadence/scripts/utils/token_uri.cdc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cadence/scripts/utils/token_uri.cdc b/cadence/scripts/utils/token_uri.cdc index c6077b23..a9f52c75 100644 --- a/cadence/scripts/utils/token_uri.cdc +++ b/cadence/scripts/utils/token_uri.cdc @@ -4,9 +4,8 @@ import "FlowEVMBridgeUtils" /// Returns the tokenURI of the given tokenID from the given EVM contract address /// -/// @param coaHost: The Flow account Address of the account that hosts the COA used to make the call -/// @param id: The ID of the ERC721 token /// @param contractAddressHex: The hex string of the contract address of the ERC721 token +/// @param tokenID: The ID of the ERC721 token /// /// @return The tokenURI of the given tokenID from the given EVM contract address. Reverts if the call is unsuccessful /// From 9a00d5c3b9f0be740ea723217c8942b349d339ea Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:19:06 -0600 Subject: [PATCH 3/7] add getter for FlowEVMBridgeUtils.bridgeFactoryEVMAddress & implement --- cadence/contracts/bridge/FlowEVMBridgeUtils.cdc | 9 +++++++++ cadence/scripts/utils/get_factory_address.cdc | 2 +- cadence/transactions/bridge/admin/evm/add_deployer.cdc | 4 ++-- .../bridge/admin/evm/set_delegated_deployer.cdc | 6 +++--- .../bridge/admin/evm/set_deployment_registry.cdc | 6 +++--- cadence/transactions/bridge/admin/evm/set_registrar.cdc | 8 ++++---- 6 files changed, 22 insertions(+), 13 deletions(-) diff --git a/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc b/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc index 61b565cd..ef346f42 100644 --- a/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc +++ b/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc @@ -91,6 +91,15 @@ contract FlowEVMBridgeUtils { Public Bridge Utils **************************/ + /// Retrieves the bridge factory contract address + /// + /// @returns The EVMAddress of the bridge factory contract in EVM + /// + access(all) + view fun getBridgeFactoryEVMAddress(): EVM.EVMAddress { + return self.bridgeFactoryEVMAddress + } + /// Calculates the fee bridge fee based on the given storage usage + the current base fee. /// /// @param used: The amount of storage used by the asset diff --git a/cadence/scripts/utils/get_factory_address.cdc b/cadence/scripts/utils/get_factory_address.cdc index dc9773cd..9f50c1d8 100644 --- a/cadence/scripts/utils/get_factory_address.cdc +++ b/cadence/scripts/utils/get_factory_address.cdc @@ -7,5 +7,5 @@ import "FlowEVMBridgeUtils" /// @return The EVM address of the FlowEVMBridgeFactory contract as hex string (without 0x prefix) /// access(all) fun main(): String { - return FlowEVMBridgeUtils.bridgeFactoryEVMAddress.toString() + return FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString() } \ No newline at end of file diff --git a/cadence/transactions/bridge/admin/evm/add_deployer.cdc b/cadence/transactions/bridge/admin/evm/add_deployer.cdc index 47bbfda3..8126856c 100644 --- a/cadence/transactions/bridge/admin/evm/add_deployer.cdc +++ b/cadence/transactions/bridge/admin/evm/add_deployer.cdc @@ -24,7 +24,7 @@ transaction(deployerTag: String, deployerEVMAddressHex: String) { // Execute the call let deployerEVMAddress = EVM.addressFromString(deployerEVMAddressHex) let callResult = self.coa.call( - to: FlowEVMBridgeUtils.bridgeFactoryEVMAddress, + to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), data: EVM.encodeABIWithSignature( "addDeployer(string,address)", [deployerTag, deployerEVMAddress] @@ -36,7 +36,7 @@ transaction(deployerTag: String, deployerEVMAddressHex: String) { // Confirm the deployer was added under the tag let postDeployerResult = self.coa.call( - to: FlowEVMBridgeUtils.bridgeFactoryEVMAddress, + to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), data: EVM.encodeABIWithSignature( "getDeployer(string)", [deployerTag] diff --git a/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc b/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc index 8cbde1f4..e6280768 100644 --- a/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc +++ b/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc @@ -26,7 +26,7 @@ transaction(deployerEVMAddressHex: String) { to: deployerEVMAddress, data: EVM.encodeABIWithSignature( "setDelegatedDeployer(address)", - [FlowEVMBridgeUtils.bridgeFactoryEVMAddress] + [FlowEVMBridgeUtils.getBridgeFactoryEVMAddress()] ), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -51,9 +51,9 @@ transaction(deployerEVMAddressHex: String) { } post { - self.postDelegatedDeployer!.toString() == FlowEVMBridgeUtils.bridgeFactoryEVMAddress.toString(): + self.postDelegatedDeployer!.toString() == FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString(): "FlowBridgeFactory address " - .concat(FlowEVMBridgeUtils.bridgeFactoryEVMAddress.toString()) + .concat(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString()) .concat(" was not set as the delegated deployer in the deployer contract ") .concat(deployerEVMAddressHex) } diff --git a/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc b/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc index 9f03e8a4..171492f2 100644 --- a/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc +++ b/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc @@ -26,7 +26,7 @@ transaction(registryEVMAddressHex: String) { // Execute call let registryEVMAddress = EVM.addressFromString(registryEVMAddressHex) let callResult = self.coa.call( - to: FlowEVMBridgeUtils.bridgeFactoryEVMAddress, + to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), data: EVM.encodeABIWithSignature( "setDeploymentRegistry(address)", [registryEVMAddress] @@ -38,7 +38,7 @@ transaction(registryEVMAddressHex: String) { // Confirm the registry address was set let postRegistryResult = self.coa.call( - to: FlowEVMBridgeUtils.bridgeFactoryEVMAddress, + to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), data: EVM.encodeABIWithSignature("getRegistry()", []), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -61,6 +61,6 @@ transaction(registryEVMAddressHex: String) { "Registry address " .concat(registryEVMAddressHex) .concat(" was not set in the FlowBridgeFactory contract ") - .concat(FlowEVMBridgeUtils.bridgeFactoryEVMAddress.toString()) + .concat(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString()) } } diff --git a/cadence/transactions/bridge/admin/evm/set_registrar.cdc b/cadence/transactions/bridge/admin/evm/set_registrar.cdc index 6c08d33c..78e7f642 100644 --- a/cadence/transactions/bridge/admin/evm/set_registrar.cdc +++ b/cadence/transactions/bridge/admin/evm/set_registrar.cdc @@ -24,7 +24,7 @@ transaction(registryEVMAddressHex: String) { to: registryEVMAddress, data: EVM.encodeABIWithSignature( "setRegistrar(address)", - [FlowEVMBridgeUtils.bridgeFactoryEVMAddress] + [FlowEVMBridgeUtils.getBridgeFactoryEVMAddress()] ), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -43,15 +43,15 @@ transaction(registryEVMAddressHex: String) { let decodedResult = EVM.decodeABI( types: [Type()], data: postRegistrarResult.data - ) as! [AnyStruct] + ) assert(decodedResult.length == 1, message: "Invalid response from registrar() call to registry contract") self.postRegistrar = decodedResult[0] as! EVM.EVMAddress } post { - self.postRegistrar!.toString() == FlowEVMBridgeUtils.bridgeFactoryEVMAddress.toString(): + self.postRegistrar!.toString() == FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString(): "FlowBridgeFactory address " - .concat(FlowEVMBridgeUtils.bridgeFactoryEVMAddress.toString()) + .concat(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString()) .concat(" was not set as the registrar in the registry contract ") .concat(registryEVMAddressHex) } From f9eb38563659c0a5ef307038c3184c1e0bfe3418 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:19:31 -0600 Subject: [PATCH 4/7] fix log in contract deployment script --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index d515d93a..73df42d5 100644 --- a/main.go +++ b/main.go @@ -133,7 +133,7 @@ func main() { checkNoErr(registryDeployment.Err) registryAddr := getContractAddressFromEVMEvent(registryDeployment) - log.Printf("Registry deployed to address: %s", factoryAddr) + log.Printf("Registry deployed to address: %s", registryAddr) /// Deploy ERC20 deployer /// // From f87e29671ad836722eed0e2f1080e64ca562b281 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:20:59 -0600 Subject: [PATCH 5/7] update FlowEVMBridgeUtils.bridgeFactoryEVMAddress to access(self) --- cadence/contracts/bridge/FlowEVMBridgeUtils.cdc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc b/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc index ef346f42..0f29e2d1 100644 --- a/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc +++ b/cadence/contracts/bridge/FlowEVMBridgeUtils.cdc @@ -19,7 +19,7 @@ access(all) contract FlowEVMBridgeUtils { /// Address of the bridge factory Solidity contract - access(all) + access(self) var bridgeFactoryEVMAddress: EVM.EVMAddress /// Delimeter used to derive contract names access(self) From 60d94dd6b4e9005f9dd85e66e880e7d51c08ac3d Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:51:26 -0600 Subject: [PATCH 6/7] fix admin txn post-conditions --- cadence/tests/scripts/get_registry.cdc | 30 +++++++++++++++++++ .../bridge/admin/evm/add_deployer.cdc | 10 +++---- .../admin/evm/set_delegated_deployer.cdc | 10 +++---- .../admin/evm/set_deployment_registry.cdc | 9 +++--- .../bridge/admin/evm/set_registrar.cdc | 9 +++--- 5 files changed, 50 insertions(+), 18 deletions(-) create mode 100644 cadence/tests/scripts/get_registry.cdc diff --git a/cadence/tests/scripts/get_registry.cdc b/cadence/tests/scripts/get_registry.cdc new file mode 100644 index 00000000..b6eb4172 --- /dev/null +++ b/cadence/tests/scripts/get_registry.cdc @@ -0,0 +1,30 @@ +import "EVM" + +import "FlowEVMBridgeUtils" + +access(all) +fun main(): String { + let coa = getAuthAccount(0xdfc20aee650fcbdf) + .storage + .borrow( + from: /storage/evm + ) ?? panic("Problem borrowing COA") + // Confirm the registry address was set + let postRegistryResult = coa.call( + to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), + data: EVM.encodeABIWithSignature("owner()", []), + gasLimit: 15_000_000, + value: EVM.Balance(attoflow: 0) + ) + assert( + postRegistryResult.status == EVM.Status.successful, + message: "Failed to get registry address from FlowBridgeFactory contract" + ) + + let decodedResult = EVM.decodeABI( + types: [Type()], + data: postRegistryResult.data + ) + assert(decodedResult.length == 1, message: "Invalid response from getRegistry() call to FlowBridgeFactory contract") + return (decodedResult[0] as! EVM.EVMAddress).toString() +} \ No newline at end of file diff --git a/cadence/transactions/bridge/admin/evm/add_deployer.cdc b/cadence/transactions/bridge/admin/evm/add_deployer.cdc index 8126856c..a4be41f0 100644 --- a/cadence/transactions/bridge/admin/evm/add_deployer.cdc +++ b/cadence/transactions/bridge/admin/evm/add_deployer.cdc @@ -10,24 +10,24 @@ import "FlowEVMBridgeUtils" /// transaction(deployerTag: String, deployerEVMAddressHex: String) { + let targetDeployerEVMAddress: EVM.EVMAddress let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount var postDeployer: EVM.EVMAddress? prepare(signer: auth(BorrowValue) &Account) { + self.targetDeployerEVMAddress = EVM.addressFromString(deployerEVMAddressHex) self.coa = signer.storage.borrow(from: /storage/evm) ?? panic("Could not borrow COA from provided gateway address") - self.postDeployer = nil } execute { // Execute the call - let deployerEVMAddress = EVM.addressFromString(deployerEVMAddressHex) let callResult = self.coa.call( to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), data: EVM.encodeABIWithSignature( "addDeployer(string,address)", - [deployerTag, deployerEVMAddress] + [deployerTag, self.targetDeployerEVMAddress] ), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -49,12 +49,12 @@ transaction(deployerTag: String, deployerEVMAddressHex: String) { let decodedResult = EVM.decodeABI( types: [Type()], data: postDeployerResult.data - ) as! [AnyStruct] + ) assert(decodedResult.length == 1, message: "Invalid response from getDeployer call") self.postDeployer = decodedResult[0] as! EVM.EVMAddress } post { - self.postDeployer!.toString() == deployerEVMAddressHex: "Deployer was not properly configured" + self.postDeployer!.equals(self.targetDeployerEVMAddress): "Deployer was not properly configured" } } diff --git a/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc b/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc index e6280768..a7a02b38 100644 --- a/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc +++ b/cadence/transactions/bridge/admin/evm/set_delegated_deployer.cdc @@ -9,21 +9,21 @@ import "FlowEVMBridgeUtils" /// transaction(deployerEVMAddressHex: String) { + let targetDeployerEVMAddress: EVM.EVMAddress let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount var postDelegatedDeployer: EVM.EVMAddress? prepare(signer: auth(BorrowValue) &Account) { + self.targetDeployerEVMAddress = EVM.addressFromString(deployerEVMAddressHex) self.coa = signer.storage.borrow(from: /storage/evm) ?? panic("Could not borrow COA from provided gateway address") - self.postDelegatedDeployer = nil } execute { // Execute the call - let deployerEVMAddress = EVM.addressFromString(deployerEVMAddressHex) let callResult = self.coa.call( - to: deployerEVMAddress, + to: self.targetDeployerEVMAddress, data: EVM.encodeABIWithSignature( "setDelegatedDeployer(address)", [FlowEVMBridgeUtils.getBridgeFactoryEVMAddress()] @@ -35,7 +35,7 @@ transaction(deployerEVMAddressHex: String) { // Confirm the delegated deployer was set let postDelegatedDeployerResult = self.coa.call( - to: deployerEVMAddress, + to: self.targetDeployerEVMAddress, data: EVM.encodeABIWithSignature("delegatedDeployer()", []), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -51,7 +51,7 @@ transaction(deployerEVMAddressHex: String) { } post { - self.postDelegatedDeployer!.toString() == FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString(): + self.postDelegatedDeployer!.equals(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress()): "FlowBridgeFactory address " .concat(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString()) .concat(" was not set as the delegated deployer in the deployer contract ") diff --git a/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc b/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc index 171492f2..68bd94aa 100644 --- a/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc +++ b/cadence/transactions/bridge/admin/evm/set_deployment_registry.cdc @@ -13,10 +13,12 @@ import "FlowEVMBridgeUtils" /// transaction(registryEVMAddressHex: String) { + let targetRegistryEVMAddress: EVM.EVMAddress let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount var postRegistry: EVM.EVMAddress? prepare(signer: auth(BorrowValue) &Account) { + self.targetRegistryEVMAddress = EVM.addressFromString(registryEVMAddressHex) self.coa = signer.storage.borrow(from: /storage/evm) ?? panic("Could not borrow COA from provided gateway address") self.postRegistry = nil @@ -24,12 +26,11 @@ transaction(registryEVMAddressHex: String) { execute { // Execute call - let registryEVMAddress = EVM.addressFromString(registryEVMAddressHex) let callResult = self.coa.call( to: FlowEVMBridgeUtils.getBridgeFactoryEVMAddress(), data: EVM.encodeABIWithSignature( "setDeploymentRegistry(address)", - [registryEVMAddress] + [self.targetRegistryEVMAddress] ), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -51,13 +52,13 @@ transaction(registryEVMAddressHex: String) { let decodedResult = EVM.decodeABI( types: [Type()], data: postRegistryResult.data - ) as! [AnyStruct] + ) assert(decodedResult.length == 1, message: "Invalid response from getRegistry() call to FlowBridgeFactory contract") self.postRegistry = decodedResult[0] as! EVM.EVMAddress } post { - self.postRegistry!.toString() == registryEVMAddressHex: + self.postRegistry!.equals(self.targetRegistryEVMAddress): "Registry address " .concat(registryEVMAddressHex) .concat(" was not set in the FlowBridgeFactory contract ") diff --git a/cadence/transactions/bridge/admin/evm/set_registrar.cdc b/cadence/transactions/bridge/admin/evm/set_registrar.cdc index 78e7f642..4b8c2e33 100644 --- a/cadence/transactions/bridge/admin/evm/set_registrar.cdc +++ b/cadence/transactions/bridge/admin/evm/set_registrar.cdc @@ -9,19 +9,20 @@ import "FlowEVMBridgeUtils" /// transaction(registryEVMAddressHex: String) { + let targetRegistryEVMAddress: EVM.EVMAddress let coa: auth(EVM.Call) &EVM.CadenceOwnedAccount var postRegistrar: EVM.EVMAddress? prepare(signer: auth(BorrowValue) &Account) { + self.targetRegistryEVMAddress = EVM.addressFromString(registryEVMAddressHex) self.coa = signer.storage.borrow(from: /storage/evm) ?? panic("Could not borrow COA from provided gateway address") self.postRegistrar = nil } execute { - let registryEVMAddress = EVM.addressFromString(registryEVMAddressHex) let callResult = self.coa.call( - to: registryEVMAddress, + to: self.targetRegistryEVMAddress, data: EVM.encodeABIWithSignature( "setRegistrar(address)", [FlowEVMBridgeUtils.getBridgeFactoryEVMAddress()] @@ -33,7 +34,7 @@ transaction(registryEVMAddressHex: String) { // Confirm the registrar was set let postRegistrarResult = self.coa.call( - to: registryEVMAddress, + to: self.targetRegistryEVMAddress, data: EVM.encodeABIWithSignature("registrar()", []), gasLimit: 15_000_000, value: EVM.Balance(attoflow: 0) @@ -49,7 +50,7 @@ transaction(registryEVMAddressHex: String) { } post { - self.postRegistrar!.toString() == FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString(): + self.postRegistrar!.equals(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress()): "FlowBridgeFactory address " .concat(FlowEVMBridgeUtils.getBridgeFactoryEVMAddress().toString()) .concat(" was not set as the registrar in the registry contract ") From 160c682dfb5d2ef7e28094c53b9e634d2dbcc438 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:25:38 -0600 Subject: [PATCH 7/7] add fee values to deployment script & fix deployment log --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 73df42d5..2687c0eb 100644 --- a/main.go +++ b/main.go @@ -148,7 +148,7 @@ func main() { checkNoErr(erc20DeployerDeployment.Err) erc20DeployerAddr := getContractAddressFromEVMEvent(erc20DeployerDeployment) - log.Printf("ERC20 Deployer deployed to address: %s", factoryAddr) + log.Printf("ERC20 Deployer deployed to address: %s", erc20DeployerAddr) /// Deploy ERC721 deployer /// // @@ -163,7 +163,7 @@ func main() { checkNoErr(erc721DeployerDeployment.Err) erc721DeployerAddr := getContractAddressFromEVMEvent(erc721DeployerDeployment) - log.Printf("ERC721 Deployer deployed to address: %s", factoryAddr) + log.Printf("ERC721 Deployer deployed to address: %s", erc721DeployerAddr) /* --- Cadence Configuration --- */ @@ -289,12 +289,12 @@ func main() { onboardFeeResult := o.Tx("bridge/admin/fee/update_onboard_fee", WithSigner("flow-evm-bridge"), - WithArg("newFee", 0.0), + WithArg("newFee", 1.0), ) checkNoErr(onboardFeeResult.Err) baseFeeResult := o.Tx("bridge/admin/fee/update_base_fee", WithSigner("flow-evm-bridge"), - WithArg("newFee", 0.0), + WithArg("newFee", 0.001), ) checkNoErr(baseFeeResult.Err)