mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 18:31:05 +00:00
@@ -1,4 +1,4 @@
|
||||
use alloy_primitives::{I256, U256};
|
||||
use alloy_primitives::{Address, I256, U256};
|
||||
use alloy_sol_types::{sol, SolCall, SolConstructor};
|
||||
|
||||
use crate::mock_runtime::{CallOutput, State};
|
||||
@@ -123,6 +123,12 @@ sol!(
|
||||
}
|
||||
);
|
||||
|
||||
sol!(
|
||||
contract ExtCode {
|
||||
function ExtCodeSize(address who) public view returns (uint ret);
|
||||
}
|
||||
);
|
||||
|
||||
impl Contract {
|
||||
/// Execute the contract.
|
||||
///
|
||||
@@ -405,6 +411,18 @@ impl Contract {
|
||||
calldata: vec![0; 4],
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ext_code_size(address: Address) -> Self {
|
||||
let code = include_str!("../contracts/ExtCode.sol");
|
||||
let name = "ExtCode";
|
||||
|
||||
Self {
|
||||
name,
|
||||
evm_runtime: crate::compile_evm_bin_runtime(name, code),
|
||||
pvm_runtime: crate::compile_blob(name, code),
|
||||
calldata: ExtCode::ExtCodeSizeCall::new((address,)).abi_encode(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user