Skip to content

Commit

Permalink
Merge pull request #315 from tranchess/dev-terry-dependency
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
bill-clippy authored Aug 1, 2023
2 parents fe7d7aa + 9757027 commit e27259a
Show file tree
Hide file tree
Showing 85 changed files with 6,119 additions and 5,093 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,12 @@ jobs:
test:
name: Unit Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Setup Node.js ${{ matrix.node-version }} environment
uses: actions/setup-node@v2.1.4
with:
node-version: ${{ matrix.node-version }}
node-version: 20.x
- name: Install dependencies
run: yarn install --immutable
- name: Run unit test
Expand All @@ -31,7 +28,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4
with:
node-version: 12.x
node-version: 20.x
- name: Install dependencies
run: yarn install --immutable
- name: Check lint and format
Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.2.0
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

631 changes: 0 additions & 631 deletions .yarn/releases/yarn-berry.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
yarnPath: ".yarn/releases/yarn-berry.cjs"
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.1.cjs
42 changes: 16 additions & 26 deletions contracts/anyswap/AnyCallAppBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ interface IAnyCallV6Proxy {
}

interface IAnyCallExecutor {
function context()
external
view
returns (
address from,
uint256 fromChainID,
uint256 nonce
);
function context() external view returns (address from, uint256 fromChainID, uint256 nonce);
}

interface IAnyFallback {
Expand Down Expand Up @@ -51,11 +44,7 @@ abstract contract AnyCallAppBase {
_;
}

function _anyCall(
address to,
uint256 toChainID,
bytes memory data
) internal {
function _anyCall(address to, uint256 toChainID, bytes memory data) internal {
uint256 callValue = anyCallFlag == ANY_CALL_FLAG_PAY_ON_DEST ? 0 : msg.value;
address fallbackAddress = anyCallExecuteFallback ? address(this) : address(0);
IAnyCallV6Proxy(anyCallProxy).anyCall{value: callValue}(
Expand All @@ -67,17 +56,18 @@ abstract contract AnyCallAppBase {
);
}

function anyExecute(bytes calldata data)
external
onlyExecutor
returns (bool success, bytes memory result)
{
(address from, uint256 fromChainID, ) =
IAnyCallExecutor(IAnyCallV6Proxy(anyCallProxy).executor()).context();
function anyExecute(
bytes calldata data
) external onlyExecutor returns (bool success, bytes memory result) {
(address from, uint256 fromChainID, ) = IAnyCallExecutor(
IAnyCallV6Proxy(anyCallProxy).executor()
).context();
bytes4 selector = data.length >= 32 ? bytes4(abi.decode(data[0:32], (bytes32))) : bytes4(0);
if (from == address(this) && selector == IAnyFallback.anyFallback.selector) {
(address to, bytes memory fallbackData) =
abi.decode(data[4:data.length], (address, bytes));
(address to, bytes memory fallbackData) = abi.decode(
data[4:data.length],
(address, bytes)
);
require(_checkAnyFallbackTo(to, fromChainID), "Invalid anyFallback to");
_anyFallback(fallbackData);
return (true, "");
Expand All @@ -91,10 +81,10 @@ abstract contract AnyCallAppBase {
return (true, "");
}

function _checkAnyExecuteFrom(address from, uint256 fromChainID)
internal
virtual
returns (bool);
function _checkAnyExecuteFrom(
address from,
uint256 fromChainID
) internal virtual returns (bool);

function _checkAnyFallbackTo(address to, uint256 fromChainID) internal virtual returns (bool);

Expand Down
6 changes: 1 addition & 5 deletions contracts/anyswap/AnyswapChessPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,7 @@ contract AnyswapChessPool is IAnyswapV6ERC20, ERC20, ChessRoles, Ownable {
return _withdraw(from, amount, to);
}

function _withdraw(
address from,
uint256 amount,
address to
) internal returns (uint256) {
function _withdraw(address from, uint256 amount, address to) internal returns (uint256) {
_burn(from, amount);
IERC20(underlying).safeTransfer(to, amount);
return amount;
Expand Down
Loading

0 comments on commit e27259a

Please sign in to comment.