yevm-core 0.1.0

Async, WASM-native Ethereum VM engine: opcode dispatch, gas accounting, precompiles, state traits, structured trace events.
Documentation
1
2
3
4
5
6
7
8
9
10
/// Identity (precompile 0x04)
/// Returns the input data unchanged.
/// Gas: 15 + 3 * ceil(len / 32)
pub fn identity(input: &[u8], gas_limit: i64) -> (bool, Vec<u8>, i64) {
    let gas = 15 + 3 * ((input.len() as i64 + 31) / 32);
    if gas > gas_limit {
        return (false, vec![], gas_limit);
    }
    (true, input.to_vec(), gas)
}