Deploying ERC-1400 token contract on Remix

Hello all!

I am learning more about Ethereum token smart contracts, with particular interest in variations that support more advanced features, such as ERC-1400 for Security Tokens.

I recently gathered the full code here for deployment on Remix // compile seems to work, but I am having issues getting started - I am almost embarrassed to ask, but are there suggested values for these fields pictured below (such as ‘tokenDefaultPartitions:’)? :slight_smile: :

2 Likes

ERC777

If you haven't already, you could start with with ERC777

I did a simple ERC777 token example


ERC1400/ERC140

I am completely new to security tokens, including ERC1400/ERC1410

Regards the contract you provided, I assume you have flattened the ConsenSys implementation.

Tests are normally a good place to look for potential values to use.

https://github.com/ConsenSys/ERC1400/blob/master/test/ERC1400.test.js

this.token = await ERC1400.new('ERC1410Token', 'DAU', localGranularity, [controller], CERTIFICATE_SIGNER, partitions);

Based on the documentation, I assume the following for the constructor:

https://github.com/ethereum/EIPs/issues/1411

ERC-1644: Controller Token Operation Standard

Since security tokens are subject to regulatory and legal oversight (the details of which will vary depending on jurisdiction, regulatory framework and underlying asset) in many instances the issuer (or a party delegated to by the issuer acting as a controller, e.g. a regulator or transfer agent) will need to retain the ability to force transfer tokens between addresses.

These controller transfers should be transparent (emit events that flag this as a forced transfer) and the token contract itself should be explicit as to whether or not this is possible.

  • certificateSigner Address of the off-chain service which signs the conditional ownership certificates required for token transfers, issuance, redemption (Cf. CertificateController.sol).
    The ConsenSys implementation in the repository doesn't include an implementation of the CertificateController, only a mock.

https://github.com/ConsenSys/ERC1400
PS: Since the ERC1400 standard is agnostic about the way to control certificate, we didn't include our certificate controller in this repository (a mock is used instead). In order to perform real advanced conditional ownership, a certificate controller called 'CertificateController.sol' shall be placed in folder '/contracts/CertificateController' instead of the mock placed there.

  /**
   * [NOT MANDATORY FOR ERC1400 STANDARD]
   * @dev Get token default partitions to send from.
   * Function used for ERC777 and ERC20 backwards compatibility.
   * For example, a security token may return the bytes32("unrestricted").
   * @return Default partitions.
   */
  function getTokenDefaultPartitions() external view returns (bytes32[]) {
    return _tokenDefaultPartitions;
  }

I assume that for an initial value you could set a single global default partition to: bytes32("unrestricted")
The Dauriel network demo video had partitions of Reserved, Locked and Issued. (As does the tests for the ConsenSys implementation: https://github.com/ConsenSys/ERC1400/blob/master/test/ERC1400.test.js)

Hope this helps.

3 Likes

Hi @Ro5s checking how you got on with deploying?

Hello @abcoathup . Great explanation. I know this is pretty old topic but here goes nothing. I am trying to make this work on Remix ide and getting an error. I also have a couple of other questions. First, let me summarize the setup:

  • I am deploying the ERC1400 contract
  • Contract variables are set as follows:
  • NAME: "MyTokenFour"
  • SYMBOL: "MTF"
  • GRANULARITY: 1
  • CONTROLLERS: ["0xdD87...", "0xaaJ..."] (2 different addresses)
  • CERTIFICATESIGNER: "0x4b0..." (an address)
  • TOKENDEFAULTPARTITIONS: ["0x7265736572766564000000000000000000000000000000000000000000000000", "0x6973737565640000000000000000000000000000000000000000000000000000", "0x6c6f636b65640000000000000000000000000000000000000000000000000000"]

(reserved, issued and locked in hex format. Should I only give one?)

And when I try to deploy it with these settings, it errors: creation of ERC1400 errored: VM error: revert.
I've tried to debug. It errors at line 364 inside the ERC820Client contract:

ERC820REGISTRY.setInterfaceImplementer(this, interfaceHash, _implementation)

And here are the local variables.
image

What am I missing here? Any ideas? Or any leads where to look for?

I guess it is not because I am missing something. There is an issue related to this topic here: https://github.com/ConsenSys/UniversalToken/issues/35