Closed StartfundInc closed 2 years ago
Hi @StartfundInc thank you for your EIP.
2000
to 5470
.Thanks @xinbenlv I will make this topic in PR(Pull Request) and based on eip-template.md format.
Can you tell me what is the naming rules for ERC? You said use 5470, but it is issue numbering. When I make PR, How can I choose the ERC Number?
Thanks
How can I choose the ERC Number?
You don't. Editors assign it.
Thanks @xinbenlv I will make this topic in PR(Pull Request) and based on eip-template.md format.
Can you tell me what is the naming rules for ERC? You said use 5470, but it is issue numbering. When I make PR, How can I choose the ERC Number?
Thanks
@StartfundInc Thanks for your question.
To put it simply: currently you can use github issue number which is 5470
.
We are still in discussion of other way of numbering, but that has not converge to a consensus.
A existing consensus is that a new EIP proposer cannot try to snipe a "good" number but what number is considered a good number is up to debate. IMHO, the rule of thumb is that the value of EIP shall depend on its content, not the number, an EIP proposer shall generally be happy witch whatever number the EIP get.
@xinbenlv
Thanks for your reply.
I will work on PR sections, and close this issue.
Thanks again.
eip: 2000 title: Escrow Token Standard author: dev@startfund.io type: Standards Track category: ERC status: Draft created: 2022-08-16
Simple Summary
A standard interface for Escrow Token.
Abstract
The value of a token can be the total sum of the linked currency’s value. For example, in the Token issuing process, the issuer can receive money from buyers( or investors) and transfer issuing token to buyers. . If the offering process is completed, there is no issue. But buyers can change their plan, or the offering is failed(or be canceled) cause of misfitting the compliance rules or other rules. There is no way guarantee to pay back (refund) to the buyer in the on-chain network. We have suggested this process make possible in on-chain network with a payable currency like token(ex: USDT)
Motivation
A standard interface allows the payable token contract to interact with ERC-2000 interface within smart contracts.
Any payable token contract call ERC-2000 interface to exchange with issuing token based on constraint built in ERC-2000 smart contract to validate transactions.
Note: Refund is only available in certain conditions(ex: period, oracle value, etc) based on implementations.
Requirements
Exchanging tokens requires having an escrow like the standard way in the on-chain network.
The following stand interfaces should be provided on ERC-2000 interface.
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
There are 3 contracts for the escrow process:
Buyer Contract
,Seller Contract
andEscrow Contract
.Seller Token
.Buyer Token
.Every ERC-2000 compliant contract must implement the
ERC2000
interfacesRationale
The standard proposes interfaces on top of the ERC-20 standard. Each function should include constraint check logic. In escrow-contract, should implemented internal constraint logic such as period, maximum investors, etc. The buyer-contract and seller-contract should not have constraint rules.
Let's discuss the following functions.
An escrow contract will define success/failure conditions. It means constraint rules might not be changed forever (might be changed after being created for the market exchange rate.), so it guarantees escrow policy.
This function should run differently for buyers and sellers.
[Seller]
This function should be invoked by buyers only. The buyer can call this function in the running state only. In the state of failure or success, could not be a success. The escrow balances of seller and buyer will be updated reverse way of
escrowFund
Buyers and sellers can withdraw tokens from the escrow account to their own account. The following processes are recommended.
escrowRefund
function.Backwards Compatibility
By design ERC-2000 is fully backward compatible with ERC-20.
Test Cases & Implementations
Seller/Buyer Token example
Escrow contract example
Unit test example.
Security Considerations
Since the external contract(Escrow Contract) will control seller or buyer rights, flaws within the escrow contract directly lead to the standard’s unexpected behavior.
Copyright
Copyright and related rights waived via CC0.