Skip to content

Commit

Permalink
bump wormhole sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
AgusVelez5 authored and scnale committed Jan 20, 2025
1 parent 5c79b0d commit 4455848
Show file tree
Hide file tree
Showing 18 changed files with 238 additions and 949 deletions.
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
[submodule "evm/lib/openzeppelin-contracts"]
path = evm/lib/openzeppelin-contracts
url = https://github.com/openzeppelin/openzeppelin-contracts
[submodule "evm/lib/relayer-infra-contracts"]
path = lib/relayer-infra-contracts
url = https://github.com/XLabs/relayer-infra-contracts
[submodule "evm/lib/permit2"]
path = evm/lib/permit2
url = https://github.com/Uniswap/permit2
[submodule "evm/lib/wormhole-solidity-sdk"]
path = evm/lib/wormhole-solidity-sdk
url = https://github.com/wormhole-foundation/wormhole-solidity-sdk
[submodule "wormhole-foundation-solidity-sdk"]
path = evm/lib/wormhole-solidity-sdk
url = https://github.com/wormhole-foundation/wormhole-solidity-sdk
[submodule "lib/relayer-infra-contracts"]
path = lib/relayer-infra-contracts
url = https://github.com/XLabs/relayer-infra-contracts
2 changes: 1 addition & 1 deletion evm/lib/wormhole-solidity-sdk
2 changes: 1 addition & 1 deletion evm/src/Tbr.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ contract Tbr is TbrDispatcher {
(admins[i], offset) = args.asAddressCdUnchecked(offset);
}

args.checkLengthCd(offset);
BytesParsing.checkLength(offset, args.length);

_accessControlConstruction(owner, admins);
_configConstruction(payable(feeRecipient));
Expand Down
7 changes: 0 additions & 7 deletions evm/src/assets/TbrBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,4 @@ abstract contract TbrBase is PriceOracleIntegration {
}
state.paused = paused;
}

function _transferEth(address to, uint256 amount) internal {
if (amount == 0) return;

(bool success, ) = to.call{value: amount}(new bytes(0));
if (!success) revert PaymentFailure(to);
}
}
8 changes: 4 additions & 4 deletions evm/src/assets/TbrConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
accessControlState,
Role,
NotAuthorized,
senderHasAuth
} from "./sharedComponents/AccessControl.sol";
senderAtLeastAdmin
} from "wormhole-sdk/components/dispatcher/AccessControl.sol";
import { BytesParsing } from "wormhole-sdk/libraries/BytesParsing.sol";
import { ProxyBase } from "wormhole-sdk/proxy/ProxyBase.sol";
import { TbrBase } from "./TbrBase.sol";
Expand Down Expand Up @@ -50,7 +50,7 @@ abstract contract TbrConfig is TbrBase, AccessControl {
// ---- externals ----

function _batchConfigCommands(bytes calldata commands, uint offset) internal returns (uint) {
bool isOwner = senderHasAuth() == Role.Owner;
bool isOwner = senderAtLeastAdmin() == Role.Owner;

uint commandCount;
(commandCount, offset) = commands.asUint8CdUnchecked(offset);
Expand Down Expand Up @@ -168,7 +168,7 @@ abstract contract TbrConfig is TbrBase, AccessControl {
// ---- private ----

function _setFeeRecipient(address newFeeRecipient) internal {
senderHasAuth();
senderAtLeastAdmin();

ConfigState storage state = configState();
address oldFeeRecipient = state.feeRecipient;
Expand Down
15 changes: 8 additions & 7 deletions evm/src/assets/TbrDispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
pragma solidity ^0.8.25;

import { BytesParsing } from "wormhole-sdk/libraries/BytesParsing.sol";
import { SweepTokens } from "./sharedComponents/SweepTokens.sol";
import { SweepTokens } from "wormhole-sdk/components/dispatcher/SweepTokens.sol";
import { tokenOrNativeTransfer } from "wormhole-sdk/utils/Transfer.sol";
import { RawDispatcher } from "wormhole-sdk/RawDispatcher.sol";
import { Upgrade } from "./sharedComponents/Upgrade.sol";
import { Upgrade } from "wormhole-sdk/components/dispatcher/Upgrade.sol";
import { InvalidCommand } from "./TbrBase.sol";
import { TbrConfig } from "./TbrConfig.sol";
import { TbrUser } from "./TbrUser.sol";
import "./sharedComponents/ids.sol";
import "wormhole-sdk/components/dispatcher/ids.sol";
import "./TbrIds.sol";

/**
Expand Down Expand Up @@ -71,10 +72,10 @@ abstract contract TbrDispatcher is RawDispatcher, TbrConfig, TbrUser, SweepToken
++commandIndex;
}

data.checkLengthCd(offset);
BytesParsing.checkLength(offset, data.length);

_transferEth(_getFeeRecipient(), fees);
_transferEth(msg.sender, senderRefund);
tokenOrNativeTransfer(address(0), _getFeeRecipient(), fees);
tokenOrNativeTransfer(address(0), msg.sender, senderRefund);
return new bytes(0);
}}

Expand Down Expand Up @@ -113,7 +114,7 @@ abstract contract TbrDispatcher is RawDispatcher, TbrConfig, TbrUser, SweepToken
ret = abi.encodePacked(ret, result);
++queryIndex;
}
data.checkLengthCd(offset);
BytesParsing.checkLength(offset, data.length);
return ret;
}}
}
250 changes: 0 additions & 250 deletions evm/src/assets/sharedComponents/AccessControl.sol

This file was deleted.

Loading

0 comments on commit 4455848

Please sign in to comment.