Skip to content

Commit b3ab61c

Browse files
authored
Merge pull request #517 from AmbireTech/remove_create2
Removed create2 with sweeper deposits
2 parents fb34b48 + e207042 commit b3ab61c

File tree

27 files changed

+73
-447
lines changed

27 files changed

+73
-447
lines changed

Cargo.lock

Lines changed: 0 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

adapter/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ primitives = { path = "../primitives" }
2121
# For Ethereum client
2222
web3 = { version = "0.18", features = ["http-tls", "signing"] }
2323
ethsign = "0.8"
24-
create2 = "0.0.2"
2524

2625
# For Dummy client
2726
dashmap = "5"

adapter/src/dummy.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ pub static DUMMY_CHAIN: Lazy<Chain> = Lazy::new(|| Chain {
2525
outpace: "0x0000000000000000000000000000000000000000"
2626
.parse()
2727
.unwrap(),
28-
sweeper: "0x0000000000000000000000000000000000000000"
29-
.parse()
30-
.unwrap(),
3128
});
3229

3330
/// Dummy adapter implementation intended for testing.
@@ -212,7 +209,7 @@ mod test {
212209
let channel_context = ChainOf {
213210
context: channel,
214211
token: TokenInfo {
215-
min_token_units_for_deposit: 1_u64.into(),
212+
min_campaign_budget: 1_u64.into(),
216213
min_validator_fee: 1_u64.into(),
217214
precision: NonZeroU8::new(UnifiedNum::PRECISION).expect("Non zero u8"),
218215
address: channel.token,
@@ -234,15 +231,14 @@ mod test {
234231
assert!(result.is_err());
235232
}
236233

237-
let get_deposit = |total: u64, create2: u64| Deposit {
234+
let get_deposit = |total: u64| Deposit {
238235
total: BigNum::from(total),
239-
still_on_create2: BigNum::from(create2),
240236
};
241237

242238
// add two deposit and call 3 times
243239
// also check if different address does not have access to these calls
244240
{
245-
let deposits = [get_deposit(6969, 69), get_deposit(1000, 0)];
241+
let deposits = [get_deposit(6969), get_deposit(1000)];
246242
dummy_client.add_deposit_call(channel.id(), address, deposits[0].clone());
247243
dummy_client.add_deposit_call(channel.id(), address, deposits[1].clone());
248244

adapter/src/ethereum.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use web3::signing::keccak256;
88
use crate::{Adapter, LockedState, UnlockedState};
99

1010
pub use {
11-
client::{get_counterfactual_address, Ethereum, Options},
11+
client::{Ethereum, Options},
1212
error::Error,
1313
};
1414

@@ -46,12 +46,6 @@ pub static SWEEPER_ABI: Lazy<&'static [u8]> =
4646
pub static IDENTITY_ABI: Lazy<&'static [u8]> =
4747
Lazy::new(|| include_bytes!("../../lib/protocol-eth/abi/Identity5.2.json"));
4848

49-
/// Ready to use init code (i.e. decoded) for calculating the create2 address
50-
pub static DEPOSITOR_BYTECODE_DECODED: Lazy<Vec<u8>> = Lazy::new(|| {
51-
let bytecode = include_str!("../../lib/protocol-eth/resources/bytecode/Depositor.bin");
52-
hex::decode(bytecode).expect("Decoded properly")
53-
});
54-
5549
/// Hashes the passed message with the format of `Signed Data Standard`
5650
/// See https://eips.ethereum.org/EIPS/eip-191
5751
fn to_ethereum_signed(message: &[u8]) -> [u8; 32] {

0 commit comments

Comments
 (0)