convex
convex copied to clipboard
Ensure fixed size Account records
There is a potential exploit with Memory Accounting if the Account records are not fixed size:
- Execute some setup code such that:
- Memory accounting causes at least one Account size to increase
- Execute some more code to make the Account size decrease (e.g. a transfer)
- Enjoy a memory refund
- Sell the memory for a profit
- Repeat
Might not be practical (the transaction of triggering the refund of 1-2 bytes may not be economically viable), but still a risk to plug. BEst solution is probably just to make balance and allowance 64-bit