mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 21:58:01 +00:00
6585973e99
- 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
54 lines
1.0 KiB
Solidity
54 lines
1.0 KiB
Solidity
// 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)
|
|
}
|
|
}
|
|
}
|