mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-12 10:31:04 +00:00
integration: add function pointer integration test (#205)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
pragma solidity ^0.8;
|
||||
|
||||
/* runner.json
|
||||
{
|
||||
"differential": true,
|
||||
"actions": [
|
||||
{
|
||||
"Instantiate": {
|
||||
"code": {
|
||||
"Solidity": {
|
||||
"contract": "FunctionPointer"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
},
|
||||
"data": "26121ff0"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
contract FunctionPointer {
|
||||
bool public flag = false;
|
||||
|
||||
function f0() public {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
function f() public returns (bool) {
|
||||
function() internal x = f0;
|
||||
x();
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user