mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 09:31:05 +00:00
implement self balance
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -7,6 +7,7 @@ pragma solidity ^0.8;
|
||||
"actions": [
|
||||
{
|
||||
"Instantiate": {
|
||||
"value": 1024,
|
||||
"code": {
|
||||
"Solidity": {
|
||||
"contract": "Value"
|
||||
@@ -22,16 +23,30 @@ pragma solidity ^0.8;
|
||||
"value": 123,
|
||||
"data": "3fa4f245"
|
||||
}
|
||||
},
|
||||
{
|
||||
"Call": {
|
||||
"dest": {
|
||||
"Instantiated": 0
|
||||
},
|
||||
"data": "52da5fa0"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
*/
|
||||
|
||||
contract Value {
|
||||
constructor() payable {}
|
||||
|
||||
function value() public payable returns (uint ret) {
|
||||
ret = msg.value;
|
||||
}
|
||||
|
||||
function balance_self() public view returns (uint ret) {
|
||||
ret = address(this).balance;
|
||||
}
|
||||
|
||||
function balance_of(address _address) public view returns (uint ret) {
|
||||
ret = _address.balance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user