AlacrisIO / meta

Internal management of Legicash/Legilogic/Alacris
0 stars 0 forks source link

Create a pre-funding contract #115

Open fare opened 5 years ago

fare commented 5 years ago

Current pre-funding of test accounts requires one transaction per funded account, which wastes minutes at test startup. Instead, create then use a pre-funding contract,/ which will keep all the initialization in two short transactions only — actually 1+ceiling(N/A) transactions, where N is the number of accounts to pre-fund, and A is a constant of the order of 300 accounts per transaction, to fit in a block.

The Solidity (or direct EVM? Alacrity?) contract would get a list of addresses + amount (the address fit in 160 bits, the amount in 96 bits, which together perfectly fit 256-bit!) by iterating its raw arguments one at a time, splitting address and amount and creating a subtransaction each time.

fare commented 5 years ago

All handled in https://github.com/AlacrisIO/legicash-facts/pull/29 including direct EVM contract in 89 bytes with non-standard ABI, and the OCaml code to invoke it. Makes the initial pre-funding step very fast.