Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions etc/eth-contracts/contracts/EvmErc20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ contract EvmErc20 is Context, ERC20, AdminControlled, IExit {
uint input_size = 1 + 32 + recipient.length;

assembly {
let res := staticcall(gas(), 0xe9217bc70b7ed1f598ddd3199e80b093fa71124f, add(input, 32), input_size, 0, 32)
let res := call(gas(), 0xe9217bc70b7ed1f598ddd3199e80b093fa71124f, 0, add(input, 32), input_size, 0, 32)
}
}

Expand All @@ -49,7 +49,7 @@ contract EvmErc20 is Context, ERC20, AdminControlled, IExit {
uint input_size = 1 + 32 + 20;

assembly {
let res := staticcall(gas(), 0xb0bd02f6a392af548bdf1cfaee5dfa0eefcc8eab, add(input, 32), input_size, 0, 32)
let res := call(gas(), 0xb0bd02f6a392af548bdf1cfaee5dfa0eefcc8eab, 0, add(input, 32), input_size, 0, 32)
}
}
}
28 changes: 10 additions & 18 deletions src/precompiles/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,16 @@ impl<S: AuroraState> Precompile<S> for ExitToNear<S> {
target_gas: u64,
context: &Context,
state: &mut S,
_is_static: bool,
is_static: bool,
) -> PrecompileResult {
if Self::required_gas(input)? > target_gas {
return Err(ExitError::OutOfGas);
}

// TODO(MarX): After calling directly function withdraw in Tester.sol
// This function is called with is_static = true
// Figure out if this needs to be fixed in EVM, or the way
// that is being used to determine if a function is called in static
// mode is incorrect.
// if is_static {
// return Err(ExitError::Other(Cow::from("ERR_INVALID_IN_STATIC")));
// }
// It's not allowed to call exit precompiles in static mode
if is_static {
return Err(ExitError::Other(Cow::from("ERR_INVALID_IN_STATIC")));
}

// First byte of the input is a flag, selecting the behavior to be triggered:
// 0x0 -> Eth transfer
Expand Down Expand Up @@ -227,20 +223,16 @@ impl<S: AuroraState> Precompile<S> for ExitToEthereum<S> {
target_gas: u64,
context: &Context,
state: &mut S,
_is_static: bool,
is_static: bool,
) -> PrecompileResult {
if Self::required_gas(input)? > target_gas {
return Err(ExitError::OutOfGas);
}

// TODO(MarX): After calling directly function withdraw in Tester.sol
// This function is called with is_static = true
// Figure out if this needs to be fixed in EVM, or the way
// that is being used to determine if a function is called in static
// mode is incorrect.
// if is_static {
// return Err(ExitError::Other(Cow::from("ERR_INVALID_IN_STATIC")));
// }
// It's not allowed to call exit precompiles in static mode
if is_static {
return Err(ExitError::Other(Cow::from("ERR_INVALID_IN_STATIC")));
}

// First byte of the input is a flag, selecting the behavior to be triggered:
// 0x0 -> Eth transfer
Expand Down