From 2519c651e042c46b2d3ea0f3c9785d14536b7c49 Mon Sep 17 00:00:00 2001 From: Giovanni Sanchez <108043524+sisyphusSmiling@users.noreply.github.com> Date: Fri, 12 Apr 2024 17:17:15 -0500 Subject: [PATCH] update onboarding logic to prevent FT w/ unspecified symbol --- cadence/contracts/bridge/FlowEVMBridge.cdc | 8 ++++---- cadence/contracts/bridge/IEVMBridgeTokenMinter.cdc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cadence/contracts/bridge/FlowEVMBridge.cdc b/cadence/contracts/bridge/FlowEVMBridge.cdc index 50d320ac..9b22c09a 100644 --- a/cadence/contracts/bridge/FlowEVMBridge.cdc +++ b/cadence/contracts/bridge/FlowEVMBridge.cdc @@ -679,7 +679,7 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge { let callResult: EVM.Result = FlowEVMBridgeUtils.call( signature: "deployERC721(string,string,string,string,string)", targetEVMAddress: FlowEVMBridgeUtils.bridgeFactoryEVMAddress, - args: [name, symbol, cadenceAddress.toString(), identifier, contractURI], // TODO: Decide on and update symbol + args: [name, symbol, cadenceAddress.toString(), identifier, contractURI], gasLimit: 15000000, value: 0.0 ) @@ -713,7 +713,7 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge { let cadenceAddress = FlowEVMBridgeUtils.getContractAddress(fromType: forTokenType) ?? panic("Could not derive contract address for token type: ".concat(identifier)) // Assign a default symbol - var symbol = "BRDG" + var symbol: String? = nil // Borrow the ViewResolver to attempt to resolve the EVMBridgedMetadata view let viewResolver = getAccount(cadenceAddress).contracts.borrow<&{ViewResolver}>(name: name)! var contractURI = "" @@ -745,7 +745,7 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge { let callResult: EVM.Result = FlowEVMBridgeUtils.call( signature: "deployERC20(string,string,string,string,string)", targetEVMAddress: FlowEVMBridgeUtils.bridgeFactoryEVMAddress, - args: [name, symbol, cadenceAddress.toString(), identifier, contractURI], // TODO: Decide on and update symbol + args: [name, symbol!, cadenceAddress.toString(), identifier, contractURI], // TODO: Decide on and update symbol gasLimit: 15000000, value: 0.0 ) @@ -759,7 +759,7 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge { return EVMOnboardingValues( evmContractAddress: erc20Address, name: name, - symbol: symbol, + symbol: symbol!, decimals: FlowEVMBridgeConfig.defaultDecimals ) } diff --git a/cadence/contracts/bridge/IEVMBridgeTokenMinter.cdc b/cadence/contracts/bridge/IEVMBridgeTokenMinter.cdc index db782520..90409063 100644 --- a/cadence/contracts/bridge/IEVMBridgeTokenMinter.cdc +++ b/cadence/contracts/bridge/IEVMBridgeTokenMinter.cdc @@ -8,7 +8,7 @@ contract interface IEVMBridgeTokenMinter { /// Emitted whenever tokens are minted, identifying the type, amount, and minter access(all) event Minted(type: Type, amount: UFix64, minter: Address) - /// Account-only method to mint an NFT + /// Account-only method to mint a fungible token of the specified amount. /// access(account) fun mintTokens(amount: UFix64): @{FungibleToken.Vault} {