library_using_for.sol 283 B

12345678910111213141516171819
  1. contract test {
  2. using lib for int32[100];
  3. int32[100] bar;
  4. function foo() public {
  5. bar.set(10, 571);
  6. }
  7. }
  8. library lib {
  9. function set(
  10. int32[100] storage a,
  11. uint256 index,
  12. int32 val
  13. ) internal {
  14. a[index] = val;
  15. }
  16. }