mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-21 16:11:03 +00:00
Implement balance (#20)
This commit is contained in:
@@ -148,6 +148,12 @@ sol!(
|
||||
}
|
||||
);
|
||||
|
||||
sol!(
|
||||
contract Value {
|
||||
function balance_of(address _address) public view returns (uint ret);
|
||||
}
|
||||
);
|
||||
|
||||
impl Contract {
|
||||
/// Execute the contract.
|
||||
///
|
||||
@@ -490,6 +496,18 @@ impl Contract {
|
||||
calldata: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn value_balance_of(address: Address) -> Self {
|
||||
let code = include_str!("../contracts/Value.sol");
|
||||
let name = "Value";
|
||||
|
||||
Self {
|
||||
name,
|
||||
evm_runtime: crate::compile_evm_bin_runtime(name, code),
|
||||
pvm_runtime: crate::compile_blob(name, code),
|
||||
calldata: Value::balance_ofCall::new((address,)).abi_encode(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user