mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix wrong cleanup when copying from calldata to memory
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
committed by
Daniel Kirchner
co-authored by
Kamil Śliwak
parent
5b0f4a724a
commit
22c7cd22b9
@@ -14,9 +14,9 @@ contract C {
|
||||
}
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 1243000
|
||||
// executionCost: 1295
|
||||
// totalCost: 1244295
|
||||
// codeDepositCost: 1241200
|
||||
// executionCost: 1288
|
||||
// totalCost: 1242488
|
||||
// external:
|
||||
// a(): 2430
|
||||
// b(uint256): infinite
|
||||
|
||||
@@ -17,9 +17,9 @@ contract C {
|
||||
// optimize-yul: true
|
||||
// ----
|
||||
// creation:
|
||||
// codeDepositCost: 660800
|
||||
// executionCost: 696
|
||||
// totalCost: 661496
|
||||
// codeDepositCost: 659000
|
||||
// executionCost: 689
|
||||
// totalCost: 659689
|
||||
// external:
|
||||
// a(): 2285
|
||||
// b(uint256): 4652
|
||||
|
||||
@@ -59,10 +59,10 @@ contract C {
|
||||
// EVMVersion: >homestead
|
||||
// ----
|
||||
// test_bytes() ->
|
||||
// gas irOptimized: 367365
|
||||
// gas legacy: 416585
|
||||
// gas legacyOptimized: 322043
|
||||
// gas irOptimized: 362445
|
||||
// gas legacy: 414569
|
||||
// gas legacyOptimized: 319271
|
||||
// test_uint256() ->
|
||||
// gas irOptimized: 515982
|
||||
// gas legacy: 583100
|
||||
// gas legacyOptimized: 444161
|
||||
// gas irOptimized: 511910
|
||||
// gas legacy: 581876
|
||||
// gas legacyOptimized: 442757
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
pragma abicoder v1;
|
||||
|
||||
contract C {
|
||||
function f(bool a, bytes calldata b, bytes32[2] calldata c)
|
||||
public
|
||||
returns (bool, bytes calldata, bytes32[2] calldata)
|
||||
{
|
||||
return (a, b, c);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: false
|
||||
// ----
|
||||
// f(bool,bytes,bytes32[2]): true, 0x80, "a", "b", 4, "abcd" -> true, 0x80, "a", "b", 4, "abcd"
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
pragma abicoder v1;
|
||||
|
||||
contract C {
|
||||
function f(uint256[] memory a, bytes calldata b) public returns (bytes memory) {
|
||||
return abi.encode(a, b);
|
||||
}
|
||||
|
||||
function g(uint256[] memory a, bytes calldata b) external returns (bytes memory) {
|
||||
return f(a, b);
|
||||
}
|
||||
}
|
||||
|
||||
// ====
|
||||
// EVMVersion: >homestead
|
||||
// ----
|
||||
// f(uint256[],bytes): 0x40, 0x80, 1, 0xFF, 6, "123456" -> 0x20, 0xc0, 0x40, 0x80, 1, 0xff, 6, "123456"
|
||||
// g(uint256[],bytes): 0x40, 0x80, 1, 0xffff, 8, "12345678" -> 0x20, 0xc0, 0x40, 0x80, 1, 0xffff, 8, "12345678"
|
||||
@@ -60,10 +60,10 @@ contract C {
|
||||
// EVMVersion: >homestead
|
||||
// ----
|
||||
// test_bytes() ->
|
||||
// gas irOptimized: 367365
|
||||
// gas legacy: 416585
|
||||
// gas legacyOptimized: 322043
|
||||
// gas irOptimized: 362445
|
||||
// gas legacy: 414569
|
||||
// gas legacyOptimized: 319271
|
||||
// test_uint256() ->
|
||||
// gas irOptimized: 515982
|
||||
// gas legacy: 583100
|
||||
// gas legacyOptimized: 444161
|
||||
// gas irOptimized: 511910
|
||||
// gas legacy: 581876
|
||||
// gas legacyOptimized: 442757
|
||||
|
||||
@@ -51,6 +51,6 @@ contract C {
|
||||
// f2() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
|
||||
// f3() -> 0x20, 0xa0, 0x1, 0x60, 0x2, 0x3, "abc"
|
||||
// f4() -> 0x20, 0x160, 0x1, 0x80, 0xc0, 0x2, 0x3, "abc", 0x7, 0x40, 0x2, 0x2, 0x3
|
||||
// gas irOptimized: 112820
|
||||
// gas legacy: 114900
|
||||
// gas legacyOptimized: 112606
|
||||
// gas irOptimized: 112646
|
||||
// gas legacy: 114866
|
||||
// gas legacyOptimized: 112586
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
pragma abicoder v2;
|
||||
|
||||
struct T {
|
||||
bytes x;
|
||||
uint[3] y;
|
||||
}
|
||||
|
||||
contract E {
|
||||
function f(bool a, T calldata b, bytes32[2] calldata c)
|
||||
public
|
||||
returns (bool, T calldata, bytes32[2] calldata)
|
||||
{
|
||||
return (a, b, c);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(bool,(bytes,uint256[3]),bytes32[2]): 1, 0x80, "a", "b", 0x80, 11, 12, 13, 4, "abcd" -> 1, 0x80, "a", "b", 0x80, 11, 12, 13, 4, "abcd"
|
||||
@@ -20,6 +20,6 @@ contract C {
|
||||
// f(uint256[][1]): 32, 32, 0 -> true
|
||||
// f(uint256[][1]): 32, 32, 1, 42 -> true
|
||||
// f(uint256[][1]): 32, 32, 8, 421, 422, 423, 424, 425, 426, 427, 428 -> true
|
||||
// gas irOptimized: 128098
|
||||
// gas legacy: 140672
|
||||
// gas legacyOptimized: 119588
|
||||
// gas irOptimized: 127347
|
||||
// gas legacy: 140553
|
||||
// gas legacyOptimized: 119450
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
library L {
|
||||
// This case used to be affected by the buggy cleanup due to ABIEncoderV2HeadOverflowWithStaticArrayCleanup bug.
|
||||
function g(uint[] memory a, uint[1] calldata b) public returns (uint[] memory, uint[1] calldata) {
|
||||
return (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
contract C {
|
||||
function f(uint[] memory a, uint[1] calldata b) public returns (uint[] memory, uint[1] memory) {
|
||||
return L.g(a, b);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >homestead
|
||||
// ----
|
||||
// library: L
|
||||
// f(uint256[],uint256[1]): 0x40, 0xff, 1, 0xffff -> 0x40, 0xff, 0x01, 0xffff
|
||||
@@ -0,0 +1,27 @@
|
||||
contract C {
|
||||
function f(string calldata x) external returns (bytes memory r) {
|
||||
uint mptr;
|
||||
assembly {
|
||||
// dirty memory
|
||||
mptr := mload(0x40)
|
||||
for { let i := mptr } lt(i, add(mptr, 0x0100)) { i := add(i, 32) }
|
||||
{
|
||||
mstore(i, sub(0, 1))
|
||||
}
|
||||
}
|
||||
r = abi.encode(x);
|
||||
assembly {
|
||||
// assert that we dirtied the memory that was encoded to
|
||||
if iszero(eq(mptr, r)) {
|
||||
revert(0, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
function test() external returns (bytes memory) {
|
||||
return this.f("abc");
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >homestead
|
||||
// ----
|
||||
// test() -> 0x20, 0x60, 0x20, 3, "abc"
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
contract C {
|
||||
function f(uint256[] memory a, bytes calldata b) public returns (bytes memory) {
|
||||
return abi.encode(a, b);
|
||||
}
|
||||
|
||||
function g(uint256[] memory a, bytes calldata b) external returns (bytes memory) {
|
||||
return f(a, b);
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// f(uint256[],bytes): 0x40, 0x80, 1, 0xFF, 6, "123456" -> 0x20, 0xc0, 0x40, 0x80, 1, 0xff, 6, "123456"
|
||||
// g(uint256[],bytes): 0x40, 0x80, 1, 0xffff, 8, "12345678" -> 0x20, 0xc0, 0x40, 0x80, 1, 0xffff, 8, "12345678"
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
contract C {
|
||||
function f(uint256[] memory a, uint256[1] calldata b) public returns (bytes memory) {
|
||||
return abi.encode(a, b);
|
||||
}
|
||||
|
||||
function g(uint256[] memory a, uint256[1] calldata b) external returns (bytes memory) {
|
||||
return f(a, b);
|
||||
}
|
||||
|
||||
function h(uint256[] memory a, uint256[1] calldata b) external returns (uint256[] memory, uint256[1] calldata) {
|
||||
return (a, b);
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// f(uint256[],uint256[1]): 0x40, 0xff, 1, 0xffff -> 0x20, 0x80, 0x40, 0xff, 1, 0xffff
|
||||
// g(uint256[],uint256[1]): 0x40, 0xff, 1, 0xffff -> 0x20, 0x80, 0x40, 0xff, 1, 0xffff
|
||||
// h(uint256[],uint256[1]): 0x40, 0xff, 1, 0xffff -> 0x40, 0xff, 1, 0xffff
|
||||
@@ -18,10 +18,10 @@ contract C {
|
||||
// EVMVersion: >homestead
|
||||
// ----
|
||||
// h(uint256[2][]): 0x20, 3, 123, 124, 223, 224, 323, 324 -> 32, 256, 0x20, 3, 123, 124, 223, 224, 323, 324
|
||||
// gas irOptimized: 180768
|
||||
// gas legacy: 184929
|
||||
// gas legacyOptimized: 181504
|
||||
// gas irOptimized: 180726
|
||||
// gas legacy: 184921
|
||||
// gas legacyOptimized: 181506
|
||||
// i(uint256[2][2]): 123, 124, 223, 224 -> 32, 128, 123, 124, 223, 224
|
||||
// gas irOptimized: 112471
|
||||
// gas legacy: 115468
|
||||
// gas legacyOptimized: 112988
|
||||
// gas irOptimized: 112453
|
||||
// gas legacy: 115460
|
||||
// gas legacyOptimized: 112990
|
||||
|
||||
@@ -9,6 +9,6 @@ contract C {
|
||||
|
||||
// ----
|
||||
// f(bytes): 0x20, 0x80, 0x21, 0x40, 0x7, "abcdefg" -> 0x21, 0x40, 0x7, "abcdefg"
|
||||
// gas irOptimized: 135787
|
||||
// gas legacy: 137377
|
||||
// gas legacyOptimized: 136125
|
||||
// gas irOptimized: 135699
|
||||
// gas legacy: 137325
|
||||
// gas legacyOptimized: 136059
|
||||
|
||||
@@ -17,25 +17,25 @@ contract c {
|
||||
// ----
|
||||
// f(uint256): 0 -> 0x20, 0x00
|
||||
// f(uint256): 31 -> 0x20, 0x1f, 0x0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00
|
||||
// gas irOptimized: 108395
|
||||
// gas legacy: 124322
|
||||
// gas legacyOptimized: 119141
|
||||
// gas irOptimized: 109413
|
||||
// gas legacy: 124296
|
||||
// gas legacyOptimized: 119119
|
||||
// f(uint256): 32 -> 0x20, 0x20, 1780731860627700044960722568376592200742329637303199754547598369979440671
|
||||
// gas irOptimized: 117480
|
||||
// gas legacy: 135259
|
||||
// gas legacyOptimized: 130089
|
||||
// gas irOptimized: 118565
|
||||
// gas legacy: 135251
|
||||
// gas legacyOptimized: 130091
|
||||
// f(uint256): 33 -> 0x20, 33, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x2000000000000000000000000000000000000000000000000000000000000000
|
||||
// gas irOptimized: 124117
|
||||
// gas legacy: 142861
|
||||
// gas legacyOptimized: 137030
|
||||
// gas irOptimized: 125184
|
||||
// gas legacy: 142835
|
||||
// gas legacyOptimized: 137008
|
||||
// f(uint256): 63 -> 0x20, 0x3f, 1780731860627700044960722568376592200742329637303199754547598369979440671, 14532552714582660066924456880521368950258152170031413196862950297402215316992
|
||||
// gas irOptimized: 126467
|
||||
// gas legacy: 160901
|
||||
// gas legacyOptimized: 150960
|
||||
// gas irOptimized: 128584
|
||||
// gas legacy: 160875
|
||||
// gas legacyOptimized: 150938
|
||||
// f(uint256): 12 -> 0x20, 0x0c, 0x0102030405060708090a0b0000000000000000000000000000000000000000
|
||||
// gas legacy: 59345
|
||||
// gas legacyOptimized: 57279
|
||||
// f(uint256): 129 -> 0x20, 0x81, 1780731860627700044960722568376592200742329637303199754547598369979440671, 0x202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f, 29063324697304692433803953038474361308315562010425523193971352996434451193439, 0x606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f, -57896044618658097711785492504343953926634992332820282019728792003956564819968
|
||||
// gas irOptimized: 353326
|
||||
// gas legacy: 421700
|
||||
// gas legacyOptimized: 402999
|
||||
// gas irOptimized: 357699
|
||||
// gas legacy: 421674
|
||||
// gas legacyOptimized: 402977
|
||||
|
||||
+6
-6
@@ -35,12 +35,12 @@ contract C {
|
||||
}
|
||||
// ----
|
||||
// f() -> 0x40, 0x80, 6, 0x6162636465660000000000000000000000000000000000000000000000000000, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000
|
||||
// gas irOptimized: 179880
|
||||
// gas legacy: 181099
|
||||
// gas legacyOptimized: 180073
|
||||
// gas irOptimized: 179766
|
||||
// gas legacy: 181047
|
||||
// gas legacyOptimized: 180029
|
||||
// g() -> 0x40, 0xc0, 0x49, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738393031323334353637383930313233343536373839303120, 0x3132333435363738390000000000000000000000000000000000000000000000, 0x11, 0x3132333435363738393233343536373839000000000000000000000000000000
|
||||
// gas irOptimized: 107211
|
||||
// gas legacy: 110253
|
||||
// gas legacyOptimized: 107397
|
||||
// gas irOptimized: 107097
|
||||
// gas legacy: 110201
|
||||
// gas legacyOptimized: 107353
|
||||
// h() -> 0x40, 0x60, 0x00, 0x00
|
||||
// storageEmpty -> 1
|
||||
|
||||
@@ -46,11 +46,11 @@ contract C {
|
||||
}
|
||||
// ----
|
||||
// test() -> 0x20, 0x14, "[a called][b called]"
|
||||
// gas irOptimized: 116724
|
||||
// gas legacy: 119056
|
||||
// gas legacyOptimized: 117043
|
||||
// gas irOptimized: 116688
|
||||
// gas legacy: 119030
|
||||
// gas legacyOptimized: 117021
|
||||
// test2() -> 0x20, 0x14, "[b called][a called]"
|
||||
// test3() -> 0x20, 0x14, "[b called][a called]"
|
||||
// gas irOptimized: 103304
|
||||
// gas legacy: 102840
|
||||
// gas legacyOptimized: 101728
|
||||
// gas irOptimized: 103268
|
||||
// gas legacy: 102814
|
||||
// gas legacyOptimized: 101706
|
||||
|
||||
@@ -11,6 +11,6 @@ contract C {
|
||||
}
|
||||
// ----
|
||||
// f() -> 0x20, 0x02, 0x40, 0x80, 3, 0x6162630000000000000000000000000000000000000000000000000000000000, 0x99, 44048183304486788312148433451363384677562265908331949128489393215789685032262, 32241931068525137014058842823026578386641954854143559838526554899205067598957, 49951309422467613961193228765530489307475214998374779756599339590522149884499, 0x54555658595a6162636465666768696a6b6c6d6e6f707172737475767778797a, 0x4142434445464748494a4b4c4d4e4f5051525354555658595a00000000000000
|
||||
// gas irOptimized: 202952
|
||||
// gas legacy: 204912
|
||||
// gas legacyOptimized: 203437
|
||||
// gas irOptimized: 202808
|
||||
// gas legacy: 204860
|
||||
// gas legacyOptimized: 203385
|
||||
|
||||
@@ -10,6 +10,6 @@ contract c {
|
||||
|
||||
// ----
|
||||
// test() -> 0x20, 29, 0x0303030303030303030303030303030303030303030303030303030303000000
|
||||
// gas irOptimized: 109341
|
||||
// gas legacy: 126728
|
||||
// gas legacyOptimized: 123444
|
||||
// gas irOptimized: 109310
|
||||
// gas legacy: 126702
|
||||
// gas legacyOptimized: 123422
|
||||
|
||||
@@ -10,6 +10,6 @@ contract c {
|
||||
|
||||
// ----
|
||||
// test() -> 0x20, 33, 0x303030303030303030303030303030303030303030303030303030303030303, 0x0300000000000000000000000000000000000000000000000000000000000000
|
||||
// gas irOptimized: 108146
|
||||
// gas legacy: 125610
|
||||
// gas legacyOptimized: 122582
|
||||
// gas irOptimized: 108115
|
||||
// gas legacy: 125584
|
||||
// gas legacyOptimized: 122560
|
||||
|
||||
@@ -28,9 +28,9 @@ contract C {
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
// gas irOptimized: 521983
|
||||
// gas legacy: 731840
|
||||
// gas legacyOptimized: 494859
|
||||
// gas irOptimized: 518935
|
||||
// gas legacy: 729908
|
||||
// gas legacyOptimized: 493347
|
||||
// h() -> 0x20, 0x40, 0x00, 0
|
||||
// ~ emit ev(uint256[],uint256): 0x40, 0x21, 0x02, 0x00, 0x00
|
||||
// g() -> 0x20, 0x40, 0, 0x00
|
||||
|
||||
@@ -24,6 +24,6 @@ contract Creator {
|
||||
}
|
||||
// ----
|
||||
// f(uint256,bytes): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" -> 7, "h"
|
||||
// gas irOptimized: 282398
|
||||
// gas legacy: 429047
|
||||
// gas legacyOptimized: 297958
|
||||
// gas irOptimized: 279069
|
||||
// gas legacy: 427192
|
||||
// gas legacyOptimized: 296504
|
||||
|
||||
@@ -8,8 +8,8 @@ contract Test {
|
||||
}
|
||||
// ----
|
||||
// constructor(): 7, 0x40, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz" ->
|
||||
// gas irOptimized: 273340
|
||||
// gas legacy: 317746
|
||||
// gas legacyOptimized: 262368
|
||||
// gas irOptimized: 270118
|
||||
// gas legacy: 315616
|
||||
// gas legacyOptimized: 260686
|
||||
// m_x() -> 7
|
||||
// m_s() -> 0x20, 78, "abcdefghijklmnopqrstuvwxyzabcdef", "ghijklmnopqrstuvwxyzabcdefghijkl", "mnopqrstuvwxyz"
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
contract C {
|
||||
error E(uint[], uint[1]);
|
||||
|
||||
// This case used to be affected by the buggy cleanup due to ABIEncoderV2HeadOverflowWithStaticArrayCleanup bug.
|
||||
function f(uint[] memory a, uint[1] calldata b) public {
|
||||
revert E(a, b);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256[],uint256[1]): 0x40, 0xff, 1, 0xffff -> FAILURE, hex"f42f106d", 0x40, 0xff, 1, 0xffff
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
event E(uint[], uint[1]);
|
||||
|
||||
// This case used to be affected by the buggy cleanup due to ABIEncoderV2HeadOverflowWithStaticArrayCleanup bug.
|
||||
function f(uint[] memory a, uint[1] calldata b) public {
|
||||
emit E(a, b);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// f(uint256[],uint256[1]): 0x40, 0xff, 1, 0xffff ->
|
||||
// ~ emit E(uint256[],uint256[1]): 0x40, 0xff, 0x01, 0xffff
|
||||
@@ -74,9 +74,9 @@ contract FixedFeeRegistrar is Registrar {
|
||||
}
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 414897
|
||||
// gas legacy: 935817
|
||||
// gas legacyOptimized: 489951
|
||||
// gas irOptimized: 411435
|
||||
// gas legacy: 933867
|
||||
// gas legacyOptimized: 487352
|
||||
// reserve(string), 69 ether: 0x20, 3, "abc" ->
|
||||
// ~ emit Changed(string): #0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45
|
||||
// gas irOptimized: 45967
|
||||
|
||||
@@ -33,9 +33,9 @@ contract test {
|
||||
// EVMVersion: >=constantinople
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 444190
|
||||
// gas legacy: 757857
|
||||
// gas legacyOptimized: 539866
|
||||
// gas irOptimized: 441142
|
||||
// gas legacy: 755907
|
||||
// gas legacyOptimized: 538354
|
||||
// encode_inline_asm(bytes): 0x20, 0 -> 0x20, 0
|
||||
// encode_inline_asm(bytes): 0x20, 1, "f" -> 0x20, 4, "Zg=="
|
||||
// encode_inline_asm(bytes): 0x20, 2, "fo" -> 0x20, 4, "Zm8="
|
||||
|
||||
@@ -176,35 +176,35 @@ contract DepositContract is IDepositContract, ERC165 {
|
||||
}
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 1432633
|
||||
// gas legacy: 2427722
|
||||
// gas legacyOptimized: 1773892
|
||||
// gas irOptimized: 1428137
|
||||
// gas legacy: 2425301
|
||||
// gas legacyOptimized: 1770477
|
||||
// supportsInterface(bytes4): 0x0 -> 0
|
||||
// supportsInterface(bytes4): 0xffffffff00000000000000000000000000000000000000000000000000000000 -> false # defined to be false by ERC-165 #
|
||||
// supportsInterface(bytes4): 0x01ffc9a700000000000000000000000000000000000000000000000000000000 -> true # ERC-165 id #
|
||||
// supportsInterface(bytes4): 0x8564090700000000000000000000000000000000000000000000000000000000 -> true # the deposit interface id #
|
||||
// get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e
|
||||
// gas irOptimized: 116284
|
||||
// gas legacy: 150273
|
||||
// gas legacyOptimized: 122510
|
||||
// gas irOptimized: 114626
|
||||
// gas legacy: 149888
|
||||
// gas legacyOptimized: 121887
|
||||
// get_deposit_count() -> 0x20, 8, 0 # TODO: check balance and logs after each deposit #
|
||||
// deposit(bytes,bytes,bytes,bytes32), 32 ether: 0 -> FAILURE # Empty input #
|
||||
// get_deposit_root() -> 0xd70a234731285c6804c2a4f56711ddb8c82c99740f207854891028af34e27e5e
|
||||
// gas irOptimized: 116284
|
||||
// gas legacy: 150273
|
||||
// gas legacyOptimized: 122510
|
||||
// gas irOptimized: 114626
|
||||
// gas legacy: 149888
|
||||
// gas legacyOptimized: 121887
|
||||
// get_deposit_count() -> 0x20, 8, 0
|
||||
// deposit(bytes,bytes,bytes,bytes32), 1 ether: 0x80, 0xe0, 0x120, 0xaa4a8d0b7d9077248630f1a4701ae9764e42271d7f22b7838778411857fd349e, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0x00f50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8 -> # txhash: 0x7085c586686d666e8bb6e9477a0f0b09565b2060a11f1c4209d3a52295033832 #
|
||||
// ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0x933ad9491b62059dd065b560d256d8957a8c402cc6e8d8ee7290ae11e8f73292, 0x67a8811c397529dac52ae1342ba58c9500000000000000000000000000000000, 0x20, 0xf50428677c60f997aadeab24aabf7fceaef491c96a52b463ae91f95611cf71, 0x08, 0xca9a3b00000000000000000000000000000000000000000000000000000000, 0x60, 0xa29d01cc8c6296a8150e515b5995390ef841dc18948aa3e79be6d7c1851b4cbb, 0x5d6ff49fa70b9c782399506a22a85193151b9b691245cebafd2063012443c132, 0x4b6c36debaedefb7b2d71b0503ffdc00150aaffd42e63358238ec888901738b8, 0x08, 0x00
|
||||
// get_deposit_root() -> 0x2089653123d9c721215120b6db6738ba273bbc5228ac093b1f983badcdc8a438
|
||||
// gas irOptimized: 116269
|
||||
// gas legacy: 150283
|
||||
// gas legacyOptimized: 122523
|
||||
// gas irOptimized: 114611
|
||||
// gas legacy: 149898
|
||||
// gas legacyOptimized: 121900
|
||||
// get_deposit_count() -> 0x20, 8, 0x0100000000000000000000000000000000000000000000000000000000000000
|
||||
// deposit(bytes,bytes,bytes,bytes32), 32 ether: 0x80, 0xe0, 0x120, 0xdbd986dc85ceb382708cf90a3500f500f0a393c5ece76963ac3ed72eccd2c301, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x00344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d -> # txhash: 0x404d8e109822ce448e68f45216c12cb051b784d068fbe98317ab8e50c58304ac #
|
||||
// ~ emit DepositEvent(bytes,bytes,bytes,bytes,bytes): 0xa0, 0x0100, 0x0140, 0x0180, 0x0200, 0x30, 0xb2ce0f79f90e7b3a113ca5783c65756f96c4b4673c2b5c1eb4efc22280259441, 0x06d601211e8866dc5b50dc48a244dd7c00000000000000000000000000000000, 0x20, 0x344b6c73f71b11c56aba0d01b7d8ad83559f209d0a4101a515f6ad54c89771, 0x08, 0x40597307000000000000000000000000000000000000000000000000000000, 0x60, 0x945caaf82d18e78c033927d51f452ebcd76524497b91d7a11219cb3db6a1d369, 0x7595fc095ce489e46b2ef129591f2f6d079be4faaf345a02c5eb133c072e7c56, 0x0c6c3617eee66b4b878165c502357d49485326bc6b31bc96873f308c8f19c09d, 0x08, 0x0100000000000000000000000000000000000000000000000000000000000000
|
||||
// get_deposit_root() -> 0x40255975859377d912c53aa853245ebd939bdd2b33a28e084babdcc1ed8238ee
|
||||
// gas irOptimized: 116269
|
||||
// gas legacy: 150283
|
||||
// gas legacyOptimized: 122523
|
||||
// gas irOptimized: 114611
|
||||
// gas legacy: 149898
|
||||
// gas legacyOptimized: 121900
|
||||
// get_deposit_count() -> 0x20, 8, 0x0200000000000000000000000000000000000000000000000000000000000000
|
||||
|
||||
@@ -49,9 +49,9 @@ contract test {
|
||||
}
|
||||
// ----
|
||||
// constructor()
|
||||
// gas irOptimized: 678980
|
||||
// gas legacy: 1103242
|
||||
// gas legacyOptimized: 745184
|
||||
// gas irOptimized: 675980
|
||||
// gas legacy: 1101298
|
||||
// gas legacyOptimized: 743666
|
||||
// toSlice(string): 0x20, 11, "hello world" -> 11, 0xa0
|
||||
// gas irOptimized: 22660
|
||||
// gas legacy: 23190
|
||||
|
||||
@@ -23,9 +23,9 @@ contract C {
|
||||
|
||||
// ----
|
||||
// constructor(), 1 ether ->
|
||||
// gas irOptimized: 270449
|
||||
// gas legacy: 456680
|
||||
// gas legacyOptimized: 302975
|
||||
// gas irOptimized: 266135
|
||||
// gas legacy: 454729
|
||||
// gas legacyOptimized: 301679
|
||||
// f(uint256): 0 -> FAILURE
|
||||
// f(uint256): 1 -> FAILURE
|
||||
// f(uint256): 2 -> FAILURE
|
||||
|
||||
+3
-3
@@ -26,9 +26,9 @@ contract C {
|
||||
// revertStrings: debug
|
||||
// ----
|
||||
// constructor(), 1 ether ->
|
||||
// gas irOptimized: 428444
|
||||
// gas legacy: 825625
|
||||
// gas legacyOptimized: 508492
|
||||
// gas irOptimized: 424088
|
||||
// gas legacy: 823681
|
||||
// gas legacyOptimized: 505900
|
||||
// f(uint256): 0 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code"
|
||||
// f(uint256): 1 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code"
|
||||
// f(uint256): 2 -> FAILURE, hex"08c379a0", 0x20, 37, "Target contract does not contain", " code"
|
||||
|
||||
@@ -16,9 +16,9 @@ contract C {
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// constructor() ->
|
||||
// gas irOptimized: 177507
|
||||
// gas legacy: 249207
|
||||
// gas legacyOptimized: 157489
|
||||
// gas irOptimized: 175791
|
||||
// gas legacy: 247263
|
||||
// gas legacyOptimized: 155977
|
||||
// initCode() -> 0x20, 0
|
||||
// f() -> true
|
||||
// g() -> 0
|
||||
|
||||
@@ -20,6 +20,6 @@ contract C {
|
||||
|
||||
// ----
|
||||
// g() -> 2, 6
|
||||
// gas irOptimized: 178637
|
||||
// gas legacy: 180945
|
||||
// gas legacyOptimized: 179460
|
||||
// gas irOptimized: 178549
|
||||
// gas legacy: 180893
|
||||
// gas legacyOptimized: 179394
|
||||
|
||||
@@ -9,4 +9,4 @@ contract test {
|
||||
// ====
|
||||
// EVMVersion: >byzantium
|
||||
// ----
|
||||
// Warning 5574: (21-27154): Contract code size is 27199 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
|
||||
// Warning 5574: (21-27154): Contract code size is 27192 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
|
||||
|
||||
@@ -7,4 +7,4 @@ contract test {
|
||||
// ====
|
||||
// EVMVersion: =byzantium
|
||||
// ----
|
||||
// Warning 5574: (0-27133): Contract code size is 27227 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
|
||||
// Warning 5574: (0-27133): Contract code size is 27220 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
|
||||
|
||||
Reference in New Issue
Block a user