xSafe
  • Overview
  • 💻Developers
    • Smart Contracts
      • Create3Factory
  • 🔍References
    • FAQ
    • Deployed Contracts
    • Glossary
    • GitHub
    • User Interface
  • 💬Community
    • Telegram
    • Twitter
Powered by GitBook
On this page
  • Write Methods
  • deploy()
  • Read Methods
  • userNonces()
  • getTransactionHash()
  • getAddress()
  • getBytecodeHash()
  • getDeploymentHistory()

Was this helpful?

  1. Developers
  2. Smart Contracts

Create3Factory

Facilitates intent-based smart contract deployments at predictable addresses.

PreviousSmart ContractsNextFAQ

Last updated 1 year ago

Was this helpful?

Write Methods

deploy()

This function deploys the smart contract that corresponds to the provided and encoded constructor arguments. This deployment is only possible if the provided signed the message hash returned by .

function deploy(
    address _principal,
    bytes memory _signature,
    bytes memory _creationCode,
    bytes memory _constructorArgsCode
) public payable {}
Parameter Name
Type
Description

_principal

address

The address of the account that signed the message hash.

_signature

bytes

_creationCode

bytes

The bytecode of the contract to be deployed without the constructor arguments.

_constructorArgsCode

bytes

The encoded constructor arguments of the contract to be deployed.

Read Methods

userNonces()

Given a address and a contract's , this mapping returns the number of times the contract has been deployed for the principal through the Create3Factory contract. For example, if the smart contract in question has never been deployed for the given principal address, the current nonce would be zero.

mapping(address => mapping(bytes32 => uint256)) public userNonces;
Paremeter Name
Type
Description

_principal

address

The address of the account intending to deploy the contract through the Create3Factory contract.

_hashedCreationCode

bytes32

Return Value
Type
Description

nonce

uint256

getTransactionHash()

function getTransactionHash(
    address _principal, 
    bytes memory _creationCode
) public view returns (bytes32) {}
Paremeter Name
Type
Description

_principal

address

The address of the account intending to deploy the contract through the Create3Factory contract.

_creationCode

bytes

The bytecode of the contract to be deployed without the constructor arguments.

Return Value
Type
Description

txHash

bytes32

getAddress()

function getAddress(
    address _principal, 
    bytes memory _creationCode
) public view returns (address) {}
Paremeter Name
Type
Description

_principal

address

The address of the account intending to deploy the contract through the Create3Factory contract.

_creationCode

bytes

The bytecode of the contract to be deployed without the constructor arguments.

Return Value
Type
Description

expectedAddress

address

The address that the given contract would have if it is deployed through the Create3Factory contract.

getBytecodeHash()

function getBytecodeHash(
    bytes memory _creationCode
) public pure returns (bytes32) {}
Paremeter Name
Type
Description

_creationCode

bytes

The bytecode of the contract without the constructor arguments.

Return Value
Type
Description

bytecodeHash

bytes32

The keccak256 hash of the provided bytecode.

getDeploymentHistory()

function getDeploymentHistory(
    address _principal
) public view returns (address[] memory) {}
Paremeter Name
Type
Description

_principal

address

The address of the account for whom the list of smart contracts were deployed through the Create3Factory contract.

Return Value
Type
Description

deploymentHistory

address[]

The resulting signature from the account signing the messahge hash.

The keccak256 hash of the contract's .

The number of times a given contract has been deployed for a given through the Create3Factory contract.

Given a address and a contract's , this function returns the hash the principal account needs to sign to deploy the corresponding smart contract through the Create3Factory contract.

The hash the account needs to sign to deploy a given smart contract through the Create3Factory contract.

Given a address and a contract's , this function returns the address the corresponding smart contract would have if it is deployed through the Create3Factory contract.

Given a contract's , this function returns keccak256 hash of the provided bytecode.

Given a address, this function returns a list of contract addresses that corresponds to all the contracts that have been deployed for the provided principal through the Create3Factory contract.

A list of contract addresses that corresponds to all the contracts that have been deployed for the provided through the Create3Factory contract.

💻
principal
creation code
principal
creation code
creation code
principal
creation code
principal
principal
creation code
getTransactionHash()
principal
creation code
principal
principal
principal