└── README.md /README.md: -------------------------------------------------------------------------------- 1 | 2 | `allow(uint256 amount)` - allocate `amount` tokens from the caller to the transaction 3 | `spend(uint256 amount)` - move `amount` tokens from the transaction to the caller 4 | 5 | This document describes a token pattern which is currently not possible to implement in full, but has a lot of interesting and useful properties. 6 | The most straightforward way to implement it would be using a `TXID` opcode. 7 | 8 | The basic idea is that instead of pushing and pulling tokens to each other, contracts transiently push and pull tokens *into the transaction*. 9 | You can think of these as flash loan without an external contract calls. 10 | 11 | The trick is to keep track of the implied refund on a per-allower basis. Next time the balance is accessed, process the refund first. --------------------------------------------------------------------------------