Appearance
Solidity API
TokenCustodyFactory
_Factory contract for deploying TokenCustody contract using CREATE2.
This implementation provides a way to deterministically deploy TokenCustody contract using the CREATE2 opcode.
The caller of deployTokenCustodyFromFactory is set as the depositor in the newly deployed token custody contract._
TokenCustodyCreated
solidity
event TokenCustodyCreated(address _address, bytes32 _salt)
Emitted when a new TokenCustody contract is created.
Parameters
Name | Type | Description |
---|---|---|
_address | address | The address of the newly deployed TokenCustody contract |
_salt | bytes32 | The salt value used in CREATE2 deployment |
TokenCustodyCreate2DeploymentFailed
solidity
error TokenCustodyCreate2DeploymentFailed(bytes32 salt)
Error thrown when the CREATE2 deployment fails
deployTokenCustodyFromFactory
solidity
function deployTokenCustodyFromFactory(string _erc1155uri, bytes32 _salt) public returns (address)
_Deploys a new TokenCustody contract using CREATE2.
This function creates a new TokenCustody 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
Name | Type | Description |
---|---|---|
_erc1155uri | string | The uri to be set for the undlying erc-1155 contract of token custody contract |
_salt | bytes32 | A unique value used to determine the contract address |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | deployedAddress The address of the newly deployed TokenCustody contract |