implement transient storage

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2024-06-05 17:34:17 +02:00
parent 9e9227d740
commit 39d78179d4
9 changed files with 112 additions and 30 deletions
+18
View File
@@ -160,6 +160,12 @@ sol!(
}
);
sol!(
contract Storage {
function transient(uint value) public returns (uint ret);
}
);
impl Contract {
/// Execute the contract.
///
@@ -526,6 +532,18 @@ impl Contract {
calldata: Bitwise::opByteCall::new((index, value)).abi_encode(),
}
}
pub fn storage_transient(value: U256) -> Self {
let code = include_str!("../contracts/Storage.sol");
let name = "Storage";
Self {
name,
evm_runtime: crate::compile_evm_bin_runtime(name, code),
pvm_runtime: crate::compile_blob(name, code),
calldata: Storage::transientCall::new((value,)).abi_encode(),
}
}
}
#[cfg(test)]