implement BYTE

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2024-06-04 18:45:06 +02:00
parent 354b1c8d79
commit 2d0a0e2e81
4 changed files with 118 additions and 11 deletions
+18
View File
@@ -154,6 +154,12 @@ sol!(
}
);
sol!(
contract Bitwise {
function opByte(uint i, uint x) public payable returns (uint ret);
}
);
impl Contract {
/// Execute the contract.
///
@@ -508,6 +514,18 @@ impl Contract {
calldata: Value::balance_ofCall::new((address,)).abi_encode(),
}
}
pub fn bitwise_byte(index: U256, value: U256) -> Self {
let code = include_str!("../contracts/Bitwise.sol");
let name = "Bitwise";
Self {
name,
evm_runtime: crate::compile_evm_bin_runtime(name, code),
pvm_runtime: crate::compile_blob(name, code),
calldata: Bitwise::opByteCall::new((index, value)).abi_encode(),
}
}
}
#[cfg(test)]