Skip to content

Commit 24ef636

Browse files
committed
multiple eth transfers
1 parent 352cc43 commit 24ef636

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.0;
3+
4+
contract AccessList {
5+
uint256 public x;
6+
7+
uint128 public a;
8+
uint128 public b;
9+
10+
mapping(uint256 => uint256) public numbers;
11+
12+
event LogNumber(uint256 x);
13+
14+
function setX(uint256 _x) public {
15+
x = _x;
16+
}
17+
18+
function incrementX() public {
19+
x++;
20+
}
21+
22+
function getAB() public returns (uint256, uint256) {
23+
return (a, b);
24+
}
25+
26+
function setAB(uint256 _a, uint256 _b) public {
27+
a = _a;
28+
b = _b;
29+
}
30+
31+
function writeManyNumbers(
32+
uint256[] memory _keys,
33+
uint256[] memory _values
34+
) public {
35+
require(
36+
_keys.length == _values.length,
37+
"Arrays must be of the same length"
38+
);
39+
for (uint256 i = 0; i < _keys.length; i++) {
40+
numbers[_keys[i]] = _values[i];
41+
}
42+
}
43+
44+
function loadManyNumbers(uint256[] memory _keys) public {
45+
for (uint256 i = 0; i < _keys.length; i++) {
46+
emit LogNumber(numbers[_keys[i]]);
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)