axelar-gmp-sdk-solidity

Solidity API

Deployer

This contract is responsible for deploying and initializing new contracts using a deployment method, such as CREATE2 or CREATE3.

deploy

function deploy(bytes bytecode, bytes32 salt) external payable returns (address deployedAddress_)

Deploys a contract using a deployment method defined by derived contracts.

_The address where the contract will be deployed can be known in advance via {deployedAddress}.

The bytecode for a contract can be obtained from Solidity with type(contractName).creationCode.

Requirements:

Parameters

Name Type Description
bytecode bytes The bytecode of the contract to be deployed
salt bytes32 A salt to influence the contract address

Return Values

Name Type Description
deployedAddress_ address The address of the deployed contract

deployAndInit

function deployAndInit(bytes bytecode, bytes32 salt, bytes init) external payable returns (address deployedAddress_)

Deploys a contract using a deployment method defined by derived contracts and initializes it.

_The address where the contract will be deployed can be known in advance via {deployedAddress}.

The bytecode for a contract can be obtained from Solidity with type(contractName).creationCode.

Requirements:

Parameters

Name Type Description
bytecode bytes The bytecode of the contract to be deployed
salt bytes32 A salt to influence the contract address
init bytes Init data used to initialize the deployed contract

Return Values

Name Type Description
deployedAddress_ address The address of the deployed contract

deployedAddress

function deployedAddress(bytes bytecode, address sender, bytes32 salt) public view returns (address)

Returns the address where a contract will be stored if deployed via {deploy} or {deployAndInit} by sender.

Any change in the bytecode (except for CREATE3), sender, or salt will result in a new deployed address.

Parameters

Name Type Description
bytecode bytes The bytecode of the contract to be deployed
sender address The address that will deploy the contract via the deployment method
salt bytes32 The salt that will be used to influence the contract address

Return Values

Name Type Description
[0] address deployedAddress_ The address that the contract will be deployed to

_deploy

function _deploy(bytes bytecode, bytes32 deploySalt) internal virtual returns (address)

_deployedAddress

function _deployedAddress(bytes bytecode, bytes32 deploySalt) internal view virtual returns (address)