implement self balance

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2024-09-09 09:40:24 +02:00
parent d77ee1e0d4
commit 2955f77772
10 changed files with 396 additions and 358 deletions
+15
View File
@@ -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;
}