mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-22 21:58:01 +00:00
5b3b90db83
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
55 lines
1.1 KiB
Solidity
55 lines
1.1 KiB
Solidity
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.0;
|
|
|
|
/* runner.json
|
|
{
|
|
"differential": true,
|
|
"actions": [
|
|
{
|
|
"Upload": {
|
|
"code": {
|
|
"Solidity": {
|
|
"contract": "TransactionOrigin"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Instantiate": {
|
|
"code": {
|
|
"Solidity": {
|
|
"contract": "TransactionTester"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"Call": {
|
|
"dest": {
|
|
"Instantiated": 0
|
|
},
|
|
"data": "f8a8fd6d"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
*/
|
|
|
|
contract TransactionTester {
|
|
constructor() payable {
|
|
assert(tx.origin == new TransactionOrigin().test());
|
|
}
|
|
|
|
function test() public payable returns (address ret) {
|
|
ret = tx.origin;
|
|
}
|
|
}
|
|
|
|
contract TransactionOrigin {
|
|
function test() public payable returns (address ret) {
|
|
assert(msg.sender != tx.origin);
|
|
|
|
ret = tx.origin;
|
|
}
|
|
}
|