Skip to content

Solidity API

TradeToken3643Factory

_Factory contract for deploying TradeToken3643 contract using CREATE2.

This implementation provides a way to deterministically deploy TradeToken3643 contract using the CREATE2 opcode.

The factory can deploy different types of TradeToken3643 contract based on the TradeTokenType enum defined in the TradeToken3643 contract._

TradeToken3643Created

solidity
event TradeToken3643Created(address deployedAddress, bytes32 salt)

Emitted when a new TradeToken3643 contract is created.

Parameters

NameTypeDescription
deployedAddressaddressThe address of the newly deployed TradeToken3643 contract
saltbytes32The salt value used in CREATE2 deployment

TradeToken3643Create2Failed

solidity
error TradeToken3643Create2Failed()

Error thrown when the CREATE2 deployment fails

deployTradeToken3643FromFactory

solidity
function deployTradeToken3643FromFactory(enum TradeToken3643.TradeTokenType _tradeTokenType, bytes32 salt) public returns (address)

_Deploys a new TradeToken3643 contract using CREATE2.

This function creates a new TradeToken3643 contract with the specified parameters. The address of the deployed contract is deterministic and depends on the salt value.

Requirements:

  • The deployment must not fail
  • The salt value must not have been used before_

Parameters

NameTypeDescription
_tradeTokenTypeenum TradeToken3643.TradeTokenTypeThe type of TradeToken3643 to deploy
saltbytes32A unique value used to determine the contract address

Return Values

NameTypeDescription
[0]addressdeployedAddress The address of the newly deployed TradeToken3643 contract