-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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-1404: Simple Restricted Token Standard #1404
Comments
This seems very similar to #902? 902 uses a No worries either way, but happy to discuss updates into 902 if you found something missing in it. Thanks for taking the time to write up and submit this as an EIP! |
@bmann Thanks for chiming in! Looks like #902's In ERC1404, |
Some questions (might be dumb):
|
Hi, I'm very interested in using this standard for a governance project with regards to access control. Anybody looked into how this would work with Giveth's mini-me contract? |
@Graeme-Code, I have not personally used the MiniMe pattern but at a cursory glance of Giveth's repo, it seems you would need to use a version of the If there is considerable interest in this use-case I would be happy to add an implementation to our examples repo. |
Thank you for the quick response. Running some tests internally and getting
consensus on the idea. Will let you know if it is implemented. Cheers
…On Thu, Sep 20, 2018 at 6:07 PM Ron Gierlach ***@***.***> wrote:
@Graeme-Code <https://github.com/Graeme-Code>, I have not personally used
the MiniMe pattern but at a cursory glance of Giveth's repo, it seems you
would need to use a version of the MiniMeToken.sol contract modified to
implement ERC1404 -- the place to look is function doTransfer() on this
contract
<https://github.com/Giveth/minime/blob/master/contracts/MiniMeToken.sol>.
If there is considerable interest in this use-case I would be happy to add
an implementation to our examples repo
<https://github.com/simple-restricted-token/simple-restricted-token>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1404 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHjHZa18GBJ_sA_N7uD-3jEeQuL4U_jdks5uc8tPgaJpZM4Wktae>
.
--
I respond faster on Status, use my contact code below to add me:
0x043d3e8477d431c44cdb12f69375726ed3fa83b4409a2848fa8f625c9394f6214ad473cb5314c5c50cb8cc3e4f4ba870afb6364c730a5664f4ad2c523e66ccc431
|
@veikkoeeva No dumb questions! Will try and address each of these to the best of my ability.
|
@rongierlach (or @masonicGIT). Hey, I appreciate you took the time to get back. I'll keep the numbering in the following, but instead of quoting just paraphrase.
The reason why I noted these might be dumb, or confused questions, are that I don't have deep knowledge on securities and trading and English isn't my native language (the terminology feels a bit problematic). I see there are plenty of inefficiencies in trading globally and fungibility is very much desired. I'm wondering also if there were a use case, now in the age of blockchain, for non-fungible securities as in with green bonds. I could imagine -- maybe wrongly -- greend bonds issued to construction could be tied to particular buildings are in the power plant building noted in the earlier green bond link. In that sense the bonds might not be fully fungible. Or they might be fully tradeable, but still maintain an unique link to off-chain data (like in ERC-721/ERC-721x/ERC-1155). While writing this, I noticed Dharma protocol which seems to aim tokenizing debt into securities using ERC-721 (link to Ethereum contracts at https://blog.dharma.io/dharma-bug-bounty-erc721-collateralization-137b2baeca24). In my mind securities and debt securities are around the same issue, but I might be misguided here. If there is something I could find more information on, I'm happy to do put some effort. I'm equally happy to be noted this is out-of-scope and/or I need to check some sources to increase my understanding otherwise. Once again, I appreciate the effort to get back with explanations. I for one would appreciate an added sample to the sample repo on non-fungible asset. |
I am an eth fan and solidity beginner from China. I think this this standard is very useful. I do some simple implement for this standard. I do not implement the ban function. But it's easy. uint8 restrictionCode = detectTransferRestriction(_from, _to, _value);
if( restrictionCode != 0 ) {
revert(restrictionCode);
} There is the ERC1404 contract. contract ERC1404 is StandardToken , Pausable {
mapping(uint8 => string) restrictionMap;
mapping(address => bool) blackList;
constructor () public {
restrictionMap[1] = "Token is pausing!";
restrictionMap[2] = "sender has been banned!";
restrictionMap[3] = "receiver has been banned!";
}
function detectTransferRestriction (address from, address to, uint256 value) public view returns (uint8){
if (paused == true ) {
return 1;
}
if (blackList[from] == true ) {
return 2;
}
if ( blackList[to] == true ) {
return 3;
}
return 0;
}
function messageForTransferRestriction (uint8 restrictionCode) public view returns (string){
if (bytes(restrictionMap[restrictionCode]).length == 0 ){
return "Restriction code incorrect!";
}
return restrictionMap[restrictionCode];
}
}
|
@zxlzy At a cursory glance this implementation seems correct. Nice work! 👍 |
Hi I noticed #1155 was linked here regarding the batch transfer possibility. I should note that I don't see a problem with someone implementing "AContract is 1155,1404" and in the transferring of tokens simply calling the detectTransferRestriction each time... However if you did want to do 100 transfers in one batch tx perhaps, the requirement to revert on one non-zero return would mean that for eg. instead of 99 transfers passing and 1 failing, all 100 transfers would fail. Maybe that is something to consider when developing this standard? Of course however if the detectTransferRestriction is called for each transaction off chain first, then you could do the above batching without having to enforce the check on chain but I'm not aware of the use cases of this standard enough to say that the detection has to always happen on chain during the transfer to make things transparent and secure. Perhaps, you would just have to do both off and on checks to "guarantee" a batch would make it through in the majority of cases and still enforce security and transparency. So offline at least (without regard for usable/nice code):
any that might fail the above you could drop from the arrays and at least salvage things (unless you needed to guarantee a set and so dropping the entire set might be desirable). |
"The logic of detectTransferRestriction and messageForTransferRestriction are left up to the issuer." Just to be clear, the detectTransferRestriction doesn't give a third party any knowledge of the full set of transfer restrictions and rules which might apply to a token right? All this standard would do is 1) check if something can be transferred against something offchain and 2) report some sort of error (but not necessarily in any standardized format). |
I'd suggest use of ERC-1066 and ERC-1444 for this purpose. It's a good thing they've appeared just in time. |
@JILaw However, if a portion or all of this logic depends on a call to an oracle dealing with an off-chain check, this may not be so obvious to a third party -- all this remains up to the issuer. Standard error codes are not spec'd in #1404 but are a good to be thinking about! @xlab #1066 and the discussions branching off of it seem like really promising avenues towards accomplishing this end, thank you for bringing to my attention! Along these lines and in your opinion, should Appreciate all the productive discussion around this issue! |
Nice proposal! A couple initial thoughts if I may:
|
What’s the point of having the standards so specific they are practically designed to work for specific platforms? You might want to have a look at ERC-1462 |
@jeffishjeff - Excellent feedback, really appreciate your thoughts on this.
Really appreciate the thoughtfulness of your feedback. Cheers! 😎 |
Hey @jeffishjeff - #4 was direct and consistent feedback from technical integrators of the standard. Would be hard to err from this one at the moment. |
tagging #1444, an expansion of ERC-1066, to the thread |
ik |
OK |
I think it's terribly bad idea to embrace security tokens: Enforcing Token Lock-Up Periods (reasonable) Generally blockchains cannot enforce property rights for things outside of the blockchain context - you may make smart contract that will punish person by slashing their deposit but this is limited ( you cannot enforce below zero that way) Meanwhile in meatspace actual law is able to enforce with literal force. Source: https://uncommoncore.co/bitcoin-and-the-promise-of-independent-property-rights/ By adding lots of compliance into Ethereum directly one is hurting the Ethereum values (globally accessible, more free and more trustworthy Internet ) You don't need blockchain to issue equity shares, you can just use regular database. No value is created "Security Tokens for traditional businesses is like PDF'ing the NYT in the 1990's to put it on the internet. This is a method to put the news on the internet but it is the incorrect approach" |
Hello - We are simply using the Ethereum blockchain based on demand, its one of the best tested and widely adopted at the moment. The Ethereum blockchain can always be used completely openly, however when integrated into businesses, they have regulatory obligations. This standard is designed to help them meet their corporate obligations while following their own laws. That in no way impinges certain values onto other users, they are merely additional users on the network. One of the big benefits of building this on Ethereum is the shared infrastructure. There is the opportunity to build a financial fabric that is available 24/7 and that enables global access to assets in a compliant/automated manner. This may seem like a closed approach, but there is a lot being done to create greater interconnectivity between countries that don't have access to financially mature markets like HK, US, or UK. In a way, it is more powerful that the traditional financial markets are being forced to open up beyond the existing participants. Either way, greater adoption of Ethereum = more fees for miners :-) Also - Lawson is an author on the standard. |
Sounds right - it seems that the most important part would detectTransferRestriction logic ( where most of the compliance code will be located ) |
I think it would be useful to specify the content of the revert message when a restriction prevents a One alternative is to dictate that the revert message should be the one returned by |
We handle the revert message this way in all of our example and reference implementations -- https://github.com/simple-restricted-token/reference-implementation/blob/master/contracts/token/ERC1404/ERC1404ReferenceImpl.sol#L42 |
Hey @youfoundron, thanks for your quick reply. I'm aware of that and forgot to mention it in my previous comment. My suggestion is to standardize that behavior, so every compliant implementation does the same. |
@alcuadrado Good suggestion. Thanks. |
This ERC seems quite elegant to me. I only have a reserve regarding the use of uint8 instead of uint256. Using uint8 is not straightforward as the EVM works with 256bits. In Solidity, we can do an explicit typecast but in Vyper for example there is no such option, just an implicit typecast from uint8 to uint256 which means that messageForTransferRestriction() cannot be called from a smart-contract written in Vyper. I would suggest using uint256 instead of uint8. |
Why not making the messages codes power of 2 and returning a binary combination? Eg if |
The text says:
Which event is meant here? It seems not to be referenced. |
@ritzdorf great catch, updated accordingly. |
ERC1404 support is added to the Ethereum Walet WordPress plugin (https://wordpress.org/plugins/ethereum-wallet/). If transfer is not allowed, corresponding error message would be displayed. |
ERC-1404 was just approved for use in a publicly-traded, SEC registered fund. The first time the SEC has approved a token on a public blockchain. https://www.sec.gov/Archives/edgar/data/1758583/000121465920006145/j76202497.htm |
It feels like someone should turn this into an actual standard at some point, rather than just an idea for a standard. 😄 |
Second sec-registered token on ERC-1404 for INX. This one is a full IPO. https://etherscan.io/token/0xBBC7f7A6AADAc103769C66CBC69AB720f7F9Eae3#readContract |
Bank Guarantees are not able to be traded, sold or discounted, however they can be monetised if they are a demand bank guarantee and are covered by ICC rules URDG 758 |
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. |
Simple Restricted Token Standard
Simple Summary
A simple and interoperable standard for issuing tokens with transfer restrictions. The following draws on input from top issuers, law firms, relevant US regulatory bodies, and exchanges.
Abstract
Current ERC token standards have provided the community with a platform on which to develop a decentralized economy that is focused on building Ethereum applications for the real world. As these applications mature and face consumer adoption, they begin to interface with corporate governance requirements as well as regulations. They must not only be able to meet corporate and regulatory requirements but must also be able to integrate with technology platforms underpinning their associated businesses. What follows is a simple and extendable standard that seeks to ease the burden of integration for wallets, exchanges, and issuers.
Motivation
Token issuers need a way to restrict transfers of ERC-20 tokens to be compliant with securities laws and other contractual obligations. Current implementations do not address these requirements.
A few emergent examples:
Furthermore, standards adoption amongst token issuers has the potential to evolve into a dynamic and interoperable landscape of automated compliance.
The following design gives greater freedom / upgradability to token issuers and simultaneously decreases the burden of integration for developers and exchanges.
Additionally, we see fit to provide a pattern by which human-readable messages may be returned when token transfers are reverted. Transparency as to why a token's transfer was reverted is of equal importance to the successful enforcement of the transfer restriction itself.
A widely adopted standard for detecting restrictions and messaging errors within token transfers will highly convenience the exchanges, wallets, and issuers of the future.
Specification
The ERC-20 token provides the following basic features:
The ERC-1404 standard builds on ERC-20's interface, adding two functions:
The logic of
detectTransferRestriction
andmessageForTransferRestriction
are left up to the issuer.The only requirement is that
detectTransferRestriction
must be evaluated inside a token'stransfer
andtransferFrom
methods.If, inside these transfer methods,
detectTransferRestriction
returns a value other than0
, the transaction should be reverted.Rationale
The standard proposes two functions on top of the ERC-20 standard. Let's discuss the rationale for each.
detectTransferRestriction
- This function is where an issuer enforces the restriction logic of their token transfers. Some examples of this might include, checking if the token recipient is whitelisted, checking if a sender's tokens are frozen in a lock-up period, etc. Because implementation is up to the issuer, this function serves solely to standardize where execution of such logic should be initiated. Additionally, 3rd parties may publicly call this function to check the expected outcome of a transfer. Because this function returns auint8
code rather than a boolean or just reverting, it allows the function caller to know the reason why a transfer might fail and report this to relevant counterparties.messageForTransferRestriction
- This function is effectively an accessor for the "message", a human-readable explanation as to why a transaction is restricted. By standardizing message look-ups, we empower user interface builders to effectively report errors to users.Backwards Compatibility
By design ERC-1404 is fully backwards compatible with ERC-20.
Some examples of how it may be integrated with common types of restricted tokens may be found here.
Test Cases & Implementation
See the reference implementation and tests here.
See some examples of common usage patterns for ERC-1404 here.
Copyright
Copyright and related rights waived via CC0.
The text was updated successfully, but these errors were encountered: