-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC 1594: Core Security Token Standard #1594
Comments
Hey, thanks for all of your efforts. I have a question: Isn't function canTransferFrom(address _from, address _to, uint256 _value, bytes _data) external view returns (byte, bytes32); underspecified? Consider the following scenario:
Therefore, my proposal would be to extend function canTransferFrom(address _from, address _to, address _forwarder, uint256 _value, bytes _data) external view returns (byte, bytes32); |
Can’t you infer B from However, there may be an argument for including an overloaded version of |
Sure. You are right that I am just envisioning a scenario where these checks are done by a separate contract which might make sense for reasons of modularity, reusability and upgradability. But I definitely also see your point about simplicity. |
Great work @adamdossa . We're pretty in line with this design at Meridio, and the community's move to decompose ERC-1400. A few comments around issuance/redemption as part of the standard:
i.e. A peer at Meridio (Asha Dakshi) pointed out that from an audit perspective, |
Is there consensus on whether The boolean is included in the "Interface" section of this document, but omitted in the "canTransfer / canTransferFrom" section. |
Where are the Jurisdictions defined/registered? |
I think canTransferTo would make more sense, since it is the receiver who is restricted rather than the sender. so if the receiver is in the white list, then the transfer can complete. |
@cyberience A transfer can fail for various reasons. A whitelisted address is definitely one of those reasons, which essentially add restrictions to who you can send the tokens to. At the same time, a transfer can fail due to insufficient balance from the sender. |
Hi folks, we've recently open sourced our implementation of ERC1594 (and ERC1644) here: http://github.com/tenx-tech/tenx-token Cheers! |
There has been no activity on this issue for two months. It will be closed in a week if no further activity occurs. If you would like to move this EIP forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review. |
This issue was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment. |
Thanks to everyone involved so far! This is really great work. Germany has recently made a big move forward and actually put a law in place governing security tokens. As this new law also promotes interoperability of tokens from different issuers, I would like to open up the discussion again. To speed up the adoption of the standard, I would like to propose the following changes:
Looking forward to hear your thought on this! |
eip: ERC-1594
title: Core Security Token Standard (part of the ERC-1400 Security Token Standards)
author: Adam Dossa (@adamdossa), Pablo Ruiz (@pabloruiz55), Fabian Vogelsteller (@frozeman), Stephane Gosselin (@thegostep)
discussions-to: #1411
status: Draft
type: Standards Track
category: ERC
created: 2018-09-09
require: ERC-20 (#20), ERC-1066 (#1066)
Simple Summary
This standard sits under the ERC-1400 (#1411) umbrella set of standards related to security tokens.
Provides a standard to support off-chain injection of data into transfers / issuance / redemption and the ability to check the validity of a transfer distinct from it's execution.
Abstract
Incorporates error signalling, off-chain data injection and issuance / redemption semantics.
This standard inherits from ERC-20 (#20) and could be easily extended to meet the ERC-777 (#777) standard if needed.
Motivation
Accelerate the issuance and management of securities on the Ethereum blockchain by specifying a standard interface through which security tokens can be operated on and interrogated by all relevant parties.
Security tokens differ materially from other token use-cases, with more complex interactions between off-chain and on-chain actors, and considerable regulatory scrutiny.
The ability to provide data (e.g. signed authorisation) alongside transfer, issuance and redemption functions allows security tokens to more flexibly implement transfer restrictions without depending on on-chain whitelists exclusively.
Using ERC-1066 (#1066) to provide reason codes as to why a transfer would fail, without requiring a user to actually try and execute a transfer, allows for improved UX and potentially saves gas on what would otherwise be failed transfers.
Formalising issuance and redemption semantics (similar to minting / burning) provides visibility into the total supply of the token and how it has changed over time.
Requirements
See ERC-1400 (#1411) for a full set of requirements across the library of standards.
The following requirements have been compiled following discussions with parties across the Security Token ecosystem.
Rationale
Transfer Restrictions
Transfers of securities can fail for a variety of reasons in contrast to utility tokens which generally only require the sender to have a sufficient balance.
These conditions could be related to metadata of the securities being transferred (i.e. whether they are subject to a lock-up period), the identity of the sender and receiver of the securities (i.e. whether they have been through a KYC process, whether they are accredited or an affiliate of the issuer) or for reasons unrelated to the specific transfer but instead set at the token level (i.e. the token contract enforces a maximum number of investors or a cap on the percentage held by any single investor).
For ERC-20 / ERC-777 tokens, the
balanceOf
andallowance
functions provide a way to check that a transfer is likely to succeed before executing the transfer, which can be executed both on and off-chain.For tokens representing securities the standard introduces a function
canTransfer
which provides a more general purpose way to achieve this when the reasons for failure are more complex; and a function of the whole transfer (i.e. includes any data sent with the transfer and the receiver of the securities).In order to support off-chain data inputs to transfer functions, transfer functions are extended to
transferWithData
/transferFromWithData
which can optionally take an additionalbytes _data
parameter.In order to provide a richer result than just true or false, a byte return code is returned. This allows us to give a reason for why the transfer failed, or at least which category of reason the failure was in. The ability to query documents and the expected success of a transfer is included in Security Token section.
Specification
Restricted Transfers
canTransfer / canTransferFrom
Transfers of securities may fail for a number of reasons, for example relating to:
The standard provides an on-chain function to determine whether a transfer will succeed, and return details indicating the reason if the transfer is not valid.
These rules can either be defined using smart contracts and on-chain data, or rely on
_data
passed as part of thetransferWithData
function which could represent authorisation for the transfer (e.g. a signed message by a transfer agent attesting to the validity of this specific transfer).The function will return both a ESC (Ethereum Status Code) following the EIP-1066 standard, and an additional
bytes32
parameter that can be used to define application specific reason codes with additional details (for example the transfer restriction rule responsible for making the transfer operation invalid).If
bytes _data
is empty, then this corresponds to a check on whether atransfer
(ortransferFrom
) request will succeed, ifbytes _data
is populated, then this corresponds to a check ontransferWithData
(ortransferFromWithData
) will succeed.canTransfer
assumes the sender of tokens ismsg.sender
and will be executed viatransfer
ortransferWithData
whereascanTransferFrom
allows the specification of the sender of tokens and that the transfer will be executed viatransferFrom
ortransferFromWithData
.transferWithData
Transfer restrictions can take many forms and typically involve on-chain rules or whitelists. However for many types of approved transfers, maintaining an on-chain list of approved transfers can be cumbersome and expensive. An alternative is the co-signing approach, where in addition to the token holder approving a token transfer, and authorised entity provides signed data which further validates the transfer.
The
bytes _data
allows arbitrary data to be submitted alongside the transfer, for the token contract to interpret or record. This could be signed data authorising the transfer (e.g. a dynamic whitelist) but is flexible enough to accomadate other use-cases.transferWithData
MUST emit aTransfer
event with details of the transfer.transferFromWithData
This is the analogy to the
transferWithData
function.msg.sender
MUST have a sufficientallowance
set and thisallowance
must be debited by the_value
.Token Issuance
isIssuable
A security token issuer can specify that issuance has finished for the token (i.e. no new tokens can be minted or issued).
If a token returns FALSE for
isIssuable()
then it MUST always return FALSE in the future.If a token returns FALSE for
isIssuable()
then it MUST never allow additional tokens to be issued.issue
This function must be called to increase the total supply.
The
bytes _data
parameter can be used to inject off-chain data (e.g. signed data) to authorise or authenticate the issuance and receiver of issued tokens.When called, this function MUST emit the
Issued
event.Token Redemption
redeem
Allows a token holder to redeem tokens.
The redeemed tokens must be subtracted from the total supply and the balance of the token holder. The token redemption should act like sending tokens and be subject to the same conditions.
The
Redeemed
event MUST be emitted every time this function is called.As with
transferWithData
this function has abytes _data
parameter that can be used in the token contract to authenticate the redemption.redeemFrom
This is the analogy to the
redeem
function.msg.sender
MUST have a sufficientallowance
set and thisallowance
must be debited by the_value
.The
Redeemed
event MUST be emitted every time this function is called.Interface
References
The text was updated successfully, but these errors were encountered: