EVMHost: simplify code using new evmc features

This commit is contained in:
Alex Beregszaszi 2020-05-13 22:37:07 +01:00
parent 098cfd333f
commit 7353804252

View File

@ -99,17 +99,16 @@ EVMHost::EVMHost(langutil::EVMVersion _evmVersion, evmc::VM& _vm):
evmc::address address{};
address.bytes[19] = precompiledAddress;
// 1wei
accounts[address].balance.bytes[31] = 1;
accounts[address].balance = evmc::uint256be{1};
}
// TODO: support short literals in EVMC and use them here
tx_context.block_difficulty = convertToEVMC(u256("200000000"));
tx_context.block_difficulty = evmc::uint256be{200000000};
tx_context.block_gas_limit = 20000000;
tx_context.block_coinbase = 0x7878787878787878787878787878787878787878_address;
tx_context.tx_gas_price = convertToEVMC(u256("3000000000"));
tx_context.tx_gas_price = evmc::uint256be{3000000000};
tx_context.tx_origin = 0x9292929292929292929292929292929292929292_address;
// Mainnet according to EIP-155
tx_context.chain_id = convertToEVMC(u256(1));
tx_context.chain_id = evmc::uint256be{1};
}
void EVMHost::selfdestruct(const evmc::address& _addr, const evmc::address& _beneficiary) noexcept