Uses a precomputed hash of slot 0 as a constant rather than mstoring and hashing each function
Uses memory locations from 0x00 and above as solidity is not used any longer (so we can use offset 0x40) and we do not use solidity's uninitialized dynamic value types (so we can use 0x60). so less memory expansion and no need to update and read from free memory pointer offset
Uses assembly to get token balance
Uses assembly to log event when receiving eth
fix/add some comments
See benchmarks
saves 12,661 gas on deployment
saves 42 gas on receive() function static call
saves 9 gas on recipients() function static call
saves avg: 546, median: 104, max: 102 gas on release() function call
saves avg: 717, median: 274, max: 271 gas on release(address) function call
This PR optimizes gas further
See benchmarks
receive()
function static callrecipients()
function static callavg: 546, median: 104, max: 102 gas
onrelease()
function callavg: 717, median: 274, max: 271 gas
onrelease(address)
function callshares(uint256)
static call