Skip to content

Commit

Permalink
update onboarding logic to prevent FT w/ unspecified symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Apr 12, 2024
1 parent a6cc0fc commit 2519c65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cadence/contracts/bridge/FlowEVMBridge.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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 = ""
Expand Down Expand Up @@ -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
)
Expand All @@ -759,7 +759,7 @@ contract FlowEVMBridge : IFlowEVMNFTBridge, IFlowEVMTokenBridge {
return EVMOnboardingValues(
evmContractAddress: erc20Address,
name: name,
symbol: symbol,
symbol: symbol!,
decimals: FlowEVMBridgeConfig.defaultDecimals
)
}
Expand Down
2 changes: 1 addition & 1 deletion cadence/contracts/bridge/IEVMBridgeTokenMinter.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -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} {
Expand Down

0 comments on commit 2519c65

Please sign in to comment.