mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-04-26 11:07:56 +00:00
bugfix missing byte swap for the create2 salt value (#272)
Found in https://github.com/paritytech/contract-issues/issues/45, thanks @albertov19 and @sekisamu --------- Signed-off-by: xermicus <cyrill@parity.io> Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -486,3 +486,31 @@ fn transfer_denies_reentrancy() {
|
||||
}
|
||||
.run();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn create2_salt() {
|
||||
let salt = U256::from(777);
|
||||
let predicted = Contract::predicted_constructor(salt).pvm_runtime;
|
||||
let predictor = Contract::address_predictor_constructor(salt, predicted.clone().into());
|
||||
Specs {
|
||||
actions: vec![
|
||||
Upload {
|
||||
origin: TestAddress::Alice,
|
||||
code: Code::Bytes(predicted),
|
||||
storage_deposit_limit: None,
|
||||
},
|
||||
Instantiate {
|
||||
origin: TestAddress::Alice,
|
||||
value: 0,
|
||||
gas_limit: Some(GAS_LIMIT),
|
||||
storage_deposit_limit: None,
|
||||
code: Code::Bytes(predictor.pvm_runtime),
|
||||
data: predictor.calldata,
|
||||
salt: OptionalHex::default(),
|
||||
},
|
||||
],
|
||||
differential: false,
|
||||
..Default::default()
|
||||
}
|
||||
.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user