编译器
0.8.21+commit.d9974bed
文件 1 的 11:AccessControl.sol
pragma solidity ^0.8.20;
import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}
文件 2 的 11:CanonicalBridge.sol
pragma solidity 0.8.21;
import { AccessControl, IAccessControl } from "openzeppelin-contracts/contracts/access/AccessControl.sol";
import { ReentrancyGuard } from "openzeppelin-contracts/contracts/utils/ReentrancyGuard.sol";
import { Pausable } from "openzeppelin-contracts/contracts/utils/Pausable.sol";
import { ICanonicalBridge } from "./interfaces/ICanonicalBridge.sol";
import { ITreasury } from "./interfaces/ITreasury.sol";
import { ISemVer } from "./interfaces/ISemVer.sol";
contract CanonicalBridge is
ICanonicalBridge,
ISemVer,
AccessControl,
Pausable,
ReentrancyGuard
{
address private constant NULL_ADDRESS = address(0);
bytes32 private constant NULL_BYTES32 = bytes32(0);
bytes private constant NULL_BYTES = "";
uint256 private constant NEVER = type(uint256).max;
uint256 private constant MIN_DEPOSIT_LAMPORTS = 2_000_000;
uint256 private constant WEI_PER_LAMPORT = 1_000_000_000;
uint256 private constant DEFAULT_FRAUD_WINDOW_DURATION = 7 days;
uint256 private constant MIN_FRAUD_WINDOW_DURATION = 1 days;
uint256 private constant PRECISION = 1e18;
uint8 private constant MAJOR_VERSION = 2;
uint8 private constant MINOR_VERSION = 0;
uint8 private constant PATCH_VERSION = 0;
bytes32 public constant override PAUSER_ROLE = keccak256("Pauser");
bytes32 public constant override STARTER_ROLE = keccak256("Starter");
bytes32 public constant override WITHDRAW_AUTHORITY_ROLE = keccak256("WithdrawAuthority");
bytes32 public constant override CLAIM_AUTHORITY_ROLE = keccak256("ClaimAuthority");
bytes32 public constant override WITHDRAW_CANCELLER_ROLE = keccak256("WithdrawCanceller");
bytes32 public constant override FRAUD_WINDOW_SETTER_ROLE = keccak256("FraudWindowSetter");
uint256 public constant override MIN_DEPOSIT = MIN_DEPOSIT_LAMPORTS * WEI_PER_LAMPORT;
address public immutable override TREASURY;
uint256 public override fraudWindowDuration = 7 days;
mapping (bytes32 withdrawMessageHash => uint256 startTime) public override startTime;
mapping (uint64 withdrawMessageId => uint256 blockNumber) public override withdrawMsgIdProcessed;
modifier bytes32Initialized(bytes32 _data) {
if(_data == NULL_BYTES32) revert EmptyBytes32();
_;
}
modifier validDepositAmount(uint256 amountWei) {
if (msg.value != amountWei) revert CanonicalBridgeTransactionRejected(0, "Deposit amount mismatch");
if (msg.value % WEI_PER_LAMPORT != 0) revert CanonicalBridgeTransactionRejected(0, "Fractional value not allowed");
if (msg.value < MIN_DEPOSIT) revert CanonicalBridgeTransactionRejected(0, "Deposit less than minimum");
_;
}
modifier validWithdrawMessage(WithdrawMessage memory message) {
if (message.from == NULL_BYTES32) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "Null message.from");
}
if (message.destination == NULL_ADDRESS) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "Null message.destination");
}
if (message.amountWei == 0) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "message.amountWei is 0");
}
if (message.withdrawId == 0) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "message.withdrawId is 0");
}
if (message.feeWei > message.amountWei) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "message.fee exceeds message.amount");
}
if (message.feeReceiver == NULL_ADDRESS) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "Null fee receiver");
}
_;
}
constructor(address owner, address treasuryAddress) {
_grantRole(DEFAULT_ADMIN_ROLE, owner);
_grantRole(PAUSER_ROLE, owner);
_grantRole(STARTER_ROLE, owner);
_grantRole(WITHDRAW_AUTHORITY_ROLE, owner);
_grantRole(CLAIM_AUTHORITY_ROLE, owner);
_grantRole(WITHDRAW_CANCELLER_ROLE, owner);
_grantRole(FRAUD_WINDOW_SETTER_ROLE, owner);
TREASURY = treasuryAddress;
emit Deployed(msg.sender, owner, treasuryAddress);
_setFraudWindowDuration(DEFAULT_FRAUD_WINDOW_DURATION);
}
function withdrawMessageStatus(
WithdrawMessage calldata message
)
external
view
override
validWithdrawMessage(message)
returns (WithdrawStatus)
{
return withdrawMessageStatus(withdrawMessageHash(message));
}
function withdrawMessageStatus(bytes32 messageHash) public view override returns (WithdrawStatus) {
uint256 startTime_ = startTime[messageHash];
if (startTime_ == 0) return WithdrawStatus.UNKNOWN;
if (startTime_ == NEVER) return WithdrawStatus.CLOSED;
if (startTime_ > block.timestamp) return WithdrawStatus.PROCESSING;
return WithdrawStatus.PENDING;
}
function withdrawMessageHash(WithdrawMessage memory message) public pure override returns (bytes32) {
return keccak256(abi.encode(message));
}
function getVersionComponents() public pure override returns (Version memory) {
return Version(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION);
}
function deposit(bytes32 recipient, uint256 amountWei)
external
payable
virtual
override
whenNotPaused
bytes32Initialized(recipient)
validDepositAmount(amountWei)
nonReentrant
{
bool success;
(success,) = payable(address(TREASURY)).call{value: amountWei}(abi.encodeWithSignature("depositEth()"));
if (!success) revert CanonicalBridgeTransactionRejected(0, "failed to transfer funds to the treasury");
uint256 amountGwei = amountWei / WEI_PER_LAMPORT;
emit Deposited(msg.sender, recipient, amountWei, amountGwei);
}
function authorizeWithdraws(
WithdrawMessage[] calldata messages
)
external
override
whenNotPaused
onlyRole(WITHDRAW_AUTHORITY_ROLE)
{
for (uint256 i = 0; i < messages.length; i++) {
_authorizeWithdraw(messages[i]);
}
}
function authorizeWithdraw(
WithdrawMessage calldata message
)
external
override
whenNotPaused
onlyRole(WITHDRAW_AUTHORITY_ROLE)
{
_authorizeWithdraw(message);
}
function _authorizeWithdraw(
WithdrawMessage memory message
)
private
validWithdrawMessage(message)
{
bytes32 messageHash = withdrawMessageHash(message);
uint256 messageStartTime = block.timestamp + fraudWindowDuration;
if (withdrawMessageStatus(messageHash) != WithdrawStatus.UNKNOWN) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "Message already exists");
}
if (withdrawMsgIdProcessed[message.withdrawId] != 0) {
revert CanonicalBridgeTransactionRejected(message.withdrawId, "Message Id already exists");
}
startTime[messageHash] = messageStartTime;
withdrawMsgIdProcessed[message.withdrawId] = block.number;
bool success = ITreasury(TREASURY).withdrawEth(
message.feeReceiver,
message.feeWei
);
if (!success) revert WithdrawFailed();
emit WithdrawAuthorized(
msg.sender,
message,
messageHash,
messageStartTime
);
}
function claimWithdraw(
WithdrawMessage calldata message
)
external
override
whenNotPaused
nonReentrant
validWithdrawMessage(message)
{
bool authorizedWithdrawer = (msg.sender == message.destination || hasRole(CLAIM_AUTHORITY_ROLE, msg.sender));
if (!authorizedWithdrawer) {
revert IAccessControl.AccessControlUnauthorizedAccount(msg.sender, CLAIM_AUTHORITY_ROLE);
}
bytes32 messageHash = withdrawMessageHash(message);
if (withdrawMessageStatus(messageHash) != WithdrawStatus.PENDING) revert WithdrawUnauthorized();
startTime[messageHash] = NEVER;
emit WithdrawClaimed(message.destination, message.from, messageHash, message);
bool success = ITreasury(TREASURY).withdrawEth(
message.destination,
message.amountWei - message.feeWei
);
if (!success) revert WithdrawFailed();
}
function deleteWithdrawMessage(
WithdrawMessage calldata message
)
external
override
validWithdrawMessage(message)
onlyRole(WITHDRAW_CANCELLER_ROLE)
{
bytes32 messageHash = withdrawMessageHash(message);
WithdrawStatus status = withdrawMessageStatus(messageHash);
if (status != WithdrawStatus.PENDING && status != WithdrawStatus.PROCESSING) {
revert CannotCancel();
}
startTime[messageHash] = 0;
withdrawMsgIdProcessed[message.withdrawId] = 0;
emit WithdrawMessageDeleted(msg.sender, message);
}
function setFraudWindowDuration(uint256 durationSeconds) public onlyRole(FRAUD_WINDOW_SETTER_ROLE) {
if (durationSeconds < MIN_FRAUD_WINDOW_DURATION) revert DurationTooShort();
_setFraudWindowDuration(durationSeconds);
}
function _setFraudWindowDuration(uint256 durationSeconds) internal {
fraudWindowDuration = durationSeconds;
emit FraudWindowSet(msg.sender, durationSeconds);
}
function pause() external virtual onlyRole(PAUSER_ROLE) {
_pause();
}
function unpause() external virtual onlyRole(STARTER_ROLE) {
_unpause();
}
}
文件 3 的 11:Context.sol
pragma solidity ^0.8.20;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 4 的 11:ERC165.sol
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 5 的 11:IAccessControl.sol
pragma solidity ^0.8.20;
interface IAccessControl {
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
error AccessControlBadConfirmation();
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address callerConfirmation) external;
}
文件 6 的 11:ICanonicalBridge.sol
pragma solidity 0.8.21;
interface ICanonicalBridge {
struct DepositMessage {
address sender;
bytes32 recipient;
uint256 amountGwei;
}
struct WithdrawMessage {
bytes32 from;
address destination;
uint256 amountWei;
uint64 withdrawId;
address feeReceiver;
uint256 feeWei;
}
enum WithdrawStatus { UNKNOWN, PROCESSING, PENDING, CLOSED }
event Deployed(address indexed deployer, address owner, address treasuryAddress);
event FraudWindowSet(address indexed sender, uint256 durationSeconds);
event Deposited(
address indexed sender,
bytes32 indexed recipient,
uint256 amountWei,
uint256 amountLamports
);
event WithdrawAuthorized(
address indexed sender,
WithdrawMessage message,
bytes32 indexed messageHash,
uint256 startTime);
event WithdrawClaimed(
address indexed receiver,
bytes32 indexed remoteSender,
bytes32 indexed messageHash,
WithdrawMessage message
);
event WithdrawMessageDeleted(address authority, WithdrawMessage message);
event WithdrawMessageHashDeleted(address indexed authority, bytes32 indexed messageHash);
event WithdrawCancelled(address indexed sender, bytes32 indexed messageHash);
error CanonicalBridgeTransactionRejected(uint64 withdrawId, string reason);
error DurationTooShort();
error WithdrawFailed();
error WithdrawUnauthorized();
error CannotCancel();
error EmptyBytes32();
function PAUSER_ROLE() external view returns (bytes32);
function STARTER_ROLE() external view returns (bytes32);
function WITHDRAW_AUTHORITY_ROLE() external view returns (bytes32);
function CLAIM_AUTHORITY_ROLE() external view returns (bytes32);
function WITHDRAW_CANCELLER_ROLE() external view returns (bytes32);
function FRAUD_WINDOW_SETTER_ROLE() external view returns (bytes32);
function MIN_DEPOSIT() external view returns (uint256);
function TREASURY() external view returns (address);
function fraudWindowDuration() external view returns (uint256);
function startTime(bytes32 withdrawMessageHash) external view returns (uint256);
function withdrawMessageStatus(WithdrawMessage calldata message) external view returns (WithdrawStatus);
function withdrawMessageStatus(bytes32 messageHash) external view returns (WithdrawStatus);
function setFraudWindowDuration(uint256 durationSeconds) external;
function deposit(bytes32 recipient, uint256 amountWei) external payable;
function authorizeWithdraws(WithdrawMessage[] calldata messages) external;
function authorizeWithdraw(WithdrawMessage calldata message) external;
function claimWithdraw(WithdrawMessage calldata message) external;
function deleteWithdrawMessage(WithdrawMessage calldata message) external;
function withdrawMessageHash(WithdrawMessage calldata message) external pure returns (bytes32);
function withdrawMsgIdProcessed(uint64 withdrawMsgId) external view returns (uint256);
}
文件 7 的 11:IERC165.sol
pragma solidity ^0.8.20;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 8 的 11:ISemVer.sol
pragma solidity 0.8.21;
interface ISemVer {
struct Version {
uint8 major;
uint8 minor;
uint8 patch;
}
function getVersionComponents() external pure returns (Version memory);
}
文件 9 的 11:ITreasury.sol
pragma solidity 0.8.21;
interface ITreasury {
event TreasuryReinitialized(address admin, address oldOwner);
event TreasuryDeposit(address indexed from, uint256 amountWei);
event TreasuryWithdraw(
address authority,
address indexed to,
uint256 amountWei
);
event EmergencyTreasuryWithdraw(address indexed to, uint256 amountWei);
error TreasuryTransferFailed();
error InsufficientFunds();
error ZeroAddress();
function DEPOSITOR_ROLE() external view returns (bytes32);
function WITHDRAW_AUTHORITY_ROLE() external view returns (bytes32);
function PAUSER_ROLE() external view returns (bytes32);
function STARTER_ROLE() external view returns (bytes32);
function UPGRADER_ROLE() external view returns (bytes32);
function EMERGENCY_ROLE() external view returns (bytes32);
function reinitialize() external;
function depositEth() external payable;
function withdrawEth(
address to,
uint256 amountWei
) external returns (bool success);
function pause() external;
function unpause() external;
function emergencyWithdraw(uint256 amountWei) external;
}
文件 10 的 11:Pausable.sol
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
abstract contract Pausable is Context {
bool private _paused;
event Paused(address account);
event Unpaused(address account);
error EnforcedPause();
error ExpectedPause();
constructor() {
_paused = false;
}
modifier whenNotPaused() {
_requireNotPaused();
_;
}
modifier whenPaused() {
_requirePaused();
_;
}
function paused() public view virtual returns (bool) {
return _paused;
}
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 11 的 11:ReentrancyGuard.sol
pragma solidity ^0.8.20;
abstract contract ReentrancyGuard {
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
_status = ENTERED;
}
function _nonReentrantAfter() private {
_status = NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
{
"compilationTarget": {
"src/v1/CanonicalBridge.sol": "CanonicalBridge"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 1000
},
"remappings": [
":@openzeppelin-upgradeable/=lib/@penzeppelin-contracts-upgradeable/contracts/",
":@openzeppelin/=lib/openzeppelin-contracts/contracts/",
":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
":solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"lib/forge-std:ds-test/=lib/forge-std/lib/ds-test/src/",
"lib/openzeppelin-contracts-upgradeable:@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"lib/openzeppelin-contracts-upgradeable:@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/",
"lib/openzeppelin-contracts-upgradeable:ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"lib/openzeppelin-contracts-upgradeable:erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"lib/openzeppelin-contracts-upgradeable:forge-std/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/src/",
"lib/openzeppelin-contracts-upgradeable:openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
"lib/openzeppelin-contracts:@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"lib/openzeppelin-contracts:ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
"lib/openzeppelin-contracts:erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
"lib/openzeppelin-contracts:forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/"
],
"viaIR": true
}
[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"treasuryAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"CannotCancel","type":"error"},{"inputs":[{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"string","name":"reason","type":"string"}],"name":"CanonicalBridgeTransactionRejected","type":"error"},{"inputs":[],"name":"DurationTooShort","type":"error"},{"inputs":[],"name":"EmptyBytes32","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"WithdrawFailed","type":"error"},{"inputs":[],"name":"WithdrawUnauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"treasuryAddress","type":"address"}],"name":"Deployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"bytes32","name":"recipient","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"amountWei","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountLamports","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"durationSeconds","type":"uint256"}],"name":"FraudWindowSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"indexed":false,"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"},{"indexed":true,"internalType":"bytes32","name":"messageHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"startTime","type":"uint256"}],"name":"WithdrawAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"bytes32","name":"messageHash","type":"bytes32"}],"name":"WithdrawCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"bytes32","name":"remoteSender","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"messageHash","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"indexed":false,"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"WithdrawClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"authority","type":"address"},{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"indexed":false,"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"WithdrawMessageDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"authority","type":"address"},{"indexed":true,"internalType":"bytes32","name":"messageHash","type":"bytes32"}],"name":"WithdrawMessageHashDeleted","type":"event"},{"inputs":[],"name":"CLAIM_AUTHORITY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FRAUD_WINDOW_SETTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_DEPOSIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STARTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TREASURY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_AUTHORITY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WITHDRAW_CANCELLER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"authorizeWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"internalType":"struct ICanonicalBridge.WithdrawMessage[]","name":"messages","type":"tuple[]"}],"name":"authorizeWithdraws","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"claimWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"deleteWithdrawMessage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"recipient","type":"bytes32"},{"internalType":"uint256","name":"amountWei","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"fraudWindowDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersionComponents","outputs":[{"components":[{"internalType":"uint8","name":"major","type":"uint8"},{"internalType":"uint8","name":"minor","type":"uint8"},{"internalType":"uint8","name":"patch","type":"uint8"}],"internalType":"struct ISemVer.Version","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"durationSeconds","type":"uint256"}],"name":"setFraudWindowDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"withdrawMessageHash","type":"bytes32"}],"name":"startTime","outputs":[{"internalType":"uint256","name":"startTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"withdrawMessageHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"messageHash","type":"bytes32"}],"name":"withdrawMessageStatus","outputs":[{"internalType":"enum ICanonicalBridge.WithdrawStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"from","type":"bytes32"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"amountWei","type":"uint256"},{"internalType":"uint64","name":"withdrawId","type":"uint64"},{"internalType":"address","name":"feeReceiver","type":"address"},{"internalType":"uint256","name":"feeWei","type":"uint256"}],"internalType":"struct ICanonicalBridge.WithdrawMessage","name":"message","type":"tuple"}],"name":"withdrawMessageStatus","outputs":[{"internalType":"enum ICanonicalBridge.WithdrawStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"withdrawMessageId","type":"uint64"}],"name":"withdrawMsgIdProcessed","outputs":[{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"stateMutability":"view","type":"function"}]