-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add dockerfile and dockerignore for sequencer * Add dockerized sequencer config * Add specific genesis config for docker * Add docker publish block script * Update docker config chain id for hive tests * Store hive dockerfile in another folder * Update hive genesis folder location * Update hive config * add storage as genesis option * update hive genesis * update docker rust version * Erce/fix evm genesis storage (#321) * Add eth_getBlockTransactionCountByHash rpc and test * Add hive contract and WIP test * Add hive contract and WIP test * Fix predeploy contract bug * Add more tests related to genesis contract deployment * update rust version (#317) * Esad/more links in readme (#318) * update rust version * add links in warning * Don't burn base fee (#302) * Don't burn base fee * small change on estimate gas test --------- Co-authored-by: eyusufatik <[email protected]> * update reth remove alloy-rpc-types and use reth-rpc-types * Update cargo.lock * Remove print --------- Co-authored-by: Esad Yusuf Atik <[email protected]> Co-authored-by: Roman <[email protected]> Co-authored-by: eyusufatik <[email protected]> * fix horrible nightly merges * Restore removed Cargo.lock files * use HashMap::is_empty instead of Option for skip_deserialize in EVM Genesis config * Add storage slots w/o slot len check --------- Co-authored-by: Erce Can Bektüre <[email protected]> Co-authored-by: Erce Can Bektüre <[email protected]> Co-authored-by: Roman <[email protected]>
- Loading branch information
1 parent
72fb8d6
commit efa5f8f
Showing
18 changed files
with
622 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{"constant":true,"inputs":[],"name":"ui","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getFromMap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"value","type":"uint256"}],"name":"addToMap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"ui_","type":"uint256"},{"name":"addr_","type":"address"}],"name":"events","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"a","type":"uint256"},{"name":"b","type":"uint256"},{"name":"c","type":"uint256"}],"name":"constFunc","outputs":[{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"ui_","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[],"name":"E0","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"","type":"uint256"}],"name":"E1","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"","type":"uint256"}],"name":"E2","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"","type":"address"}],"name":"E3","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"","type":"address"}],"name":"E4","type":"event"},{"anonymous":true,"inputs":[{"indexed":false,"name":"","type":"uint256"},{"indexed":false,"name":"","type":"address"}],"name":"E5","type":"event"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
608060405234801561001057600080fd5b506040516020806104dd833981018060405281019080805190602001909291905050508060008190555080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505061044f8061008e6000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063a223e05d14610072578063abd1a0cf1461009d578063abfced1d146100f4578063e05c914a14610141578063e6768b451461018e575b600080fd5b34801561007e57600080fd5b506100876101f1565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100de600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506101f7565b6040518082815260200191505060405180910390f35b34801561010057600080fd5b5061013f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610240565b005b34801561014d57600080fd5b5061018c60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610288565b005b34801561019a57600080fd5b506101cd60048036038101908080359060200190929190803590602001909291908035906020019092919050505061040c565b60405180848152602001838152602001828152602001935050505060405180910390f35b60005481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b7f6031a8d62d7c95988fa262657cd92107d90ed96e08d8f867d32f26edfe85502260405160405180910390a17f47e2689743f14e97f7dcfa5eec10ba1dff02f83b3d1d4b9c07b206cbbda66450826040518082815260200191505060405180910390a1817fa48a6b249a5084126c3da369fbc9b16827ead8cb5cdc094b717d3f1dcd995e2960405160405180910390a27f7890603b316f3509577afd111710f9ebeefa15e12f72347d9dffd0d65ae3bade81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a18073ffffffffffffffffffffffffffffffffffffffff167f7efef9ea3f60ddc038e50cccec621f86a0195894dc0520482abf8b5c6b659e4160405160405180910390a28181604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a05050565b6000806000858585925092509250935093509390505600a165627a7a72305820fe919e6847ca1cdcd1515740e9d079a4632ffc0e13562b71878a2ca15753361a0029 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
pragma solidity ^0.4.6; | ||
|
||
contract Test { | ||
event E0(); | ||
event E1(uint); | ||
event E2(uint indexed); | ||
event E3(address); | ||
event E4(address indexed); | ||
event E5(uint, address) anonymous; | ||
|
||
uint public ui; | ||
mapping(address => uint) map; | ||
|
||
function Test(uint ui_) { | ||
ui = ui_; | ||
map[msg.sender] = ui_; | ||
} | ||
|
||
function events(uint ui_, address addr_) { | ||
E0(); | ||
E1(ui_); | ||
E2(ui_); | ||
E3(addr_); | ||
E4(addr_); | ||
E5(ui_, addr_); | ||
} | ||
|
||
function constFunc( | ||
uint a, | ||
uint b, | ||
uint c | ||
) constant returns (uint, uint, uint) { | ||
return (a, b, c); | ||
} | ||
|
||
function getFromMap(address addr) constant returns (uint) { | ||
return map[addr]; | ||
} | ||
|
||
function addToMap(address addr, uint value) { | ||
map[addr] = value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
use ethers_contract::BaseContract; | ||
use ethers_core::types::Bytes; | ||
|
||
use super::{make_contract_from_abi, test_data_path}; | ||
|
||
/// CallerContract wrapper. | ||
pub struct HiveContract { | ||
bytecode: Bytes, | ||
base_contract: BaseContract, | ||
} | ||
|
||
impl Default for HiveContract { | ||
fn default() -> Self { | ||
Self::new() | ||
} | ||
} | ||
|
||
impl HiveContract { | ||
/// Create a new instance of HiveContract. | ||
pub fn new() -> Self { | ||
let contract_data = { | ||
let mut path = test_data_path(); | ||
path.push("HiveContract.bin"); | ||
|
||
let contract_data = std::fs::read_to_string(path).unwrap(); | ||
hex::decode(contract_data).unwrap() | ||
}; | ||
|
||
let base_contract = { | ||
let mut path = test_data_path(); | ||
path.push("HiveContract.abi"); | ||
|
||
make_contract_from_abi(path) | ||
}; | ||
Self { | ||
bytecode: Bytes::from(contract_data), | ||
base_contract, | ||
} | ||
} | ||
/// Calls ConstFunc of Hive Contract | ||
pub fn call_const_func(&self, a: u32, b: u32, c: u32) -> Bytes { | ||
let arg_a = ethereum_types::U256::from(a); | ||
let arg_b = ethereum_types::U256::from(b); | ||
let arg_c = ethereum_types::U256::from(c); | ||
let args = (arg_a, arg_b, arg_c); | ||
self.base_contract.encode("constFunc", args).unwrap() | ||
} | ||
|
||
/// Bytecode of the Hive Contract. | ||
pub fn byte_code(&self) -> Bytes { | ||
self.bytecode.clone() | ||
} | ||
} |
Oops, something went wrong.