-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade to Solidity 0.8.22 * Update foundry to support Solidity 0.8.22 * Update bindings for Gateway.sol * Smokestests now require serde
- Loading branch information
Showing
45 changed files
with
364 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
/// @title An agent contract that acts on behalf of a consensus system on Polkadot | ||
/// @dev Instances of this contract act as an agents for arbitrary consensus systems on Polkadot. These consensus systems | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {AgentExecuteCommand, ParaID} from "./Types.sol"; | ||
import {SubstrateTypes} from "./SubstrateTypes.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {IERC20} from "./interfaces/IERC20.sol"; | ||
import {IGateway} from "./interfaces/IGateway.sol"; | ||
|
@@ -17,12 +17,6 @@ library Assets { | |
using Address for address; | ||
using SafeTokenTransferFrom for IERC20; | ||
|
||
/// @dev Emitted once the funds are locked and a message is successfully queued. | ||
event TokenSent( | ||
address indexed token, address indexed sender, ParaID destinationChain, bytes destinationAddress, uint128 amount | ||
); | ||
event TokenRegistrationSent(address token); | ||
|
||
/* Errors */ | ||
error InvalidToken(); | ||
error InvalidAmount(); | ||
|
@@ -55,7 +49,7 @@ library Assets { | |
} | ||
extraFee = $.sendTokenFee; | ||
|
||
emit TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
emit IGateway.TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
} | ||
|
||
function sendToken( | ||
|
@@ -77,7 +71,7 @@ library Assets { | |
|
||
payload = SubstrateTypes.SendToken(address(this), token, destinationChain, destinationAddress, amount); | ||
extraFee = $.sendTokenFee; | ||
emit TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
emit IGateway.TokenSent(sender, token, destinationChain, abi.encodePacked(destinationAddress), amount); | ||
} | ||
|
||
/// @dev transfer tokens from the sender to the specified | ||
|
@@ -105,6 +99,6 @@ library Assets { | |
payload = SubstrateTypes.RegisterToken(token); | ||
extraFee = $.registerTokenFee; | ||
|
||
emit TokenRegistrationSent(token); | ||
emit IGateway.TokenRegistrationSent(token); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {ECDSA} from "openzeppelin/utils/cryptography/ECDSA.sol"; | ||
import {SubstrateMerkleProof} from "./utils/SubstrateMerkleProof.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {WETH9} from "canonical-weth/WETH9.sol"; | ||
import {Script} from "forge-std/Script.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {WETH9} from "canonical-weth/WETH9.sol"; | ||
import {Script} from "forge-std/Script.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {MerkleProof} from "openzeppelin/utils/cryptography/MerkleProof.sol"; | ||
import {Verification} from "./Verification.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {ERC1967} from "./utils/ERC1967.sol"; | ||
import {IInitializable} from "./interfaces/IInitializable.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {ScaleCodec} from "./utils/ScaleCodec.sol"; | ||
import {ParaID} from "./Types.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
type ParaID is uint256; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {SubstrateMerkleProof} from "./utils/SubstrateMerkleProof.sol"; | ||
import {BeefyClient} from "./BeefyClient.sol"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {OperatingMode, InboundMessage, ParaID} from "../Types.sol"; | ||
import {Verification} from "../Verification.sol"; | ||
|
@@ -34,6 +34,12 @@ interface IGateway { | |
// Emitted when funds are withdrawn from an agent | ||
event AgentFundsWithdrawn(bytes32 indexed agentID, address indexed recipient, uint256 amount); | ||
|
||
/// @dev Emitted once the funds are locked and a message is successfully queued. | ||
event TokenSent( | ||
address indexed token, address indexed sender, ParaID destinationChain, bytes destinationAddress, uint128 amount | ||
); | ||
event TokenRegistrationSent(address token); | ||
|
||
/** | ||
* Getters | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
/** | ||
* @title Initialization of gateway contracts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
library AssetsStorage { | ||
struct Layout { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {Channel, OperatingMode, ParaID} from "../Types.sol"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// SPDX-FileCopyrightText: 2023 Axelar Network | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
|
||
pragma solidity ^0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
library Address { | ||
// Checks whether `account` is a contract | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {Bits} from "./Bits.sol"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
// Code from https://github.com/ethereum/solidity-examples | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
library Bits { | ||
uint256 internal constant ONE = uint256(1); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
// SPDX-License-Identifier: MIT | ||
// SPDX-FileCopyrightText: 2023 OpenZeppelin | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
// Derived from OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) | ||
library Call { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
/** | ||
* @title A utility library for 16 bit counters packed in 256 bit array. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
/// @title Minimal implementation of ERC1967 storage slot | ||
library ERC1967 { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
library MMRProof { | ||
error ProofSizeExceeded(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// SPDX-FileCopyrightText: 2023 OpenZeppelin | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
// Code from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/Math.sol | ||
pragma solidity ^0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
/** | ||
* @dev Standard math utilities missing in the Solidity language. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// SPDX-FileCopyrightText: 2023 Axelar Network | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
|
||
pragma solidity ^0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
import {IERC20} from "../interfaces/IERC20.sol"; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
library ScaleCodec { | ||
error UnsupportedCompactEncoding(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// SPDX-FileCopyrightText: 2023 Snowfork <[email protected]> | ||
pragma solidity 0.8.20; | ||
pragma solidity 0.8.22; | ||
|
||
// Used to verify merkle proofs generated by https://github.com/paritytech/substrate/tree/master/utils/binary-merkle-tree | ||
library SubstrateMerkleProof { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.