ERC-20 with Compliance rules

Two-step process of Signature Gated Contract Deployment

Code examples are based on viem

  1. Get the contract bytecode and ABI from the endpoint

  2. Deploy the contract:

const hash = await walletClient.deployContract({
  abi,
  bytecode,
  account, // e.g. metamask account
});
  1. Save the deployed ERC20 address:
const receipt = await client.waitForTransactionReceipt({ hash });

const contractAddress = receipt.contractAddress;
  1. Use this address as the erc20Address in this endpoint Get ERC1967Proxy. Provide other fields too.

  2. Use the call result as the parameters for deployment of ERC1967 Proxy, which is required by previously deployed upgradable ERC20:

const hash = await walletClient.deployContract({
    abi,
    bytecode,
    args
    account // e.g. metamask account
});

const receipt = await client.waitForTransactionReceipt({ hash });

const finalAddress = receipt.contractAddress;
  1. The upgradable and signature-gated ERC20 token is deployed at the address finalAddress.
  2. Grant a desired address WHITELISTED_SPENDER_ROLE by invoking /issuance/erc20/grantRole. In case of Fractions Platform, this role must be given to the Wrapper of the platform in order to allow wrapping of this ERC20.