Skip to main content

Module solidity

Module solidity 

Source
Expand description

Code for compiling solidity smart contracts for testing purposes.

Functions§

compile_solidity_contract
Compiles a Solidity contract and returns the bytecode of the named contract.
compile_solidity_contract_with_options
Compiles a Solidity contract with the given optimizer settings, returning the contract’s bytecode.
get_bytecode
Compiles the given Solidity source code and returns the bytecode of the named contract.
get_evm_contract_path
Compiles a Solidity example and writes it to a temporary EVM module file, returning its path.
load_solidity_example
Reads a Solidity file, detects its contract name, and returns the compiled bytecode.
load_solidity_example_by_name
Reads a Solidity file and returns the compiled bytecode of the contract with the given name.
read_evm_address_entry
Reads an Address from the last 20 bytes of a 32-byte EVM word encoded as a JSON byte array.
read_evm_u64_entry
Reads a u64 from the last 8 bytes of a 32-byte EVM word encoded as a JSON byte array.
read_evm_u256_entry
Reads a U256 from a 32-byte EVM word encoded as a JSON byte array.
temporary_write_evm_module
Writes an EVM module to a temporary file, returning its path and the owning temporary directory.
value_to_vec_u8
Converts a JSON array of byte values into a vector of bytes.