forge fmt'

This commit is contained in:
derpy-duck 2023-03-01 23:22:44 +00:00 committed by chase-45
parent 81cb32981a
commit 27cbbc7804
4 changed files with 58 additions and 70 deletions

View File

@ -196,7 +196,7 @@ contract CoreRelayer is CoreRelayerDelivery {
if (nonce == 0) {
revert IWormholeRelayer.NonceIsZero();
}
if(sendContainer.requests.length == 0) {
if (sendContainer.requests.length == 0) {
revert IWormholeRelayer.MultichainSendEmpty();
}
@ -255,7 +255,7 @@ contract CoreRelayer is CoreRelayerDelivery {
if (msg.sender != lockedTargetAddress()) {
revert IWormholeRelayer.ForwardRequestFromWrongAddress();
}
if(sendContainer.requests.length == 0) {
if (sendContainer.requests.length == 0) {
revert IWormholeRelayer.MultichainSendEmpty();
}

View File

@ -49,7 +49,6 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
// Checks if enough funds were passed into the forward
forwardIsFunded = (transactionFeeRefundAmount >= forwardInstruction.totalFee);
IRelayProvider relayProvider = IRelayProvider(forwardInstruction.relayProvider);
IWormhole wormhole = wormhole();
uint256 wormholeMessageFee = wormhole.messageFee();
@ -117,7 +116,6 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
uint16 sourceChain,
uint64 sourceSequence
) internal {
// lock the contract to prevent reentrancy
if (isContractLocked()) {
revert IDelivery.ReentrantCall();
@ -228,7 +226,6 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
* @param targetParams struct containing the signed wormhole messages and encoded redelivery instruction (and other information)
*/
function redeliverSingle(IDelivery.TargetRedeliveryByTxHashParamsSingle memory targetParams) public payable {
IWormhole wormhole = wormhole();
(IWormhole.VM memory redeliveryVM, bool valid, string memory reason) =
@ -264,8 +261,8 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
// Obtain the specific old instruction that was originally executed (and is meant to be re-executed with new parameters)
// specifying the the target chain (must be this chain), target address, refund address, old maximum refund (in this chain's currency),
// old receiverValue (in this chain's currency), old upper bound on gas, and the permissioned address allowed to execute this instruction
DeliveryInstruction memory originalInstruction = decodeDeliveryInstructionsContainer(originalDeliveryVM.payload).instructions[redeliveryInstruction
.multisendIndex];
DeliveryInstruction memory originalInstruction = decodeDeliveryInstructionsContainer(originalDeliveryVM.payload)
.instructions[redeliveryInstruction.multisendIndex];
// Perform the following checks:
// - the new redelivery instruction's upper bound on gas >= the original instruction's upper bound on gas
@ -275,9 +272,7 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
// - for the redelivery instruction, the relay provider passed in at least [(one wormhole message fee) + instruction.newMaximumRefundTarget + instruction.newReceiverValueTarget] of this chain's currency as msg.value
// - msg.sender is the permissioned address allowed to execute this redelivery instruction
// - the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction
valid = checkRedeliveryInstructionTarget(
redeliveryInstruction, originalInstruction
);
valid = checkRedeliveryInstructionTarget(redeliveryInstruction, originalInstruction);
// Emit an 'Invalid Redelivery' event if one of the following five checks failed:
// - msg.sender is the permissioned address allowed to execute this redelivery instruction
@ -328,7 +323,6 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
RedeliveryByTxHashInstruction memory redeliveryInstruction,
DeliveryInstruction memory originalInstruction
) internal view returns (bool isValid) {
address providerAddress = fromWormholeFormat(redeliveryInstruction.executionParameters.providerDeliveryAddress);
// Check that the permissioned address allowed to execute this redelivery instruction is the permissioned address allowed to execute the old instruction
@ -351,16 +345,12 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
// Check that msg.sender is the permissioned address allowed to execute this redelivery instruction
isValid = msg.sender == providerAddress
// Check that the redelivery instruction's target chain = this chain
&& whChainId == redeliveryInstruction.targetChain
// Check that the original instruction's target chain = this chain
&& whChainId == originalInstruction.targetChain
// Check that the new redelivery instruction's 'receiver value' amount >= the original instruction's 'receiver value' amount
&& originalInstruction.receiverValueTarget <= redeliveryInstruction.newReceiverValueTarget
// Check that the new redelivery instruction's upper bound on gas >= the original instruction's upper bound on gas
&& originalInstruction.executionParameters.gasLimit <= redeliveryInstruction.executionParameters.gasLimit;
}
@ -386,7 +376,6 @@ contract CoreRelayerDelivery is CoreRelayerGovernance {
* @param targetParams struct containing the signed wormhole messages and encoded delivery instruction container (and other information)
*/
function deliverSingle(IDelivery.TargetDeliveryParametersSingle memory targetParams) public payable {
IWormhole wormhole = wormhole();
// Obtain the delivery VAA

View File

@ -131,10 +131,10 @@ contract CoreRelayerMessages is CoreRelayerStructs, CoreRelayerGetters {
* @param instruction A RedeliveryByTxHashInstruction
* @param relayProvider The relayProvider whos maximum budget we are checking against
*/
function checkRedeliveryInstruction(
RedeliveryByTxHashInstruction memory instruction,
IRelayProvider relayProvider
) internal view {
function checkRedeliveryInstruction(RedeliveryByTxHashInstruction memory instruction, IRelayProvider relayProvider)
internal
view
{
if (instruction.executionParameters.gasLimit == 0) {
revert IWormholeRelayer.MaxTransactionFeeNotEnough(0);
}

View File

@ -4,7 +4,6 @@
pragma solidity ^0.8.0;
interface IDelivery {
/**
* @notice TargetDeliveryParametersSingle is the struct that the relay provider passes into 'deliverSingle'
* containing an array of the signed wormhole messages that are to be relayed