Alejandro Betancourt pfp
Alejandro Betancourt

@alebeta06

Underused Solidity pattern: `using-for` Verbose: StockLib.decrease(stocks, id, qty); With `using StockLib for mapping(...)`: stocks.decrease(id, qty); Same gas. Cleaner code. Methods on your types. The value before the dot becomes the first arg. Canonical Solidity pattern.
0 reply
1 recast
1 reaction