-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update pallet-revive dependency - Implement calls according to pallet-revive call semantics - Switch to the new return data API in pallet revive and get rid of return data buffer - Remove a bunch of resulting dead code
- Loading branch information
Showing
24 changed files
with
1,001 additions
and
886 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"Baseline": 878, | ||
"Computation": 4305, | ||
"DivisionArithmetics": 39774, | ||
"ERC20": 53405, | ||
"Events": 1693, | ||
"FibonacciIterative": 2917, | ||
"Flipper": 3570, | ||
"SHA1": 32557 | ||
"Baseline": 912, | ||
"Computation": 4413, | ||
"DivisionArithmetics": 40689, | ||
"ERC20": 54374, | ||
"Events": 1726, | ||
"FibonacciIterative": 3015, | ||
"Flipper": 3612, | ||
"SHA1": 32865 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8; | ||
|
||
/* runner.json | ||
{ | ||
"differential": true, | ||
"actions": [ | ||
{ | ||
"Upload": { | ||
"code": { | ||
"Solidity": { | ||
"contract": "Callee" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"Instantiate": { | ||
"code": { | ||
"Solidity": { | ||
"contract": "ReturnDataOob" | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"Call": { | ||
"dest": { | ||
"Instantiated": 0 | ||
} | ||
} | ||
} | ||
] | ||
} | ||
*/ | ||
|
||
contract Callee { | ||
function echo(bytes memory payload) public pure returns (bytes memory) { | ||
return payload; | ||
} | ||
} | ||
|
||
contract ReturnDataOob { | ||
fallback() external { | ||
new Callee().echo(hex"1234"); | ||
assembly { | ||
let pos := mload(64) | ||
let size := add(returndatasize(), 1) | ||
returndatacopy(pos, 0, size) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8; | ||
|
||
/* runner.json | ||
{ | ||
"differential": true, | ||
"actions": [ | ||
{ | ||
"Instantiate": { | ||
"code": { | ||
"Solidity": { | ||
"contract": "Transfer" | ||
} | ||
}, | ||
"value": 11 | ||
} | ||
}, | ||
{ | ||
"Call": { | ||
"dest": { | ||
"Instantiated": 0 | ||
}, | ||
"data": "1c8d16b30000000000000000000000000303030303030303030303030303030303030303000000000000000000000000000000000000000000000000000000000000000a" | ||
} | ||
}, | ||
{ | ||
"Call": { | ||
"dest": { | ||
"Instantiated": 0 | ||
}, | ||
"data": "fb9e8d0500000000000000000000000003030303030303030303030303030303030303030000000000000000000000000000000000000000000000000000000000000001" | ||
} | ||
} | ||
] | ||
} | ||
*/ | ||
|
||
contract Transfer { | ||
constructor() payable { | ||
transfer_self(msg.value); | ||
} | ||
|
||
function address_self() internal view returns (address payable) { | ||
return payable(address(this)); | ||
} | ||
|
||
function transfer_self(uint _amount) public payable { | ||
transfer_to(address_self(), _amount); | ||
} | ||
|
||
function transfer_to(address payable _dest, uint _amount) public payable { | ||
_dest.transfer(_amount); | ||
} | ||
} |
Oops, something went wrong.