erc20-pool

Permissioned ERC20 swap pool for EVM
Log | Files | Refs | README

commit 9560d0c5dfca7dd36292ab0357bb018d689199fe
parent 3186f0b58ee27b0217180ec1952175883839e010
Author: lash <dev@holbrook.no>
Date:   Thu,  3 Aug 2023 17:23:36 +0100

Add swap description section

Diffstat:
MREADME.md | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -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`. -## 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.