Add swap description section

This commit is contained in:
lash 2023-08-03 17:23:36 +01:00
parent 3186f0b58e
commit 9560d0c5df
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -46,7 +46,16 @@ The [erc20-limiter](https://holbrook.no/src/erc20-limiter/log.html) repository c
This enables to publisher to use the same smart contract for both constructor arguments `tokenRegistry` and `tokenLimiter`. This enables to publisher to use the same smart contract for both constructor arguments `tokenRegistry` and `tokenLimiter`.
## Handling values ## Swapping tokens
The method used to execute token swaps is `withdraw(outToken, inToken, value)`.
The `value` argument refers to the value of `inToken` that will be transferred to the pool contract, in exchange for some value of `outToken` (see below).
In order to successfully execute the swap, an ERC20 "approval" must exist for the pool contract to spend at least the value of `inToken` specified by the `value` argument.
### Handling values
The pool contract does no checking whatsoever regarding the sanity of allowing tokens in the pool. The pool contract does no checking whatsoever regarding the sanity of allowing tokens in the pool.