// Sources flattened with hardhat v2.22.2 https://hardhat.org
// SPDX-License-Identifier: AGPL-3.0-only AND MIT
// File @chainlink/contracts-ccip/src/v0.8/ccip/libraries/Client.sol@v1.4.0
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
// End consumer library.
library Client {
/// @dev RMN depends on this struct, if changing, please notify the RMN maintainers.
struct EVMTokenAmount {
address token; // token address on the local chain.
uint256 amount; // Amount of tokens.
}
struct Any2EVMMessage {
bytes32 messageId; // MessageId corresponding to ccipSend on source.
uint64 sourceChainSelector; // Source chain selector.
bytes sender; // abi.decode(sender) if coming from an EVM chain.
bytes data; // payload sent in original message.
EVMTokenAmount[] destTokenAmounts; // Tokens and their amounts in their destination chain representation.
}
// If extraArgs is empty bytes, the default is 200k gas limit.
struct EVM2AnyMessage {
bytes receiver; // abi.encode(receiver address) for dest EVM chains
bytes data; // Data payload
EVMTokenAmount[] tokenAmounts; // Token transfers
address feeToken; // Address of feeToken. address(0) means you will send msg.value.
bytes extraArgs; // Populate this with _argsToBytes(EVMExtraArgsV1)
}
// bytes4(keccak256("CCIP EVMExtraArgsV1"));
bytes4 public constant EVM_EXTRA_ARGS_V1_TAG = 0x97a657c9;
struct EVMExtraArgsV1 {
uint256 gasLimit;
}
function _argsToBytes(EVMExtraArgsV1 memory extraArgs) internal pure returns (bytes memory bts) {
return abi.encodeWithSelector(EVM_EXTRA_ARGS_V1_TAG, extraArgs);
}
}
// File @chainlink/contracts-ccip/src/v0.8/ccip/interfaces/IRouterClient.sol@v1.4.0
// Original license: SPDX_License_Identifier: MIT
pragma solidity ^0.8.0;
interface IRouterClient {
error UnsupportedDestinationChain(uint64 destChainSelector);
error InsufficientFeeTokenAmount();
error InvalidMsgValue();
/// @notice Checks if the given chain ID is supported for sending/receiving.
/// @param chainSelector The chain to check.
/// @return supported is true if it is supported, false if not.
function isChainSupported(uint64 chainSelector) external view returns (bool supported);
/// @notice Gets a list of all supported tokens which can be sent or received
/// to/from a given chain id.
/// @param chainSelector The chainSelector.
/// @return tokens The addresses of all tokens that are supported.
function getSupportedTokens(uint64 chainSelector) external view returns (address[] memory tokens);
/// @param destinationChainSelector The destination chainSelector
/// @param message The cross-chain CCIP message including data and/or tokens
/// @return fee returns execution fee for the message
/// delivery to destination chain, denominated in the feeToken specified in the message.
/// @dev Reverts with appropriate reason upon invalid message.
function getFee(
uint64 destinationChainSelector,
Client.EVM2AnyMessage memory message
) external view returns (uint256 fee);
/// @notice Request a message to be sent to the destination chain
/// @param destinationChainSelector The destination chain ID
/// @param message The cross-chain CCIP message including data and/or tokens
/// @return messageId The message ID
/// @dev Note if msg.value is larger than the required fee (from getFee) we accept
/// the overpayment with no refund.
/// @dev Reverts with appropriate reason upon invalid message.
function ccipSend(
uint64 destinationChainSelector,
Client.EVM2AnyMessage calldata message
) external payable returns (bytes32);
}
// File @openzeppelin/contracts/utils/Context.sol@v4.8.1
// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File @openzeppelin/contracts/access/Ownable.sol@v4.8.1
// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File @openzeppelin/contracts/security/Pausable.sol@v4.8.1
// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File contracts/helpers/AddressHelper.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @notice Emitted when the account is not a contract
* @param account The account address
*/
error NonContractAddressError(address account);
/**
* @notice Function to check if the account is a contract
* @return The account contract status flag
*/
function isContract(address _account) view returns (bool) {
return _account.code.length > 0;
}
/**
* @notice Function to require an account to be a contract
*/
function requireContract(address _account) view {
if (!isContract(_account)) {
revert NonContractAddressError(_account);
}
}
/**
* @notice Function to require an account to be a contract or a zero address
*/
function requireContractOrZeroAddress(address _account) view {
if (_account != address(0)) {
requireContract(_account);
}
}
// File contracts/Constants.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @dev The default token decimals value
*/
uint256 constant DECIMALS_DEFAULT = 18;
/**
* @dev The maximum uint256 value for swap amount limit settings
*/
uint256 constant INFINITY = type(uint256).max;
/**
* @dev The default limit of account list size
*/
uint256 constant LIST_SIZE_LIMIT_DEFAULT = 100;
/**
* @dev The limit of swap router list size
*/
uint256 constant LIST_SIZE_LIMIT_ROUTERS = 200;
/**
* @dev The factor for percentage settings. Example: 100 is 0.1%
*/
uint256 constant MILLIPERCENT_FACTOR = 100_000;
/**
* @dev The de facto standard address to denote the native token
*/
address constant NATIVE_TOKEN_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
// File contracts/helpers/TransferHelper.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @notice Emitted when an approval action fails
*/
error SafeApproveError();
/**
* @notice Emitted when a transfer action fails
*/
error SafeTransferError();
/**
* @notice Emitted when a transferFrom action fails
*/
error SafeTransferFromError();
/**
* @notice Emitted when a transfer of the native token fails
*/
error SafeTransferNativeError();
/**
* @notice Safely approve the token to the account
* @param _token The token address
* @param _to The token approval recipient address
* @param _value The token approval amount
*/
function safeApprove(address _token, address _to, uint256 _value) {
// 0x095ea7b3 is the selector for "approve(address,uint256)"
(bool success, bytes memory data) = _token.call(
abi.encodeWithSelector(0x095ea7b3, _to, _value)
);
bool condition = success && (data.length == 0 || abi.decode(data, (bool)));
if (!condition) {
revert SafeApproveError();
}
}
/**
* @notice Safely transfer the token to the account
* @param _token The token address
* @param _to The token transfer recipient address
* @param _value The token transfer amount
*/
function safeTransfer(address _token, address _to, uint256 _value) {
// 0xa9059cbb is the selector for "transfer(address,uint256)"
(bool success, bytes memory data) = _token.call(
abi.encodeWithSelector(0xa9059cbb, _to, _value)
);
bool condition = success && (data.length == 0 || abi.decode(data, (bool)));
if (!condition) {
revert SafeTransferError();
}
}
/**
* @notice Safely transfer the token between the accounts
* @param _token The token address
* @param _from The token transfer source address
* @param _to The token transfer recipient address
* @param _value The token transfer amount
*/
function safeTransferFrom(address _token, address _from, address _to, uint256 _value) {
// 0x23b872dd is the selector for "transferFrom(address,address,uint256)"
(bool success, bytes memory data) = _token.call(
abi.encodeWithSelector(0x23b872dd, _from, _to, _value)
);
bool condition = success && (data.length == 0 || abi.decode(data, (bool)));
if (!condition) {
revert SafeTransferFromError();
}
}
/**
* @notice Safely transfer the native token to the account
* @param _to The native token transfer recipient address
* @param _value The native token transfer amount
*/
function safeTransferNative(address _to, uint256 _value) {
(bool success, ) = _to.call{ value: _value }(new bytes(0));
if (!success) {
revert SafeTransferNativeError();
}
}
// File contracts/interfaces/ITokenBalance.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title ITokenBalance
* @notice Token balance interface
*/
interface ITokenBalance {
/**
* @notice Getter of the token balance by the account
* @param _account The account address
* @return Token balance
*/
function balanceOf(address _account) external view returns (uint256);
}
// File contracts/DataStructures.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @notice Optional value structure
* @dev Is used in mappings to allow zero values
* @param isSet Value presence flag
* @param value Numeric value
*/
struct OptionalValue {
bool isSet;
uint256 value;
}
/**
* @notice Key-to-value structure
* @dev Is used as an array parameter item to perform multiple key-value settings
* @param key Numeric key
* @param value Numeric value
*/
struct KeyToValue {
uint256 key;
uint256 value;
}
/**
* @notice Key-to-value structure for address values
* @dev Is used as an array parameter item to perform multiple key-value settings with address values
* @param key Numeric key
* @param value Address value
*/
struct KeyToAddressValue {
uint256 key;
address value;
}
/**
* @notice Address-to-flag structure
* @dev Is used as an array parameter item to perform multiple settings
* @param account Account address
* @param flag Flag value
*/
struct AccountToFlag {
address account;
bool flag;
}
/**
* @notice Emitted when a list exceeds the size limit
*/
error ListSizeLimitError();
/**
* @notice Sets or updates a value in a combined map (a mapping with a key list and key index mapping)
* @param _map The mapping reference
* @param _keyList The key list reference
* @param _keyIndexMap The key list index mapping reference
* @param _key The numeric key
* @param _value The address value
* @param _sizeLimit The map and list size limit
* @return isNewKey True if the key was just added, otherwise false
*/
function combinedMapSet(
mapping(uint256 => address) storage _map,
uint256[] storage _keyList,
mapping(uint256 => OptionalValue) storage _keyIndexMap,
uint256 _key,
address _value,
uint256 _sizeLimit
) returns (bool isNewKey) {
isNewKey = !_keyIndexMap[_key].isSet;
if (isNewKey) {
uniqueListAdd(_keyList, _keyIndexMap, _key, _sizeLimit);
}
_map[_key] = _value;
}
/**
* @notice Removes a value from a combined map (a mapping with a key list and key index mapping)
* @param _map The mapping reference
* @param _keyList The key list reference
* @param _keyIndexMap The key list index mapping reference
* @param _key The numeric key
* @return isChanged True if the combined map was changed, otherwise false
*/
function combinedMapRemove(
mapping(uint256 => address) storage _map,
uint256[] storage _keyList,
mapping(uint256 => OptionalValue) storage _keyIndexMap,
uint256 _key
) returns (bool isChanged) {
isChanged = _keyIndexMap[_key].isSet;
if (isChanged) {
delete _map[_key];
uniqueListRemove(_keyList, _keyIndexMap, _key);
}
}
/**
* @notice Adds a value to a unique value list (a list with value index mapping)
* @param _list The list reference
* @param _indexMap The value index mapping reference
* @param _value The numeric value
* @param _sizeLimit The list size limit
* @return isChanged True if the list was changed, otherwise false
*/
function uniqueListAdd(
uint256[] storage _list,
mapping(uint256 => OptionalValue) storage _indexMap,
uint256 _value,
uint256 _sizeLimit
) returns (bool isChanged) {
isChanged = !_indexMap[_value].isSet;
if (isChanged) {
if (_list.length >= _sizeLimit) {
revert ListSizeLimitError();
}
_indexMap[_value] = OptionalValue(true, _list.length);
_list.push(_value);
}
}
/**
* @notice Removes a value from a unique value list (a list with value index mapping)
* @param _list The list reference
* @param _indexMap The value index mapping reference
* @param _value The numeric value
* @return isChanged True if the list was changed, otherwise false
*/
function uniqueListRemove(
uint256[] storage _list,
mapping(uint256 => OptionalValue) storage _indexMap,
uint256 _value
) returns (bool isChanged) {
OptionalValue storage indexItem = _indexMap[_value];
isChanged = indexItem.isSet;
if (isChanged) {
uint256 itemIndex = indexItem.value;
uint256 lastIndex = _list.length - 1;
if (itemIndex != lastIndex) {
uint256 lastValue = _list[lastIndex];
_list[itemIndex] = lastValue;
_indexMap[lastValue].value = itemIndex;
}
_list.pop();
delete _indexMap[_value];
}
}
/**
* @notice Adds a value to a unique address value list (a list with value index mapping)
* @param _list The list reference
* @param _indexMap The value index mapping reference
* @param _value The address value
* @param _sizeLimit The list size limit
* @return isChanged True if the list was changed, otherwise false
*/
function uniqueAddressListAdd(
address[] storage _list,
mapping(address => OptionalValue) storage _indexMap,
address _value,
uint256 _sizeLimit
) returns (bool isChanged) {
isChanged = !_indexMap[_value].isSet;
if (isChanged) {
if (_list.length >= _sizeLimit) {
revert ListSizeLimitError();
}
_indexMap[_value] = OptionalValue(true, _list.length);
_list.push(_value);
}
}
/**
* @notice Removes a value from a unique address value list (a list with value index mapping)
* @param _list The list reference
* @param _indexMap The value index mapping reference
* @param _value The address value
* @return isChanged True if the list was changed, otherwise false
*/
function uniqueAddressListRemove(
address[] storage _list,
mapping(address => OptionalValue) storage _indexMap,
address _value
) returns (bool isChanged) {
OptionalValue storage indexItem = _indexMap[_value];
isChanged = indexItem.isSet;
if (isChanged) {
uint256 itemIndex = indexItem.value;
uint256 lastIndex = _list.length - 1;
if (itemIndex != lastIndex) {
address lastValue = _list[lastIndex];
_list[itemIndex] = lastValue;
_indexMap[lastValue].value = itemIndex;
}
_list.pop();
delete _indexMap[_value];
}
}
/**
* @notice Adds or removes a value to/from a unique address value list (a list with value index mapping)
* @dev The list size limit is checked on items adding only
* @param _list The list reference
* @param _indexMap The value index mapping reference
* @param _value The address value
* @param _flag The value inclusion flag
* @param _sizeLimit The list size limit
* @return isChanged True if the list was changed, otherwise false
*/
function uniqueAddressListUpdate(
address[] storage _list,
mapping(address => OptionalValue) storage _indexMap,
address _value,
bool _flag,
uint256 _sizeLimit
) returns (bool isChanged) {
return
_flag
? uniqueAddressListAdd(_list, _indexMap, _value, _sizeLimit)
: uniqueAddressListRemove(_list, _indexMap, _value);
}
// File contracts/roles/RoleBearers.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title RoleBearers
* @notice Base contract that implements role-based access control
* @dev A custom implementation providing full role bearer lists
*/
abstract contract RoleBearers {
mapping(bytes32 /*roleKey*/ => address[] /*roleBearers*/) private roleBearerTable;
mapping(bytes32 /*roleKey*/ => mapping(address /*account*/ => /*DataStructures.*/OptionalValue /*status*/))
private roleBearerIndexTable;
function _setRoleBearer(bytes32 _roleKey, address _account, bool _value) internal {
/*DataStructures.*/uniqueAddressListUpdate(
roleBearerTable[_roleKey],
roleBearerIndexTable[_roleKey],
_account,
_value,
/*Constants.*/LIST_SIZE_LIMIT_DEFAULT
);
}
function _isRoleBearer(bytes32 _roleKey, address _account) internal view returns (bool) {
return roleBearerIndexTable[_roleKey][_account].isSet;
}
function _roleBearerCount(bytes32 _roleKey) internal view returns (uint256) {
return roleBearerTable[_roleKey].length;
}
function _fullRoleBearerList(bytes32 _roleKey) internal view returns (address[] memory) {
return roleBearerTable[_roleKey];
}
}
// File contracts/roles/ManagerRole.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title ManagerRole
* @notice Base contract that implements the Manager role.
* The manager role is a high-permission role for core team members only.
* Managers can set vaults and routers addresses, fees, cross-chain protocols,
* and other parameters for Interchain (cross-chain) swaps and single-network swaps.
* Please note, the manager role is unique for every contract,
* hence different addresses may be assigned as managers for different contracts.
*/
abstract contract ManagerRole is Ownable, RoleBearers {
bytes32 private constant ROLE_KEY = keccak256('Manager');
/**
* @notice Emitted when the Manager role status for the account is updated
* @param account The account address
* @param value The Manager role status flag
*/
event SetManager(address indexed account, bool indexed value);
/**
* @notice Emitted when the Manager role status for the account is renounced
* @param account The account address
*/
event RenounceManagerRole(address indexed account);
/**
* @notice Emitted when the caller is not a Manager role bearer
*/
error OnlyManagerError();
/**
* @dev Modifier to check if the caller is a Manager role bearer
*/
modifier onlyManager() {
if (!isManager(msg.sender)) {
revert OnlyManagerError();
}
_;
}
/**
* @notice Updates the Manager role status for the account
* @param _account The account address
* @param _value The Manager role status flag
*/
function setManager(address _account, bool _value) public onlyOwner {
_setRoleBearer(ROLE_KEY, _account, _value);
emit SetManager(_account, _value);
}
/**
* @notice Renounces the Manager role
*/
function renounceManagerRole() external onlyManager {
_setRoleBearer(ROLE_KEY, msg.sender, false);
emit RenounceManagerRole(msg.sender);
}
/**
* @notice Getter of the Manager role bearer count
* @return The Manager role bearer count
*/
function managerCount() external view returns (uint256) {
return _roleBearerCount(ROLE_KEY);
}
/**
* @notice Getter of the complete list of the Manager role bearers
* @return The complete list of the Manager role bearers
*/
function fullManagerList() external view returns (address[] memory) {
return _fullRoleBearerList(ROLE_KEY);
}
/**
* @notice Getter of the Manager role bearer status
* @param _account The account address
*/
function isManager(address _account) public view returns (bool) {
return _isRoleBearer(ROLE_KEY, _account);
}
function _initRoles(
address _owner,
address[] memory _managers,
bool _addOwnerToManagers
) internal {
address ownerAddress = _owner == address(0) ? msg.sender : _owner;
for (uint256 index; index < _managers.length; index++) {
setManager(_managers[index], true);
}
if (_addOwnerToManagers && !isManager(ownerAddress)) {
setManager(ownerAddress, true);
}
if (ownerAddress != msg.sender) {
transferOwnership(ownerAddress);
}
}
}
// File contracts/mixins/BalanceManagementMixin.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title BalanceManagementMixin
* @notice The balance management mix-in logic
*/
abstract contract BalanceManagementMixin is ManagerRole {
/**
* @notice Emitted when the specified token is reserved
*/
error ReservedTokenError();
/**
* @notice Performs the token cleanup
* @dev Use the "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" address for the native token
* @param _tokenAddress The address of the token
* @param _to The token transfer recipient address
*/
function cleanup(address _tokenAddress, address _to) external virtual onlyManager {
_cleanupWithAmount(_tokenAddress, _to, tokenBalance(_tokenAddress));
}
/**
* @notice Performs the token cleanup using the provided amount
* @dev Use the "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" address for the native token
* @param _tokenAddress The address of the token
* @param _to The token transfer recipient address
* @param _tokenAmount The amount of the token
*/
function cleanupWithAmount(
address _tokenAddress,
address _to,
uint256 _tokenAmount
) external virtual onlyManager {
_cleanupWithAmount(_tokenAddress, _to, _tokenAmount);
}
/**
* @notice Getter of the token balance of the current contract
* @dev Use the "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE" address for the native token
* @param _tokenAddress The address of the token
* @return The token balance of the current contract
*/
function tokenBalance(address _tokenAddress) public view virtual returns (uint256) {
if (_tokenAddress == /*Constants.*/NATIVE_TOKEN_ADDRESS) {
return address(this).balance;
} else {
return ITokenBalance(_tokenAddress).balanceOf(address(this));
}
}
/**
* @notice Getter of the reserved token flag
* @dev Override to add reserved token addresses
* @param _tokenAddress The address of the token
* @return The reserved token flag
*/
function isReservedToken(address _tokenAddress) public view virtual returns (bool) {
// The function returns false by default.
// The explicit return statement is omitted to avoid the unused parameter warning.
// See https://github.com/ethereum/solidity/issues/5295
}
function _cleanupWithAmount(
address _tokenAddress,
address _to,
uint256 _tokenAmount
) internal virtual {
if (isReservedToken(_tokenAddress)) {
revert ReservedTokenError();
}
if (_tokenAddress == /*Constants.*/NATIVE_TOKEN_ADDRESS) {
/*TransferHelper.*/safeTransferNative(_to, _tokenAmount);
} else {
/*TransferHelper.*/safeTransfer(_tokenAddress, _to, _tokenAmount);
}
}
}
// File contracts/Pausable.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title Pausable
* @notice Base contract that implements the emergency pause mechanism
*/
abstract contract PausableContract is Pausable, ManagerRole {
/**
* @notice Enter pause state
*/
function pause() external onlyManager whenNotPaused {
_pause();
}
/**
* @notice Exit pause state
*/
function unpause() external onlyManager whenPaused {
_unpause();
}
}
// File contracts/SystemVersionId.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title SystemVersionId
* @notice Base contract providing the system version identifier
*/
abstract contract SystemVersionId {
/**
* @dev The system version identifier
*/
uint256 public constant SYSTEM_VERSION_ID = uint256(keccak256('Initial'));
}
// File contracts/bridge/chainlink-ccip/core/InterportCCIPBridgeCore.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title InterportCCIPBridgeCore
* @notice The core logic of the cross-chain bridging with Chainlink CCIP
*/
abstract contract InterportCCIPBridgeCore is SystemVersionId, PausableContract, BalanceManagementMixin {
/**
* @notice Chain ID pair structure
* @param standardId The standard EVM chain ID
* @param ccipId The CCIP chain selector
*/
struct ChainIdPair {
uint256 standardId;
uint64 ccipId;
}
/**
* @dev CCIP endpoint address
*/
address public endpoint;
/**
* @dev The correspondence between standard EVM chain IDs and CCIP chain selectors
*/
mapping(uint256 /*standardId*/ => uint64 /*ccipId*/) public standardToCcipChainId;
/**
* @dev The correspondence between CCIP chain selectors and standard EVM chain IDs
*/
mapping(uint64 /*ccipId*/ => uint256 /*standardId*/) public ccipToStandardChainId;
/**
* @notice Emitted when the cross-chain endpoint contract reference is set
* @param endpointAddress The address of the cross-chain endpoint contract
*/
event SetEndpoint(address indexed endpointAddress);
/**
* @notice Emitted when a chain ID pair is added or updated
* @param standardId The standard EVM chain ID
* @param ccipId The CCIP chain selector
*/
event SetChainIdPair(uint256 indexed standardId, uint64 indexed ccipId);
/**
* @notice Emitted when a chain ID pair is removed
* @param standardId The standard EVM chain ID
* @param ccipId The CCIP chain selector
*/
event RemoveChainIdPair(uint256 indexed standardId, uint64 indexed ccipId);
/**
* @notice Emitted when there is no registered CCIP chain selector matching the standard EVM chain ID
*/
error CcipChainIdNotSetError();
/**
* @notice Emitted when the provided call value is not sufficient for the message processing
*/
error SendValueError();
/**
* @notice Emitted when the caller is not the CCIP endpoint
*/
error OnlyEndpointError();
/**
* @dev Modifier to check if the caller is the CCIP endpoint
*/
modifier onlyEndpoint() {
if (msg.sender != endpoint) {
revert OnlyEndpointError();
}
_;
}
/**
* @notice Initializes the contract
* @param _endpointAddress The cross-chain endpoint address
* @param _chainIdPairs The correspondence between standard EVM chain IDs and CCIP chain selectors
* @param _owner The address of the initial owner of the contract
* @param _managers The addresses of initial managers of the contract
* @param _addOwnerToManagers The flag to optionally add the owner to the list of managers
*/
constructor(
address _endpointAddress,
ChainIdPair[] memory _chainIdPairs,
address _owner,
address[] memory _managers,
bool _addOwnerToManagers
) {
_setEndpoint(_endpointAddress);
for (uint256 index; index < _chainIdPairs.length; index++) {
ChainIdPair memory chainIdPair = _chainIdPairs[index];
_setChainIdPair(chainIdPair.standardId, chainIdPair.ccipId);
}
_initRoles(_owner, _managers, _addOwnerToManagers);
}
/**
* @notice The standard "receive" function
* @dev Is payable to allow receiving native token funds
*/
receive() external payable {}
/**
* @notice Sets the cross-chain endpoint contract reference
* @param _endpointAddress The address of the cross-chain endpoint contract
*/
function setEndpoint(address _endpointAddress) external onlyManager {
_setEndpoint(_endpointAddress);
}
/**
* @notice Adds or updates registered chain ID pairs
* @param _chainIdPairs The list of chain ID pairs
*/
function setChainIdPairs(ChainIdPair[] calldata _chainIdPairs) external onlyManager {
for (uint256 index; index < _chainIdPairs.length; index++) {
ChainIdPair calldata chainIdPair = _chainIdPairs[index];
_setChainIdPair(chainIdPair.standardId, chainIdPair.ccipId);
}
}
/**
* @notice Removes registered chain ID pairs
* @param _standardChainIds The list of standard EVM chain IDs
*/
function removeChainIdPairs(uint256[] calldata _standardChainIds) external onlyManager {
for (uint256 index; index < _standardChainIds.length; index++) {
uint256 standardId = _standardChainIds[index];
_removeChainIdPair(standardId);
}
}
function _ccipSend(
uint64 _targetCcipChainId,
Client.EVM2AnyMessage memory _ccipMessage,
uint256 _ccipSendValue
) internal virtual returns (bytes32 ccipMessageId) {
if (msg.value < _ccipSendValue) {
revert SendValueError();
}
return
IRouterClient(endpoint).ccipSend{ value: _ccipSendValue }(
_targetCcipChainId,
_ccipMessage
);
}
function _setEndpoint(address _endpoint) internal virtual {
/*AddressHelper.*/requireContract(_endpoint);
endpoint = _endpoint;
emit SetEndpoint(_endpoint);
}
function _setChainIdPair(uint256 _standardId, uint64 _ccipId) internal virtual {
standardToCcipChainId[_standardId] = _ccipId;
ccipToStandardChainId[_ccipId] = _standardId;
emit SetChainIdPair(_standardId, _ccipId);
}
function _removeChainIdPair(uint256 _standardId) internal virtual {
uint64 ccipId = standardToCcipChainId[_standardId];
delete standardToCcipChainId[_standardId];
delete ccipToStandardChainId[ccipId];
emit RemoveChainIdPair(_standardId, ccipId);
}
function _checkChainId(uint256 _chainId) internal view virtual returns (uint64 ccipChainId) {
ccipChainId = standardToCcipChainId[_chainId];
if (ccipChainId == 0) {
revert CcipChainIdNotSetError();
}
}
function _ccipGetFee(
uint64 _targetCcipChainId,
Client.EVM2AnyMessage memory _ccipMessage
) internal view virtual returns (uint256 fee) {
return IRouterClient(endpoint).getFee(_targetCcipChainId, _ccipMessage);
}
function _createCcipMessage(
address _receiverAddress, // The receiver may be an EOA or a contract
bytes memory _data,
Client.EVMTokenAmount[] memory _tokenAmounts,
uint256 _targetGasLimit
) internal pure virtual returns (Client.EVM2AnyMessage memory) {
return
Client.EVM2AnyMessage({
receiver: abi.encode(_receiverAddress), // ABI-encoded receiver address
data: _data,
tokenAmounts: _tokenAmounts,
extraArgs: Client._argsToBytes(
Client.EVMExtraArgsV1({ gasLimit: _targetGasLimit })
),
feeToken: address(0) // Native token
});
}
}
// File @openzeppelin/contracts/security/ReentrancyGuard.sol@v4.8.1
// Original license: SPDX_License_Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File contracts/bridge/chainlink-ccip/InterportCCIPTokenBridge.sol
// Original license: SPDX_License_Identifier: AGPL-3.0-only
pragma solidity 0.8.19;
/**
* @title InterportCCIPTokenBridge
* @notice The contract bridges ERC-20 tokens with Chainlink CCIP
*/
contract InterportCCIPTokenBridge is InterportCCIPBridgeCore, ReentrancyGuard {
/**
* @notice The "bridgeTokens" action parameters
* @param targetChainId The message target chain ID (EVM)
* @param targetRecipient The address of the recipient on the target chain
* @param tokenAmounts Token amount data
*/
struct TokenBridgeAction {
uint256 targetChainId;
address targetRecipient;
Client.EVMTokenAmount[] tokenAmounts;
}
/**
* @notice Token bridge action source event
* @param targetChainId The ID of the target chain
* @param sourceSender The address of the user on the source chain
* @param targetRecipient The address of the recipient on the target chain
* @param tokenAmounts Token amount data
* @param reserve The reserve amount
* @param ccipMessageId The CCIP message ID
* @param timestamp The timestamp of the action (in seconds)
*/
event TokenBridgeActionSource(
uint256 targetChainId,
address indexed sourceSender,
address targetRecipient,
Client.EVMTokenAmount[] tokenAmounts,
uint256 reserve,
bytes32 indexed ccipMessageId,
uint256 timestamp
);
/**
* @notice Initializes the contract
* @param _endpointAddress The cross-chain endpoint address
* @param _chainIdPairs The correspondence between standard EVM chain IDs and CCIP chain selectors
* @param _owner The address of the initial owner of the contract
* @param _managers The addresses of initial managers of the contract
* @param _addOwnerToManagers The flag to optionally add the owner to the list of managers
*/
constructor(
address _endpointAddress,
ChainIdPair[] memory _chainIdPairs,
address _owner,
address[] memory _managers,
bool _addOwnerToManagers
)
InterportCCIPBridgeCore(
_endpointAddress,
_chainIdPairs,
_owner,
_managers,
_addOwnerToManagers
)
{}
/**
* @notice Cross-chain bridging of ERC-20 tokens
* @param _action The action parameters
* @param _ccipSendValue The CCIP processing value
*/
function bridgeTokens(
TokenBridgeAction calldata _action,
uint256 _ccipSendValue
) external payable whenNotPaused nonReentrant returns (bytes32 ccipMessageId) {
uint64 targetCcipChainId = _checkChainId(_action.targetChainId);
for (uint256 index; index < _action.tokenAmounts.length; index++) {
Client.EVMTokenAmount calldata tokenAmountData = _action.tokenAmounts[index];
/*TransferHelper.*/safeTransferFrom(
tokenAmountData.token,
msg.sender,
address(this),
tokenAmountData.amount
);
/*TransferHelper.*/safeApprove(tokenAmountData.token, endpoint, tokenAmountData.amount);
}
// Create an EVM2AnyMessage struct in memory with necessary information for sending a cross-chain message
Client.EVM2AnyMessage memory ccipMessage = _createCcipMessage(
_action.targetRecipient,
new bytes(0),
_action.tokenAmounts,
0
);
// Send the message
ccipMessageId = _ccipSend(targetCcipChainId, ccipMessage, _ccipSendValue);
for (uint256 index; index < _action.tokenAmounts.length; index++) {
/*TransferHelper.*/safeApprove(_action.tokenAmounts[index].token, endpoint, 0);
}
emit TokenBridgeActionSource(
_action.targetChainId,
msg.sender,
_action.targetRecipient,
_action.tokenAmounts,
msg.value - _ccipSendValue,
ccipMessageId,
block.timestamp
);
}
/**
* @notice Cross-chain message fee estimation
* @param _action The action parameters
* @return Message fee
*/
function messageFee(TokenBridgeAction calldata _action) external view returns (uint256) {
uint64 targetCcipChainId = _checkChainId(_action.targetChainId);
Client.EVM2AnyMessage memory ccipMessage = _createCcipMessage(
_action.targetRecipient,
new bytes(0),
_action.tokenAmounts,
0
);
return _ccipGetFee(targetCcipChainId, ccipMessage);
}
}
{
"compilationTarget": {
"InterportCCIPTokenBridge.sol": "InterportCCIPTokenBridge"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_endpointAddress","type":"address"},{"components":[{"internalType":"uint256","name":"standardId","type":"uint256"},{"internalType":"uint64","name":"ccipId","type":"uint64"}],"internalType":"struct InterportCCIPBridgeCore.ChainIdPair[]","name":"_chainIdPairs","type":"tuple[]"},{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address[]","name":"_managers","type":"address[]"},{"internalType":"bool","name":"_addOwnerToManagers","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CcipChainIdNotSetError","type":"error"},{"inputs":[],"name":"ListSizeLimitError","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"NonContractAddressError","type":"error"},{"inputs":[],"name":"OnlyEndpointError","type":"error"},{"inputs":[],"name":"OnlyManagerError","type":"error"},{"inputs":[],"name":"ReservedTokenError","type":"error"},{"inputs":[],"name":"SafeApproveError","type":"error"},{"inputs":[],"name":"SafeTransferError","type":"error"},{"inputs":[],"name":"SafeTransferFromError","type":"error"},{"inputs":[],"name":"SafeTransferNativeError","type":"error"},{"inputs":[],"name":"SendValueError","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"standardId","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"ccipId","type":"uint64"}],"name":"RemoveChainIdPair","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"RenounceManagerRole","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"standardId","type":"uint256"},{"indexed":true,"internalType":"uint64","name":"ccipId","type":"uint64"}],"name":"SetChainIdPair","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"endpointAddress","type":"address"}],"name":"SetEndpoint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"bool","name":"value","type":"bool"}],"name":"SetManager","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"targetChainId","type":"uint256"},{"indexed":true,"internalType":"address","name":"sourceSender","type":"address"},{"indexed":false,"internalType":"address","name":"targetRecipient","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"indexed":false,"internalType":"struct Client.EVMTokenAmount[]","name":"tokenAmounts","type":"tuple[]"},{"indexed":false,"internalType":"uint256","name":"reserve","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"ccipMessageId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TokenBridgeActionSource","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"SYSTEM_VERSION_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"targetChainId","type":"uint256"},{"internalType":"address","name":"targetRecipient","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Client.EVMTokenAmount[]","name":"tokenAmounts","type":"tuple[]"}],"internalType":"struct InterportCCIPTokenBridge.TokenBridgeAction","name":"_action","type":"tuple"},{"internalType":"uint256","name":"_ccipSendValue","type":"uint256"}],"name":"bridgeTokens","outputs":[{"internalType":"bytes32","name":"ccipMessageId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"ccipToStandardChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_to","type":"address"}],"name":"cleanup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenAmount","type":"uint256"}],"name":"cleanupWithAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"endpoint","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fullManagerList","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"isManager","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"isReservedToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"managerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"targetChainId","type":"uint256"},{"internalType":"address","name":"targetRecipient","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct Client.EVMTokenAmount[]","name":"tokenAmounts","type":"tuple[]"}],"internalType":"struct InterportCCIPTokenBridge.TokenBridgeAction","name":"_action","type":"tuple"}],"name":"messageFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_standardChainIds","type":"uint256[]"}],"name":"removeChainIdPairs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceManagerRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"standardId","type":"uint256"},{"internalType":"uint64","name":"ccipId","type":"uint64"}],"internalType":"struct InterportCCIPBridgeCore.ChainIdPair[]","name":"_chainIdPairs","type":"tuple[]"}],"name":"setChainIdPairs","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_endpointAddress","type":"address"}],"name":"setEndpoint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"bool","name":"_value","type":"bool"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"standardToCcipChainId","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"}],"name":"tokenBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]