mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-05-01 00:37:56 +00:00
be6f734cfc
- Emit the `call_evm` and `delegate_call_evm` syscalls for contract calls. - The call gas is no longer ignored. --------- Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
51 lines
1.0 KiB
Solidity
51 lines
1.0 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8;
|
|
|
|
// Use a non-zero call gas that works with call gas clipping but not with a truncate.
|
|
|
|
/* runner.json
|
|
{
|
|
"differential": true,
|
|
"actions": [
|
|
{
|
|
"Upload": {
|
|
"code": {
|
|
"Solidity": {
|
|
"contract": "Other"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Instantiate": {
|
|
"code": {
|
|
"Solidity": {
|
|
"contract": "CallGas"
|
|
}
|
|
},
|
|
"data": "1000000000000000000000000000000000000000000000000000000000000001"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
*/
|
|
|
|
contract Other {
|
|
address public last;
|
|
uint public foo;
|
|
|
|
fallback() external {
|
|
last = msg.sender;
|
|
foo += 1;
|
|
}
|
|
}
|
|
|
|
contract CallGas {
|
|
constructor(uint _gas) payable {
|
|
Other other = new Other();
|
|
address(other).call{ gas: _gas }(hex"");
|
|
assert(other.last() == address(this));
|
|
}
|
|
}
|