-
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: Token Changer #228
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preamble
Simple Summary
Standard functions for contracts offering token change services of standard ERC20 tokens.
Abstract
This ERC proposes a set of standard APIs for contracts providing change services between different ERC20 tokens.
The APIs can be used for:
Motivation
Those functions will allow dapps and wallets to utilize token-changing contracts across multiple interface/dapps. Token changing contracts function as automatic money-changers / market-markers, solving the ‘double coincidence of wants’ problem for token exchange.
Specification
Token Change
Methods
changeableTokenCount
Gets the number of changeable tokens supported by the contract.
changeableToken
Given a changeable token index, gets the changeable token contract address.
getReturn
Returns the currently expected return for changing a specific
_amount
of_fromToken
to_toToken
.change
Change
_amount
of_fromToken
to_toToken
.The change will only take place if the returned amount of the
_toToken
is greater or equal to_minReturn
.NOTE: Sufficient allowance needs to be set for the
_fromToken
prior to executing the change function (except when the_fromToken
is managed by the token change contract)Events
Update
Triggered when the list of changeable tokens is modified.
Change
Triggered when a change between two tokens takes place.
Rationale
This is a simple standard which works well for different exchange rate calculation methods and fee structures.
The token changer functions may be integrated with an ERC20 functions, in which case, the contract may be listed as one of the changeable tokens.
Implementation
see https://github.com/bancorprotocol/contracts
Copyright
Copyright and related rights waived via CC0.
The text was updated successfully, but these errors were encountered: