From bdb2742e7eb8fecbc9d3134cbbb0f672166094d3 Mon Sep 17 00:00:00 2001 From: Daniel Wasserman Date: Wed, 9 Oct 2024 16:24:59 -0500 Subject: [PATCH] Feat: overwrite existing fastbridge abi with multicall version --- .../fastbridge/bridgestatus_string.go | 2 +- services/rfq/contracts/fastbridge/events.go | 5 +- .../contracts/fastbridge/eventtype_string.go | 2 +- .../rfq/contracts/fastbridge/export_test.go | 2 +- .../contracts/fastbridge/fastbridge.abigen.go | 12220 ---------------- .../fastbridge/fastbridge.contractinfo.json | 1 - .../fastbridge/fastbridge.metadata.go | 25 - .../fastbridgemulti.abigen.go | 0 .../fastbridgemulti.contractinfo.json | 0 .../fastbridgemulti.metadata.go | 0 services/rfq/contracts/fastbridge/generate.go | 4 +- services/rfq/contracts/fastbridge/helper.go | 2 +- services/rfq/contracts/fastbridge/parser.go | 3 +- services/rfq/contracts/fastbridge/status.go | 2 +- .../rfq/contracts/fastbridge/status_test.go | 11 +- .../fastbridgemulti/bridgestatus_string.go | 27 - .../rfq/contracts/fastbridgemulti/events.go | 82 - .../fastbridgemulti/eventtype_string.go | 28 - .../contracts/fastbridgemulti/export_test.go | 6 - .../rfq/contracts/fastbridgemulti/generate.go | 3 - .../rfq/contracts/fastbridgemulti/helper.go | 35 - .../rfq/contracts/fastbridgemulti/parser.go | 98 - .../rfq/contracts/fastbridgemulti/status.go | 39 - .../contracts/fastbridgemulti/status_test.go | 49 - 24 files changed, 18 insertions(+), 12628 deletions(-) delete mode 100644 services/rfq/contracts/fastbridge/fastbridge.abigen.go delete mode 100644 services/rfq/contracts/fastbridge/fastbridge.contractinfo.json delete mode 100644 services/rfq/contracts/fastbridge/fastbridge.metadata.go rename services/rfq/contracts/{fastbridgemulti => fastbridge}/fastbridgemulti.abigen.go (100%) rename services/rfq/contracts/{fastbridgemulti => fastbridge}/fastbridgemulti.contractinfo.json (100%) rename services/rfq/contracts/{fastbridgemulti => fastbridge}/fastbridgemulti.metadata.go (100%) delete mode 100644 services/rfq/contracts/fastbridgemulti/bridgestatus_string.go delete mode 100644 services/rfq/contracts/fastbridgemulti/events.go delete mode 100644 services/rfq/contracts/fastbridgemulti/eventtype_string.go delete mode 100644 services/rfq/contracts/fastbridgemulti/export_test.go delete mode 100644 services/rfq/contracts/fastbridgemulti/generate.go delete mode 100644 services/rfq/contracts/fastbridgemulti/helper.go delete mode 100644 services/rfq/contracts/fastbridgemulti/parser.go delete mode 100644 services/rfq/contracts/fastbridgemulti/status.go delete mode 100644 services/rfq/contracts/fastbridgemulti/status_test.go diff --git a/services/rfq/contracts/fastbridge/bridgestatus_string.go b/services/rfq/contracts/fastbridge/bridgestatus_string.go index 3c56c4729f..f9ddbd0998 100644 --- a/services/rfq/contracts/fastbridge/bridgestatus_string.go +++ b/services/rfq/contracts/fastbridge/bridgestatus_string.go @@ -1,6 +1,6 @@ // Code generated by "stringer -type=BridgeStatus -linecomment"; DO NOT EDIT. -package fastbridge +package fastbridgemulti import "strconv" diff --git a/services/rfq/contracts/fastbridge/events.go b/services/rfq/contracts/fastbridge/events.go index d1e9bef16e..6a2d840493 100644 --- a/services/rfq/contracts/fastbridge/events.go +++ b/services/rfq/contracts/fastbridge/events.go @@ -1,10 +1,11 @@ -package fastbridge +package fastbridgemulti import ( "bytes" + "strings" + "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/common" - "strings" ) // TODO: consider not exporting to avoid accidental mutation. diff --git a/services/rfq/contracts/fastbridge/eventtype_string.go b/services/rfq/contracts/fastbridge/eventtype_string.go index 10e419b234..e3462b77c7 100644 --- a/services/rfq/contracts/fastbridge/eventtype_string.go +++ b/services/rfq/contracts/fastbridge/eventtype_string.go @@ -1,6 +1,6 @@ // Code generated by "stringer -type=EventType"; DO NOT EDIT. -package fastbridge +package fastbridgemulti import "strconv" diff --git a/services/rfq/contracts/fastbridge/export_test.go b/services/rfq/contracts/fastbridge/export_test.go index 441ab824be..4162525149 100644 --- a/services/rfq/contracts/fastbridge/export_test.go +++ b/services/rfq/contracts/fastbridge/export_test.go @@ -1,4 +1,4 @@ -package fastbridge +package fastbridgemulti // GetAllBridgeStatuses exports all bridge statuses for testing. func GetAllBridgeStatuses() []BridgeStatus { diff --git a/services/rfq/contracts/fastbridge/fastbridge.abigen.go b/services/rfq/contracts/fastbridge/fastbridge.abigen.go deleted file mode 100644 index 4a27b094ce..0000000000 --- a/services/rfq/contracts/fastbridge/fastbridge.abigen.go +++ /dev/null @@ -1,12220 +0,0 @@ -// Code generated - DO NOT EDIT. -// This file is a generated binding and any manual changes will be lost. - -package fastbridge - -import ( - "errors" - "math/big" - "strings" - - ethereum "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" - "github.com/ethereum/go-ethereum/event" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = errors.New - _ = big.NewInt - _ = strings.NewReader - _ = ethereum.NotFound - _ = bind.Bind - _ = common.Big1 - _ = types.BloomLookup - _ = event.NewSubscription - _ = abi.ConvertType -) - -// IFastBridgeBridgeParams is an auto generated low-level Go binding around an user-defined struct. -type IFastBridgeBridgeParams struct { - DstChainId uint32 - Sender common.Address - To common.Address - OriginToken common.Address - DestToken common.Address - OriginAmount *big.Int - DestAmount *big.Int - SendChainGas bool - Deadline *big.Int -} - -// IFastBridgeBridgeTransaction is an auto generated low-level Go binding around an user-defined struct. -type IFastBridgeBridgeTransaction struct { - OriginChainId uint32 - DestChainId uint32 - OriginSender common.Address - DestRecipient common.Address - OriginToken common.Address - DestToken common.Address - OriginAmount *big.Int - DestAmount *big.Int - OriginFeeAmount *big.Int - SendChainGas bool - Deadline *big.Int - Nonce *big.Int -} - -// AccessControlMetaData contains all meta data concerning the AccessControl contract. -var AccessControlMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"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\":[{\"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\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "a217fddf": "DEFAULT_ADMIN_ROLE()", - "248a9ca3": "getRoleAdmin(bytes32)", - "2f2ff15d": "grantRole(bytes32,address)", - "91d14854": "hasRole(bytes32,address)", - "36568abe": "renounceRole(bytes32,address)", - "d547741f": "revokeRole(bytes32,address)", - "01ffc9a7": "supportsInterface(bytes4)", - }, -} - -// AccessControlABI is the input ABI used to generate the binding from. -// Deprecated: Use AccessControlMetaData.ABI instead. -var AccessControlABI = AccessControlMetaData.ABI - -// Deprecated: Use AccessControlMetaData.Sigs instead. -// AccessControlFuncSigs maps the 4-byte function signature to its string representation. -var AccessControlFuncSigs = AccessControlMetaData.Sigs - -// AccessControl is an auto generated Go binding around an Ethereum contract. -type AccessControl struct { - AccessControlCaller // Read-only binding to the contract - AccessControlTransactor // Write-only binding to the contract - AccessControlFilterer // Log filterer for contract events -} - -// AccessControlCaller is an auto generated read-only Go binding around an Ethereum contract. -type AccessControlCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AccessControlTransactor is an auto generated write-only Go binding around an Ethereum contract. -type AccessControlTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AccessControlFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type AccessControlFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AccessControlSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type AccessControlSession struct { - Contract *AccessControl // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AccessControlCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type AccessControlCallerSession struct { - Contract *AccessControlCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// AccessControlTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type AccessControlTransactorSession struct { - Contract *AccessControlTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AccessControlRaw is an auto generated low-level Go binding around an Ethereum contract. -type AccessControlRaw struct { - Contract *AccessControl // Generic contract binding to access the raw methods on -} - -// AccessControlCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type AccessControlCallerRaw struct { - Contract *AccessControlCaller // Generic read-only contract binding to access the raw methods on -} - -// AccessControlTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type AccessControlTransactorRaw struct { - Contract *AccessControlTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewAccessControl creates a new instance of AccessControl, bound to a specific deployed contract. -func NewAccessControl(address common.Address, backend bind.ContractBackend) (*AccessControl, error) { - contract, err := bindAccessControl(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &AccessControl{AccessControlCaller: AccessControlCaller{contract: contract}, AccessControlTransactor: AccessControlTransactor{contract: contract}, AccessControlFilterer: AccessControlFilterer{contract: contract}}, nil -} - -// NewAccessControlCaller creates a new read-only instance of AccessControl, bound to a specific deployed contract. -func NewAccessControlCaller(address common.Address, caller bind.ContractCaller) (*AccessControlCaller, error) { - contract, err := bindAccessControl(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &AccessControlCaller{contract: contract}, nil -} - -// NewAccessControlTransactor creates a new write-only instance of AccessControl, bound to a specific deployed contract. -func NewAccessControlTransactor(address common.Address, transactor bind.ContractTransactor) (*AccessControlTransactor, error) { - contract, err := bindAccessControl(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &AccessControlTransactor{contract: contract}, nil -} - -// NewAccessControlFilterer creates a new log filterer instance of AccessControl, bound to a specific deployed contract. -func NewAccessControlFilterer(address common.Address, filterer bind.ContractFilterer) (*AccessControlFilterer, error) { - contract, err := bindAccessControl(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &AccessControlFilterer{contract: contract}, nil -} - -// bindAccessControl binds a generic wrapper to an already deployed contract. -func bindAccessControl(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := AccessControlMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_AccessControl *AccessControlRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _AccessControl.Contract.AccessControlCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_AccessControl *AccessControlRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _AccessControl.Contract.AccessControlTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_AccessControl *AccessControlRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _AccessControl.Contract.AccessControlTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_AccessControl *AccessControlCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _AccessControl.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_AccessControl *AccessControlTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _AccessControl.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_AccessControl *AccessControlTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _AccessControl.Contract.contract.Transact(opts, method, params...) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_AccessControl *AccessControlCaller) DEFAULTADMINROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _AccessControl.contract.Call(opts, &out, "DEFAULT_ADMIN_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_AccessControl *AccessControlSession) DEFAULTADMINROLE() ([32]byte, error) { - return _AccessControl.Contract.DEFAULTADMINROLE(&_AccessControl.CallOpts) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_AccessControl *AccessControlCallerSession) DEFAULTADMINROLE() ([32]byte, error) { - return _AccessControl.Contract.DEFAULTADMINROLE(&_AccessControl.CallOpts) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_AccessControl *AccessControlCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _AccessControl.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_AccessControl *AccessControlSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _AccessControl.Contract.GetRoleAdmin(&_AccessControl.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_AccessControl *AccessControlCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _AccessControl.Contract.GetRoleAdmin(&_AccessControl.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_AccessControl *AccessControlCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _AccessControl.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_AccessControl *AccessControlSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _AccessControl.Contract.HasRole(&_AccessControl.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_AccessControl *AccessControlCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _AccessControl.Contract.HasRole(&_AccessControl.CallOpts, role, account) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_AccessControl *AccessControlCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _AccessControl.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_AccessControl *AccessControlSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _AccessControl.Contract.SupportsInterface(&_AccessControl.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_AccessControl *AccessControlCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _AccessControl.Contract.SupportsInterface(&_AccessControl.CallOpts, interfaceId) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_AccessControl *AccessControlTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControl.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_AccessControl *AccessControlSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControl.Contract.GrantRole(&_AccessControl.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_AccessControl *AccessControlTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControl.Contract.GrantRole(&_AccessControl.TransactOpts, role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_AccessControl *AccessControlTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _AccessControl.contract.Transact(opts, "renounceRole", role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_AccessControl *AccessControlSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _AccessControl.Contract.RenounceRole(&_AccessControl.TransactOpts, role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_AccessControl *AccessControlTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _AccessControl.Contract.RenounceRole(&_AccessControl.TransactOpts, role, callerConfirmation) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_AccessControl *AccessControlTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControl.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_AccessControl *AccessControlSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControl.Contract.RevokeRole(&_AccessControl.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_AccessControl *AccessControlTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControl.Contract.RevokeRole(&_AccessControl.TransactOpts, role, account) -} - -// AccessControlRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the AccessControl contract. -type AccessControlRoleAdminChangedIterator struct { - Event *AccessControlRoleAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AccessControlRoleAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AccessControlRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AccessControlRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AccessControlRoleAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AccessControlRoleAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AccessControlRoleAdminChanged represents a RoleAdminChanged event raised by the AccessControl contract. -type AccessControlRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_AccessControl *AccessControlFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*AccessControlRoleAdminChangedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _AccessControl.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return &AccessControlRoleAdminChangedIterator{contract: _AccessControl.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil -} - -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_AccessControl *AccessControlFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *AccessControlRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _AccessControl.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AccessControlRoleAdminChanged) - if err := _AccessControl.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_AccessControl *AccessControlFilterer) ParseRoleAdminChanged(log types.Log) (*AccessControlRoleAdminChanged, error) { - event := new(AccessControlRoleAdminChanged) - if err := _AccessControl.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AccessControlRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the AccessControl contract. -type AccessControlRoleGrantedIterator struct { - Event *AccessControlRoleGranted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AccessControlRoleGrantedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AccessControlRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AccessControlRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AccessControlRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AccessControlRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AccessControlRoleGranted represents a RoleGranted event raised by the AccessControl contract. -type AccessControlRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControl *AccessControlFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AccessControlRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControl.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &AccessControlRoleGrantedIterator{contract: _AccessControl.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControl *AccessControlFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *AccessControlRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControl.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AccessControlRoleGranted) - if err := _AccessControl.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControl *AccessControlFilterer) ParseRoleGranted(log types.Log) (*AccessControlRoleGranted, error) { - event := new(AccessControlRoleGranted) - if err := _AccessControl.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AccessControlRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the AccessControl contract. -type AccessControlRoleRevokedIterator struct { - Event *AccessControlRoleRevoked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AccessControlRoleRevokedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AccessControlRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AccessControlRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AccessControlRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AccessControlRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AccessControlRoleRevoked represents a RoleRevoked event raised by the AccessControl contract. -type AccessControlRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControl *AccessControlFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AccessControlRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControl.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &AccessControlRoleRevokedIterator{contract: _AccessControl.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControl *AccessControlFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *AccessControlRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControl.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AccessControlRoleRevoked) - if err := _AccessControl.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControl *AccessControlFilterer) ParseRoleRevoked(log types.Log) (*AccessControlRoleRevoked, error) { - event := new(AccessControlRoleRevoked) - if err := _AccessControl.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AccessControlEnumerableMetaData contains all meta data concerning the AccessControlEnumerable contract. -var AccessControlEnumerableMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":[{\"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\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "a217fddf": "DEFAULT_ADMIN_ROLE()", - "248a9ca3": "getRoleAdmin(bytes32)", - "9010d07c": "getRoleMember(bytes32,uint256)", - "ca15c873": "getRoleMemberCount(bytes32)", - "2f2ff15d": "grantRole(bytes32,address)", - "91d14854": "hasRole(bytes32,address)", - "36568abe": "renounceRole(bytes32,address)", - "d547741f": "revokeRole(bytes32,address)", - "01ffc9a7": "supportsInterface(bytes4)", - }, -} - -// AccessControlEnumerableABI is the input ABI used to generate the binding from. -// Deprecated: Use AccessControlEnumerableMetaData.ABI instead. -var AccessControlEnumerableABI = AccessControlEnumerableMetaData.ABI - -// Deprecated: Use AccessControlEnumerableMetaData.Sigs instead. -// AccessControlEnumerableFuncSigs maps the 4-byte function signature to its string representation. -var AccessControlEnumerableFuncSigs = AccessControlEnumerableMetaData.Sigs - -// AccessControlEnumerable is an auto generated Go binding around an Ethereum contract. -type AccessControlEnumerable struct { - AccessControlEnumerableCaller // Read-only binding to the contract - AccessControlEnumerableTransactor // Write-only binding to the contract - AccessControlEnumerableFilterer // Log filterer for contract events -} - -// AccessControlEnumerableCaller is an auto generated read-only Go binding around an Ethereum contract. -type AccessControlEnumerableCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AccessControlEnumerableTransactor is an auto generated write-only Go binding around an Ethereum contract. -type AccessControlEnumerableTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AccessControlEnumerableFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type AccessControlEnumerableFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AccessControlEnumerableSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type AccessControlEnumerableSession struct { - Contract *AccessControlEnumerable // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AccessControlEnumerableCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type AccessControlEnumerableCallerSession struct { - Contract *AccessControlEnumerableCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// AccessControlEnumerableTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type AccessControlEnumerableTransactorSession struct { - Contract *AccessControlEnumerableTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AccessControlEnumerableRaw is an auto generated low-level Go binding around an Ethereum contract. -type AccessControlEnumerableRaw struct { - Contract *AccessControlEnumerable // Generic contract binding to access the raw methods on -} - -// AccessControlEnumerableCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type AccessControlEnumerableCallerRaw struct { - Contract *AccessControlEnumerableCaller // Generic read-only contract binding to access the raw methods on -} - -// AccessControlEnumerableTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type AccessControlEnumerableTransactorRaw struct { - Contract *AccessControlEnumerableTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewAccessControlEnumerable creates a new instance of AccessControlEnumerable, bound to a specific deployed contract. -func NewAccessControlEnumerable(address common.Address, backend bind.ContractBackend) (*AccessControlEnumerable, error) { - contract, err := bindAccessControlEnumerable(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &AccessControlEnumerable{AccessControlEnumerableCaller: AccessControlEnumerableCaller{contract: contract}, AccessControlEnumerableTransactor: AccessControlEnumerableTransactor{contract: contract}, AccessControlEnumerableFilterer: AccessControlEnumerableFilterer{contract: contract}}, nil -} - -// NewAccessControlEnumerableCaller creates a new read-only instance of AccessControlEnumerable, bound to a specific deployed contract. -func NewAccessControlEnumerableCaller(address common.Address, caller bind.ContractCaller) (*AccessControlEnumerableCaller, error) { - contract, err := bindAccessControlEnumerable(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &AccessControlEnumerableCaller{contract: contract}, nil -} - -// NewAccessControlEnumerableTransactor creates a new write-only instance of AccessControlEnumerable, bound to a specific deployed contract. -func NewAccessControlEnumerableTransactor(address common.Address, transactor bind.ContractTransactor) (*AccessControlEnumerableTransactor, error) { - contract, err := bindAccessControlEnumerable(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &AccessControlEnumerableTransactor{contract: contract}, nil -} - -// NewAccessControlEnumerableFilterer creates a new log filterer instance of AccessControlEnumerable, bound to a specific deployed contract. -func NewAccessControlEnumerableFilterer(address common.Address, filterer bind.ContractFilterer) (*AccessControlEnumerableFilterer, error) { - contract, err := bindAccessControlEnumerable(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &AccessControlEnumerableFilterer{contract: contract}, nil -} - -// bindAccessControlEnumerable binds a generic wrapper to an already deployed contract. -func bindAccessControlEnumerable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := AccessControlEnumerableMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_AccessControlEnumerable *AccessControlEnumerableRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _AccessControlEnumerable.Contract.AccessControlEnumerableCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_AccessControlEnumerable *AccessControlEnumerableRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.AccessControlEnumerableTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_AccessControlEnumerable *AccessControlEnumerableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.AccessControlEnumerableTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_AccessControlEnumerable *AccessControlEnumerableCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _AccessControlEnumerable.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_AccessControlEnumerable *AccessControlEnumerableTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_AccessControlEnumerable *AccessControlEnumerableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.contract.Transact(opts, method, params...) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_AccessControlEnumerable *AccessControlEnumerableCaller) DEFAULTADMINROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _AccessControlEnumerable.contract.Call(opts, &out, "DEFAULT_ADMIN_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_AccessControlEnumerable *AccessControlEnumerableSession) DEFAULTADMINROLE() ([32]byte, error) { - return _AccessControlEnumerable.Contract.DEFAULTADMINROLE(&_AccessControlEnumerable.CallOpts) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_AccessControlEnumerable *AccessControlEnumerableCallerSession) DEFAULTADMINROLE() ([32]byte, error) { - return _AccessControlEnumerable.Contract.DEFAULTADMINROLE(&_AccessControlEnumerable.CallOpts) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_AccessControlEnumerable *AccessControlEnumerableCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _AccessControlEnumerable.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_AccessControlEnumerable *AccessControlEnumerableSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _AccessControlEnumerable.Contract.GetRoleAdmin(&_AccessControlEnumerable.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_AccessControlEnumerable *AccessControlEnumerableCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _AccessControlEnumerable.Contract.GetRoleAdmin(&_AccessControlEnumerable.CallOpts, role) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_AccessControlEnumerable *AccessControlEnumerableCaller) GetRoleMember(opts *bind.CallOpts, role [32]byte, index *big.Int) (common.Address, error) { - var out []interface{} - err := _AccessControlEnumerable.contract.Call(opts, &out, "getRoleMember", role, index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_AccessControlEnumerable *AccessControlEnumerableSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _AccessControlEnumerable.Contract.GetRoleMember(&_AccessControlEnumerable.CallOpts, role, index) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_AccessControlEnumerable *AccessControlEnumerableCallerSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _AccessControlEnumerable.Contract.GetRoleMember(&_AccessControlEnumerable.CallOpts, role, index) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_AccessControlEnumerable *AccessControlEnumerableCaller) GetRoleMemberCount(opts *bind.CallOpts, role [32]byte) (*big.Int, error) { - var out []interface{} - err := _AccessControlEnumerable.contract.Call(opts, &out, "getRoleMemberCount", role) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_AccessControlEnumerable *AccessControlEnumerableSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _AccessControlEnumerable.Contract.GetRoleMemberCount(&_AccessControlEnumerable.CallOpts, role) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_AccessControlEnumerable *AccessControlEnumerableCallerSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _AccessControlEnumerable.Contract.GetRoleMemberCount(&_AccessControlEnumerable.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_AccessControlEnumerable *AccessControlEnumerableCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _AccessControlEnumerable.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_AccessControlEnumerable *AccessControlEnumerableSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _AccessControlEnumerable.Contract.HasRole(&_AccessControlEnumerable.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_AccessControlEnumerable *AccessControlEnumerableCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _AccessControlEnumerable.Contract.HasRole(&_AccessControlEnumerable.CallOpts, role, account) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_AccessControlEnumerable *AccessControlEnumerableCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _AccessControlEnumerable.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_AccessControlEnumerable *AccessControlEnumerableSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _AccessControlEnumerable.Contract.SupportsInterface(&_AccessControlEnumerable.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_AccessControlEnumerable *AccessControlEnumerableCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _AccessControlEnumerable.Contract.SupportsInterface(&_AccessControlEnumerable.CallOpts, interfaceId) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_AccessControlEnumerable *AccessControlEnumerableTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_AccessControlEnumerable *AccessControlEnumerableSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.GrantRole(&_AccessControlEnumerable.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_AccessControlEnumerable *AccessControlEnumerableTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.GrantRole(&_AccessControlEnumerable.TransactOpts, role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_AccessControlEnumerable *AccessControlEnumerableTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.contract.Transact(opts, "renounceRole", role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_AccessControlEnumerable *AccessControlEnumerableSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.RenounceRole(&_AccessControlEnumerable.TransactOpts, role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_AccessControlEnumerable *AccessControlEnumerableTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.RenounceRole(&_AccessControlEnumerable.TransactOpts, role, callerConfirmation) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_AccessControlEnumerable *AccessControlEnumerableTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_AccessControlEnumerable *AccessControlEnumerableSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.RevokeRole(&_AccessControlEnumerable.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_AccessControlEnumerable *AccessControlEnumerableTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _AccessControlEnumerable.Contract.RevokeRole(&_AccessControlEnumerable.TransactOpts, role, account) -} - -// AccessControlEnumerableRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the AccessControlEnumerable contract. -type AccessControlEnumerableRoleAdminChangedIterator struct { - Event *AccessControlEnumerableRoleAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AccessControlEnumerableRoleAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AccessControlEnumerableRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AccessControlEnumerableRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AccessControlEnumerableRoleAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AccessControlEnumerableRoleAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AccessControlEnumerableRoleAdminChanged represents a RoleAdminChanged event raised by the AccessControlEnumerable contract. -type AccessControlEnumerableRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*AccessControlEnumerableRoleAdminChangedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _AccessControlEnumerable.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return &AccessControlEnumerableRoleAdminChangedIterator{contract: _AccessControlEnumerable.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil -} - -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *AccessControlEnumerableRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _AccessControlEnumerable.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AccessControlEnumerableRoleAdminChanged) - if err := _AccessControlEnumerable.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) ParseRoleAdminChanged(log types.Log) (*AccessControlEnumerableRoleAdminChanged, error) { - event := new(AccessControlEnumerableRoleAdminChanged) - if err := _AccessControlEnumerable.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AccessControlEnumerableRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the AccessControlEnumerable contract. -type AccessControlEnumerableRoleGrantedIterator struct { - Event *AccessControlEnumerableRoleGranted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AccessControlEnumerableRoleGrantedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AccessControlEnumerableRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AccessControlEnumerableRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AccessControlEnumerableRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AccessControlEnumerableRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AccessControlEnumerableRoleGranted represents a RoleGranted event raised by the AccessControlEnumerable contract. -type AccessControlEnumerableRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AccessControlEnumerableRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControlEnumerable.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &AccessControlEnumerableRoleGrantedIterator{contract: _AccessControlEnumerable.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *AccessControlEnumerableRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControlEnumerable.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AccessControlEnumerableRoleGranted) - if err := _AccessControlEnumerable.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) ParseRoleGranted(log types.Log) (*AccessControlEnumerableRoleGranted, error) { - event := new(AccessControlEnumerableRoleGranted) - if err := _AccessControlEnumerable.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AccessControlEnumerableRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the AccessControlEnumerable contract. -type AccessControlEnumerableRoleRevokedIterator struct { - Event *AccessControlEnumerableRoleRevoked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AccessControlEnumerableRoleRevokedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AccessControlEnumerableRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AccessControlEnumerableRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AccessControlEnumerableRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AccessControlEnumerableRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AccessControlEnumerableRoleRevoked represents a RoleRevoked event raised by the AccessControlEnumerable contract. -type AccessControlEnumerableRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AccessControlEnumerableRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControlEnumerable.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &AccessControlEnumerableRoleRevokedIterator{contract: _AccessControlEnumerable.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *AccessControlEnumerableRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _AccessControlEnumerable.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AccessControlEnumerableRoleRevoked) - if err := _AccessControlEnumerable.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_AccessControlEnumerable *AccessControlEnumerableFilterer) ParseRoleRevoked(log types.Log) (*AccessControlEnumerableRoleRevoked, error) { - event := new(AccessControlEnumerableRoleRevoked) - if err := _AccessControlEnumerable.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AddressMetaData contains all meta data concerning the Address contract. -var AddressMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"}]", - Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c02bf2e5594888dce767567f7c2924eb180fd6f6904899db27dad663ca8f547864736f6c63430008140033", -} - -// AddressABI is the input ABI used to generate the binding from. -// Deprecated: Use AddressMetaData.ABI instead. -var AddressABI = AddressMetaData.ABI - -// AddressBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use AddressMetaData.Bin instead. -var AddressBin = AddressMetaData.Bin - -// DeployAddress deploys a new Ethereum contract, binding an instance of Address to it. -func DeployAddress(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *Address, error) { - parsed, err := AddressMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AddressBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Address{AddressCaller: AddressCaller{contract: contract}, AddressTransactor: AddressTransactor{contract: contract}, AddressFilterer: AddressFilterer{contract: contract}}, nil -} - -// Address is an auto generated Go binding around an Ethereum contract. -type Address struct { - AddressCaller // Read-only binding to the contract - AddressTransactor // Write-only binding to the contract - AddressFilterer // Log filterer for contract events -} - -// AddressCaller is an auto generated read-only Go binding around an Ethereum contract. -type AddressCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AddressTransactor is an auto generated write-only Go binding around an Ethereum contract. -type AddressTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AddressFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type AddressFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AddressSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type AddressSession struct { - Contract *Address // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AddressCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type AddressCallerSession struct { - Contract *AddressCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// AddressTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type AddressTransactorSession struct { - Contract *AddressTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AddressRaw is an auto generated low-level Go binding around an Ethereum contract. -type AddressRaw struct { - Contract *Address // Generic contract binding to access the raw methods on -} - -// AddressCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type AddressCallerRaw struct { - Contract *AddressCaller // Generic read-only contract binding to access the raw methods on -} - -// AddressTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type AddressTransactorRaw struct { - Contract *AddressTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewAddress creates a new instance of Address, bound to a specific deployed contract. -func NewAddress(address common.Address, backend bind.ContractBackend) (*Address, error) { - contract, err := bindAddress(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Address{AddressCaller: AddressCaller{contract: contract}, AddressTransactor: AddressTransactor{contract: contract}, AddressFilterer: AddressFilterer{contract: contract}}, nil -} - -// NewAddressCaller creates a new read-only instance of Address, bound to a specific deployed contract. -func NewAddressCaller(address common.Address, caller bind.ContractCaller) (*AddressCaller, error) { - contract, err := bindAddress(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &AddressCaller{contract: contract}, nil -} - -// NewAddressTransactor creates a new write-only instance of Address, bound to a specific deployed contract. -func NewAddressTransactor(address common.Address, transactor bind.ContractTransactor) (*AddressTransactor, error) { - contract, err := bindAddress(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &AddressTransactor{contract: contract}, nil -} - -// NewAddressFilterer creates a new log filterer instance of Address, bound to a specific deployed contract. -func NewAddressFilterer(address common.Address, filterer bind.ContractFilterer) (*AddressFilterer, error) { - contract, err := bindAddress(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &AddressFilterer{contract: contract}, nil -} - -// bindAddress binds a generic wrapper to an already deployed contract. -func bindAddress(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := AddressMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Address *AddressRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Address.Contract.AddressCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Address *AddressRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Address.Contract.AddressTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Address *AddressRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Address.Contract.AddressTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Address *AddressCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Address.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Address *AddressTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Address.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Address *AddressTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Address.Contract.contract.Transact(opts, method, params...) -} - -// AdminMetaData contains all meta data concerning the Admin contract. -var AdminMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"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\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldChainGasAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"ChainGasAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"FeeRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesSwept\",\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_BPS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_RATE_MAX\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOVERNOR_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GUARD_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFUNDER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RELAYER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainGasAmount\",\"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\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"protocolFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"setChainGasAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeeRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepProtocolFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "a217fddf": "DEFAULT_ADMIN_ROLE()", - "bf333f2c": "FEE_BPS()", - "0f5f6ed7": "FEE_RATE_MAX()", - "ccc57490": "GOVERNOR_ROLE()", - "03ed0ee5": "GUARD_ROLE()", - "5960ccf2": "REFUNDER_ROLE()", - "926d7d7f": "RELAYER_ROLE()", - "e00a83e0": "chainGasAmount()", - "248a9ca3": "getRoleAdmin(bytes32)", - "9010d07c": "getRoleMember(bytes32,uint256)", - "ca15c873": "getRoleMemberCount(bytes32)", - "2f2ff15d": "grantRole(bytes32,address)", - "91d14854": "hasRole(bytes32,address)", - "58f85880": "protocolFeeRate()", - "dcf844a7": "protocolFees(address)", - "36568abe": "renounceRole(bytes32,address)", - "d547741f": "revokeRole(bytes32,address)", - "b250fe6b": "setChainGasAmount(uint256)", - "b13aa2d6": "setProtocolFeeRate(uint256)", - "01ffc9a7": "supportsInterface(bytes4)", - "06f333f2": "sweepProtocolFees(address,address)", - }, - Bin: "0x60806040523480156200001157600080fd5b50604051620014123803806200141283398101604081905262000034916200018e565b6200004160008262000049565b5050620001b9565b60008062000058848462000086565b905080156200007d5760008481526001602052604090206200007b908462000134565b505b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff166200012b576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000e23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000080565b50600062000080565b60006200007d836001600160a01b03841660008181526001830160205260408120546200012b5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000080565b600060208284031215620001a157600080fd5b81516001600160a01b03811681146200007d57600080fd5b61124980620001c96000396000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806391d14854116100d8578063bf333f2c1161008c578063d547741f11610066578063d547741f14610385578063dcf844a714610398578063e00a83e0146103b857600080fd5b8063bf333f2c14610341578063ca15c8731461034b578063ccc574901461035e57600080fd5b8063a217fddf116100bd578063a217fddf14610313578063b13aa2d61461031b578063b250fe6b1461032e57600080fd5b806391d14854146102a8578063926d7d7f146102ec57600080fd5b80632f2ff15d1161012f57806358f858801161011457806358f85880146102405780635960ccf2146102495780639010d07c1461027057600080fd5b80632f2ff15d1461021a57806336568abe1461022d57600080fd5b806306f333f21161016057806306f333f2146101d95780630f5f6ed7146101ee578063248a9ca3146101f757600080fd5b806301ffc9a71461017c57806303ed0ee5146101a4575b600080fd5b61018f61018a366004611013565b6103c1565b60405190151581526020015b60405180910390f35b6101cb7f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d81565b60405190815260200161019b565b6101ec6101e736600461107e565b61041d565b005b6101cb61271081565b6101cb6102053660046110b1565b60009081526020819052604090206001015490565b6101ec6102283660046110ca565b61050b565b6101ec61023b3660046110ca565b610536565b6101cb60025481565b6101cb7fdb9556138406326f00296e13ea2ad7db24ba82381212d816b1a40c23b466b32781565b61028361027e3660046110ed565b61058f565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b61018f6102b63660046110ca565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6101cb7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b6101cb600081565b6101ec6103293660046110b1565b6105ae565b6101ec61033c3660046110b1565b610690565b6101cb620f424081565b6101cb6103593660046110b1565b6106f8565b6101cb7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b6101ec6103933660046110ca565b61070f565b6101cb6103a636600461110f565b60036020526000908152604090205481565b6101cb60045481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f000000000000000000000000000000000000000000000000000000001480610417575061041782610734565b92915050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610447816107cb565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120549081900361047b5750505050565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408120556104ac9084836107d8565b6040805173ffffffffffffffffffffffffffffffffffffffff8087168252851660208201529081018290527f244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd9060600160405180910390a1505b505050565b600082815260208190526040902060010154610526816107cb565b610530838361092f565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610585576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105068282610964565b60008281526001602052604081206105a79083610991565b9392505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556105d8816107cb565b612710821115610649576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e657746656552617465203e206d61780000000000000000000000000000000060448201526064015b60405180910390fd5b600280549083905560408051828152602081018590527f14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb95791015b60405180910390a1505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556106ba816107cb565b600480549083905560408051828152602081018590527f5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa9101610683565b60008181526001602052604081206104179061099d565b60008281526020819052604090206001015461072a816107cb565b6105308383610964565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061041757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610417565b6107d581336109a7565b50565b3073ffffffffffffffffffffffffffffffffffffffff8316036107fa57505050565b8060000361080757505050565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff84160161090e5760008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461089e576040519150601f19603f3d011682016040523d82523d6000602084013e6108a3565b606091505b5050905080610530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610640565b61050673ffffffffffffffffffffffffffffffffffffffff84168383610a31565b60008061093c8484610abe565b905080156105a757600084815260016020526040902061095c9084610bba565b509392505050565b6000806109718484610bdc565b905080156105a757600084815260016020526040902061095c9084610c97565b60006105a78383610cb9565b6000610417825490565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a2d576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260248101839052604401610640565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610506908490610ce3565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16610bb25760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610b503390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610417565b506000610417565b60006105a78373ffffffffffffffffffffffffffffffffffffffff8416610d79565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1615610bb25760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610417565b60006105a78373ffffffffffffffffffffffffffffffffffffffff8416610dc0565b6000826000018281548110610cd057610cd061112a565b9060005260206000200154905092915050565b6000610d0573ffffffffffffffffffffffffffffffffffffffff841683610eb3565b90508051600014158015610d2a575080806020019051810190610d289190611159565b155b15610506576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610640565b6000818152600183016020526040812054610bb257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610417565b60008181526001830160205260408120548015610ea9576000610de460018361117b565b8554909150600090610df89060019061117b565b9050808214610e5d576000866000018281548110610e1857610e1861112a565b9060005260206000200154905080876000018481548110610e3b57610e3b61112a565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e6e57610e6e6111b5565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610417565b6000915050610417565b60606105a783836000846000808573ffffffffffffffffffffffffffffffffffffffff168486604051610ee691906111e4565b60006040518083038185875af1925050503d8060008114610f23576040519150601f19603f3d011682016040523d82523d6000602084013e610f28565b606091505b5091509150610f38868383610f42565b9695505050505050565b606082610f5757610f5282610fd1565b6105a7565b8151158015610f7b575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610fca576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610640565b50806105a7565b805115610fe15780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561102557600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146105a757600080fd5b803573ffffffffffffffffffffffffffffffffffffffff8116811461107957600080fd5b919050565b6000806040838503121561109157600080fd5b61109a83611055565b91506110a860208401611055565b90509250929050565b6000602082840312156110c357600080fd5b5035919050565b600080604083850312156110dd57600080fd5b823591506110a860208401611055565b6000806040838503121561110057600080fd5b50508035926020909101359150565b60006020828403121561112157600080fd5b6105a782611055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561116b57600080fd5b815180151581146105a757600080fd5b81810381811115610417577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000825160005b8181101561120557602081860181015185830152016111eb565b50600092019182525091905056fea26469706673582212207051827fc52cd8db023eca7a58610870ecfcd93ea76d5ed3296b385ea81ce18e64736f6c63430008140033", -} - -// AdminABI is the input ABI used to generate the binding from. -// Deprecated: Use AdminMetaData.ABI instead. -var AdminABI = AdminMetaData.ABI - -// Deprecated: Use AdminMetaData.Sigs instead. -// AdminFuncSigs maps the 4-byte function signature to its string representation. -var AdminFuncSigs = AdminMetaData.Sigs - -// AdminBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use AdminMetaData.Bin instead. -var AdminBin = AdminMetaData.Bin - -// DeployAdmin deploys a new Ethereum contract, binding an instance of Admin to it. -func DeployAdmin(auth *bind.TransactOpts, backend bind.ContractBackend, _owner common.Address) (common.Address, *types.Transaction, *Admin, error) { - parsed, err := AdminMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(AdminBin), backend, _owner) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &Admin{AdminCaller: AdminCaller{contract: contract}, AdminTransactor: AdminTransactor{contract: contract}, AdminFilterer: AdminFilterer{contract: contract}}, nil -} - -// Admin is an auto generated Go binding around an Ethereum contract. -type Admin struct { - AdminCaller // Read-only binding to the contract - AdminTransactor // Write-only binding to the contract - AdminFilterer // Log filterer for contract events -} - -// AdminCaller is an auto generated read-only Go binding around an Ethereum contract. -type AdminCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AdminTransactor is an auto generated write-only Go binding around an Ethereum contract. -type AdminTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AdminFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type AdminFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// AdminSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type AdminSession struct { - Contract *Admin // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AdminCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type AdminCallerSession struct { - Contract *AdminCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// AdminTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type AdminTransactorSession struct { - Contract *AdminTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// AdminRaw is an auto generated low-level Go binding around an Ethereum contract. -type AdminRaw struct { - Contract *Admin // Generic contract binding to access the raw methods on -} - -// AdminCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type AdminCallerRaw struct { - Contract *AdminCaller // Generic read-only contract binding to access the raw methods on -} - -// AdminTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type AdminTransactorRaw struct { - Contract *AdminTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewAdmin creates a new instance of Admin, bound to a specific deployed contract. -func NewAdmin(address common.Address, backend bind.ContractBackend) (*Admin, error) { - contract, err := bindAdmin(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Admin{AdminCaller: AdminCaller{contract: contract}, AdminTransactor: AdminTransactor{contract: contract}, AdminFilterer: AdminFilterer{contract: contract}}, nil -} - -// NewAdminCaller creates a new read-only instance of Admin, bound to a specific deployed contract. -func NewAdminCaller(address common.Address, caller bind.ContractCaller) (*AdminCaller, error) { - contract, err := bindAdmin(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &AdminCaller{contract: contract}, nil -} - -// NewAdminTransactor creates a new write-only instance of Admin, bound to a specific deployed contract. -func NewAdminTransactor(address common.Address, transactor bind.ContractTransactor) (*AdminTransactor, error) { - contract, err := bindAdmin(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &AdminTransactor{contract: contract}, nil -} - -// NewAdminFilterer creates a new log filterer instance of Admin, bound to a specific deployed contract. -func NewAdminFilterer(address common.Address, filterer bind.ContractFilterer) (*AdminFilterer, error) { - contract, err := bindAdmin(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &AdminFilterer{contract: contract}, nil -} - -// bindAdmin binds a generic wrapper to an already deployed contract. -func bindAdmin(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := AdminMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Admin *AdminRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Admin.Contract.AdminCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Admin *AdminRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Admin.Contract.AdminTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Admin *AdminRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Admin.Contract.AdminTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Admin *AdminCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Admin.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Admin *AdminTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Admin.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Admin *AdminTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Admin.Contract.contract.Transact(opts, method, params...) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_Admin *AdminCaller) DEFAULTADMINROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "DEFAULT_ADMIN_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_Admin *AdminSession) DEFAULTADMINROLE() ([32]byte, error) { - return _Admin.Contract.DEFAULTADMINROLE(&_Admin.CallOpts) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_Admin *AdminCallerSession) DEFAULTADMINROLE() ([32]byte, error) { - return _Admin.Contract.DEFAULTADMINROLE(&_Admin.CallOpts) -} - -// FEEBPS is a free data retrieval call binding the contract method 0xbf333f2c. -// -// Solidity: function FEE_BPS() view returns(uint256) -func (_Admin *AdminCaller) FEEBPS(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "FEE_BPS") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// FEEBPS is a free data retrieval call binding the contract method 0xbf333f2c. -// -// Solidity: function FEE_BPS() view returns(uint256) -func (_Admin *AdminSession) FEEBPS() (*big.Int, error) { - return _Admin.Contract.FEEBPS(&_Admin.CallOpts) -} - -// FEEBPS is a free data retrieval call binding the contract method 0xbf333f2c. -// -// Solidity: function FEE_BPS() view returns(uint256) -func (_Admin *AdminCallerSession) FEEBPS() (*big.Int, error) { - return _Admin.Contract.FEEBPS(&_Admin.CallOpts) -} - -// FEERATEMAX is a free data retrieval call binding the contract method 0x0f5f6ed7. -// -// Solidity: function FEE_RATE_MAX() view returns(uint256) -func (_Admin *AdminCaller) FEERATEMAX(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "FEE_RATE_MAX") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// FEERATEMAX is a free data retrieval call binding the contract method 0x0f5f6ed7. -// -// Solidity: function FEE_RATE_MAX() view returns(uint256) -func (_Admin *AdminSession) FEERATEMAX() (*big.Int, error) { - return _Admin.Contract.FEERATEMAX(&_Admin.CallOpts) -} - -// FEERATEMAX is a free data retrieval call binding the contract method 0x0f5f6ed7. -// -// Solidity: function FEE_RATE_MAX() view returns(uint256) -func (_Admin *AdminCallerSession) FEERATEMAX() (*big.Int, error) { - return _Admin.Contract.FEERATEMAX(&_Admin.CallOpts) -} - -// GOVERNORROLE is a free data retrieval call binding the contract method 0xccc57490. -// -// Solidity: function GOVERNOR_ROLE() view returns(bytes32) -func (_Admin *AdminCaller) GOVERNORROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "GOVERNOR_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GOVERNORROLE is a free data retrieval call binding the contract method 0xccc57490. -// -// Solidity: function GOVERNOR_ROLE() view returns(bytes32) -func (_Admin *AdminSession) GOVERNORROLE() ([32]byte, error) { - return _Admin.Contract.GOVERNORROLE(&_Admin.CallOpts) -} - -// GOVERNORROLE is a free data retrieval call binding the contract method 0xccc57490. -// -// Solidity: function GOVERNOR_ROLE() view returns(bytes32) -func (_Admin *AdminCallerSession) GOVERNORROLE() ([32]byte, error) { - return _Admin.Contract.GOVERNORROLE(&_Admin.CallOpts) -} - -// GUARDROLE is a free data retrieval call binding the contract method 0x03ed0ee5. -// -// Solidity: function GUARD_ROLE() view returns(bytes32) -func (_Admin *AdminCaller) GUARDROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "GUARD_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GUARDROLE is a free data retrieval call binding the contract method 0x03ed0ee5. -// -// Solidity: function GUARD_ROLE() view returns(bytes32) -func (_Admin *AdminSession) GUARDROLE() ([32]byte, error) { - return _Admin.Contract.GUARDROLE(&_Admin.CallOpts) -} - -// GUARDROLE is a free data retrieval call binding the contract method 0x03ed0ee5. -// -// Solidity: function GUARD_ROLE() view returns(bytes32) -func (_Admin *AdminCallerSession) GUARDROLE() ([32]byte, error) { - return _Admin.Contract.GUARDROLE(&_Admin.CallOpts) -} - -// REFUNDERROLE is a free data retrieval call binding the contract method 0x5960ccf2. -// -// Solidity: function REFUNDER_ROLE() view returns(bytes32) -func (_Admin *AdminCaller) REFUNDERROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "REFUNDER_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// REFUNDERROLE is a free data retrieval call binding the contract method 0x5960ccf2. -// -// Solidity: function REFUNDER_ROLE() view returns(bytes32) -func (_Admin *AdminSession) REFUNDERROLE() ([32]byte, error) { - return _Admin.Contract.REFUNDERROLE(&_Admin.CallOpts) -} - -// REFUNDERROLE is a free data retrieval call binding the contract method 0x5960ccf2. -// -// Solidity: function REFUNDER_ROLE() view returns(bytes32) -func (_Admin *AdminCallerSession) REFUNDERROLE() ([32]byte, error) { - return _Admin.Contract.REFUNDERROLE(&_Admin.CallOpts) -} - -// RELAYERROLE is a free data retrieval call binding the contract method 0x926d7d7f. -// -// Solidity: function RELAYER_ROLE() view returns(bytes32) -func (_Admin *AdminCaller) RELAYERROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "RELAYER_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// RELAYERROLE is a free data retrieval call binding the contract method 0x926d7d7f. -// -// Solidity: function RELAYER_ROLE() view returns(bytes32) -func (_Admin *AdminSession) RELAYERROLE() ([32]byte, error) { - return _Admin.Contract.RELAYERROLE(&_Admin.CallOpts) -} - -// RELAYERROLE is a free data retrieval call binding the contract method 0x926d7d7f. -// -// Solidity: function RELAYER_ROLE() view returns(bytes32) -func (_Admin *AdminCallerSession) RELAYERROLE() ([32]byte, error) { - return _Admin.Contract.RELAYERROLE(&_Admin.CallOpts) -} - -// ChainGasAmount is a free data retrieval call binding the contract method 0xe00a83e0. -// -// Solidity: function chainGasAmount() view returns(uint256) -func (_Admin *AdminCaller) ChainGasAmount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "chainGasAmount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ChainGasAmount is a free data retrieval call binding the contract method 0xe00a83e0. -// -// Solidity: function chainGasAmount() view returns(uint256) -func (_Admin *AdminSession) ChainGasAmount() (*big.Int, error) { - return _Admin.Contract.ChainGasAmount(&_Admin.CallOpts) -} - -// ChainGasAmount is a free data retrieval call binding the contract method 0xe00a83e0. -// -// Solidity: function chainGasAmount() view returns(uint256) -func (_Admin *AdminCallerSession) ChainGasAmount() (*big.Int, error) { - return _Admin.Contract.ChainGasAmount(&_Admin.CallOpts) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_Admin *AdminCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_Admin *AdminSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _Admin.Contract.GetRoleAdmin(&_Admin.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_Admin *AdminCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _Admin.Contract.GetRoleAdmin(&_Admin.CallOpts, role) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_Admin *AdminCaller) GetRoleMember(opts *bind.CallOpts, role [32]byte, index *big.Int) (common.Address, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "getRoleMember", role, index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_Admin *AdminSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _Admin.Contract.GetRoleMember(&_Admin.CallOpts, role, index) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_Admin *AdminCallerSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _Admin.Contract.GetRoleMember(&_Admin.CallOpts, role, index) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_Admin *AdminCaller) GetRoleMemberCount(opts *bind.CallOpts, role [32]byte) (*big.Int, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "getRoleMemberCount", role) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_Admin *AdminSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _Admin.Contract.GetRoleMemberCount(&_Admin.CallOpts, role) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_Admin *AdminCallerSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _Admin.Contract.GetRoleMemberCount(&_Admin.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_Admin *AdminCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_Admin *AdminSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _Admin.Contract.HasRole(&_Admin.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_Admin *AdminCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _Admin.Contract.HasRole(&_Admin.CallOpts, role, account) -} - -// ProtocolFeeRate is a free data retrieval call binding the contract method 0x58f85880. -// -// Solidity: function protocolFeeRate() view returns(uint256) -func (_Admin *AdminCaller) ProtocolFeeRate(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "protocolFeeRate") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ProtocolFeeRate is a free data retrieval call binding the contract method 0x58f85880. -// -// Solidity: function protocolFeeRate() view returns(uint256) -func (_Admin *AdminSession) ProtocolFeeRate() (*big.Int, error) { - return _Admin.Contract.ProtocolFeeRate(&_Admin.CallOpts) -} - -// ProtocolFeeRate is a free data retrieval call binding the contract method 0x58f85880. -// -// Solidity: function protocolFeeRate() view returns(uint256) -func (_Admin *AdminCallerSession) ProtocolFeeRate() (*big.Int, error) { - return _Admin.Contract.ProtocolFeeRate(&_Admin.CallOpts) -} - -// ProtocolFees is a free data retrieval call binding the contract method 0xdcf844a7. -// -// Solidity: function protocolFees(address ) view returns(uint256) -func (_Admin *AdminCaller) ProtocolFees(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "protocolFees", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ProtocolFees is a free data retrieval call binding the contract method 0xdcf844a7. -// -// Solidity: function protocolFees(address ) view returns(uint256) -func (_Admin *AdminSession) ProtocolFees(arg0 common.Address) (*big.Int, error) { - return _Admin.Contract.ProtocolFees(&_Admin.CallOpts, arg0) -} - -// ProtocolFees is a free data retrieval call binding the contract method 0xdcf844a7. -// -// Solidity: function protocolFees(address ) view returns(uint256) -func (_Admin *AdminCallerSession) ProtocolFees(arg0 common.Address) (*big.Int, error) { - return _Admin.Contract.ProtocolFees(&_Admin.CallOpts, arg0) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Admin *AdminCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _Admin.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Admin *AdminSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Admin.Contract.SupportsInterface(&_Admin.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_Admin *AdminCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _Admin.Contract.SupportsInterface(&_Admin.CallOpts, interfaceId) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_Admin *AdminTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _Admin.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_Admin *AdminSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _Admin.Contract.GrantRole(&_Admin.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_Admin *AdminTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _Admin.Contract.GrantRole(&_Admin.TransactOpts, role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_Admin *AdminTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _Admin.contract.Transact(opts, "renounceRole", role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_Admin *AdminSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _Admin.Contract.RenounceRole(&_Admin.TransactOpts, role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_Admin *AdminTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _Admin.Contract.RenounceRole(&_Admin.TransactOpts, role, callerConfirmation) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_Admin *AdminTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _Admin.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_Admin *AdminSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _Admin.Contract.RevokeRole(&_Admin.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_Admin *AdminTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _Admin.Contract.RevokeRole(&_Admin.TransactOpts, role, account) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_Admin *AdminTransactor) SetChainGasAmount(opts *bind.TransactOpts, newChainGasAmount *big.Int) (*types.Transaction, error) { - return _Admin.contract.Transact(opts, "setChainGasAmount", newChainGasAmount) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_Admin *AdminSession) SetChainGasAmount(newChainGasAmount *big.Int) (*types.Transaction, error) { - return _Admin.Contract.SetChainGasAmount(&_Admin.TransactOpts, newChainGasAmount) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_Admin *AdminTransactorSession) SetChainGasAmount(newChainGasAmount *big.Int) (*types.Transaction, error) { - return _Admin.Contract.SetChainGasAmount(&_Admin.TransactOpts, newChainGasAmount) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_Admin *AdminTransactor) SetProtocolFeeRate(opts *bind.TransactOpts, newFeeRate *big.Int) (*types.Transaction, error) { - return _Admin.contract.Transact(opts, "setProtocolFeeRate", newFeeRate) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_Admin *AdminSession) SetProtocolFeeRate(newFeeRate *big.Int) (*types.Transaction, error) { - return _Admin.Contract.SetProtocolFeeRate(&_Admin.TransactOpts, newFeeRate) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_Admin *AdminTransactorSession) SetProtocolFeeRate(newFeeRate *big.Int) (*types.Transaction, error) { - return _Admin.Contract.SetProtocolFeeRate(&_Admin.TransactOpts, newFeeRate) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_Admin *AdminTransactor) SweepProtocolFees(opts *bind.TransactOpts, token common.Address, recipient common.Address) (*types.Transaction, error) { - return _Admin.contract.Transact(opts, "sweepProtocolFees", token, recipient) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_Admin *AdminSession) SweepProtocolFees(token common.Address, recipient common.Address) (*types.Transaction, error) { - return _Admin.Contract.SweepProtocolFees(&_Admin.TransactOpts, token, recipient) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_Admin *AdminTransactorSession) SweepProtocolFees(token common.Address, recipient common.Address) (*types.Transaction, error) { - return _Admin.Contract.SweepProtocolFees(&_Admin.TransactOpts, token, recipient) -} - -// AdminChainGasAmountUpdatedIterator is returned from FilterChainGasAmountUpdated and is used to iterate over the raw logs and unpacked data for ChainGasAmountUpdated events raised by the Admin contract. -type AdminChainGasAmountUpdatedIterator struct { - Event *AdminChainGasAmountUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AdminChainGasAmountUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AdminChainGasAmountUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AdminChainGasAmountUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AdminChainGasAmountUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AdminChainGasAmountUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AdminChainGasAmountUpdated represents a ChainGasAmountUpdated event raised by the Admin contract. -type AdminChainGasAmountUpdated struct { - OldChainGasAmount *big.Int - NewChainGasAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChainGasAmountUpdated is a free log retrieval operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_Admin *AdminFilterer) FilterChainGasAmountUpdated(opts *bind.FilterOpts) (*AdminChainGasAmountUpdatedIterator, error) { - - logs, sub, err := _Admin.contract.FilterLogs(opts, "ChainGasAmountUpdated") - if err != nil { - return nil, err - } - return &AdminChainGasAmountUpdatedIterator{contract: _Admin.contract, event: "ChainGasAmountUpdated", logs: logs, sub: sub}, nil -} - -// WatchChainGasAmountUpdated is a free log subscription operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_Admin *AdminFilterer) WatchChainGasAmountUpdated(opts *bind.WatchOpts, sink chan<- *AdminChainGasAmountUpdated) (event.Subscription, error) { - - logs, sub, err := _Admin.contract.WatchLogs(opts, "ChainGasAmountUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AdminChainGasAmountUpdated) - if err := _Admin.contract.UnpackLog(event, "ChainGasAmountUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChainGasAmountUpdated is a log parse operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_Admin *AdminFilterer) ParseChainGasAmountUpdated(log types.Log) (*AdminChainGasAmountUpdated, error) { - event := new(AdminChainGasAmountUpdated) - if err := _Admin.contract.UnpackLog(event, "ChainGasAmountUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AdminFeeRateUpdatedIterator is returned from FilterFeeRateUpdated and is used to iterate over the raw logs and unpacked data for FeeRateUpdated events raised by the Admin contract. -type AdminFeeRateUpdatedIterator struct { - Event *AdminFeeRateUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AdminFeeRateUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AdminFeeRateUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AdminFeeRateUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AdminFeeRateUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AdminFeeRateUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AdminFeeRateUpdated represents a FeeRateUpdated event raised by the Admin contract. -type AdminFeeRateUpdated struct { - OldFeeRate *big.Int - NewFeeRate *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeeRateUpdated is a free log retrieval operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_Admin *AdminFilterer) FilterFeeRateUpdated(opts *bind.FilterOpts) (*AdminFeeRateUpdatedIterator, error) { - - logs, sub, err := _Admin.contract.FilterLogs(opts, "FeeRateUpdated") - if err != nil { - return nil, err - } - return &AdminFeeRateUpdatedIterator{contract: _Admin.contract, event: "FeeRateUpdated", logs: logs, sub: sub}, nil -} - -// WatchFeeRateUpdated is a free log subscription operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_Admin *AdminFilterer) WatchFeeRateUpdated(opts *bind.WatchOpts, sink chan<- *AdminFeeRateUpdated) (event.Subscription, error) { - - logs, sub, err := _Admin.contract.WatchLogs(opts, "FeeRateUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AdminFeeRateUpdated) - if err := _Admin.contract.UnpackLog(event, "FeeRateUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseFeeRateUpdated is a log parse operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_Admin *AdminFilterer) ParseFeeRateUpdated(log types.Log) (*AdminFeeRateUpdated, error) { - event := new(AdminFeeRateUpdated) - if err := _Admin.contract.UnpackLog(event, "FeeRateUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AdminFeesSweptIterator is returned from FilterFeesSwept and is used to iterate over the raw logs and unpacked data for FeesSwept events raised by the Admin contract. -type AdminFeesSweptIterator struct { - Event *AdminFeesSwept // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AdminFeesSweptIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AdminFeesSwept) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AdminFeesSwept) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AdminFeesSweptIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AdminFeesSweptIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AdminFeesSwept represents a FeesSwept event raised by the Admin contract. -type AdminFeesSwept struct { - Token common.Address - Recipient common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeesSwept is a free log retrieval operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_Admin *AdminFilterer) FilterFeesSwept(opts *bind.FilterOpts) (*AdminFeesSweptIterator, error) { - - logs, sub, err := _Admin.contract.FilterLogs(opts, "FeesSwept") - if err != nil { - return nil, err - } - return &AdminFeesSweptIterator{contract: _Admin.contract, event: "FeesSwept", logs: logs, sub: sub}, nil -} - -// WatchFeesSwept is a free log subscription operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_Admin *AdminFilterer) WatchFeesSwept(opts *bind.WatchOpts, sink chan<- *AdminFeesSwept) (event.Subscription, error) { - - logs, sub, err := _Admin.contract.WatchLogs(opts, "FeesSwept") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AdminFeesSwept) - if err := _Admin.contract.UnpackLog(event, "FeesSwept", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseFeesSwept is a log parse operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_Admin *AdminFilterer) ParseFeesSwept(log types.Log) (*AdminFeesSwept, error) { - event := new(AdminFeesSwept) - if err := _Admin.contract.UnpackLog(event, "FeesSwept", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AdminRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the Admin contract. -type AdminRoleAdminChangedIterator struct { - Event *AdminRoleAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AdminRoleAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AdminRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AdminRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AdminRoleAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AdminRoleAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AdminRoleAdminChanged represents a RoleAdminChanged event raised by the Admin contract. -type AdminRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_Admin *AdminFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*AdminRoleAdminChangedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _Admin.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return &AdminRoleAdminChangedIterator{contract: _Admin.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil -} - -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_Admin *AdminFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *AdminRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _Admin.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AdminRoleAdminChanged) - if err := _Admin.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_Admin *AdminFilterer) ParseRoleAdminChanged(log types.Log) (*AdminRoleAdminChanged, error) { - event := new(AdminRoleAdminChanged) - if err := _Admin.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AdminRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the Admin contract. -type AdminRoleGrantedIterator struct { - Event *AdminRoleGranted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AdminRoleGrantedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AdminRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AdminRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AdminRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AdminRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AdminRoleGranted represents a RoleGranted event raised by the Admin contract. -type AdminRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_Admin *AdminFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AdminRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _Admin.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &AdminRoleGrantedIterator{contract: _Admin.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_Admin *AdminFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *AdminRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _Admin.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AdminRoleGranted) - if err := _Admin.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_Admin *AdminFilterer) ParseRoleGranted(log types.Log) (*AdminRoleGranted, error) { - event := new(AdminRoleGranted) - if err := _Admin.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// AdminRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the Admin contract. -type AdminRoleRevokedIterator struct { - Event *AdminRoleRevoked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *AdminRoleRevokedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(AdminRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(AdminRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *AdminRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *AdminRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// AdminRoleRevoked represents a RoleRevoked event raised by the Admin contract. -type AdminRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_Admin *AdminFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*AdminRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _Admin.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &AdminRoleRevokedIterator{contract: _Admin.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_Admin *AdminFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *AdminRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _Admin.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(AdminRoleRevoked) - if err := _Admin.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_Admin *AdminFilterer) ParseRoleRevoked(log types.Log) (*AdminRoleRevoked, error) { - event := new(AdminRoleRevoked) - if err := _Admin.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// ContextMetaData contains all meta data concerning the Context contract. -var ContextMetaData = &bind.MetaData{ - ABI: "[]", -} - -// ContextABI is the input ABI used to generate the binding from. -// Deprecated: Use ContextMetaData.ABI instead. -var ContextABI = ContextMetaData.ABI - -// Context is an auto generated Go binding around an Ethereum contract. -type Context struct { - ContextCaller // Read-only binding to the contract - ContextTransactor // Write-only binding to the contract - ContextFilterer // Log filterer for contract events -} - -// ContextCaller is an auto generated read-only Go binding around an Ethereum contract. -type ContextCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ContextTransactor is an auto generated write-only Go binding around an Ethereum contract. -type ContextTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ContextFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ContextFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ContextSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ContextSession struct { - Contract *Context // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ContextCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ContextCallerSession struct { - Contract *ContextCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ContextTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ContextTransactorSession struct { - Contract *ContextTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ContextRaw is an auto generated low-level Go binding around an Ethereum contract. -type ContextRaw struct { - Contract *Context // Generic contract binding to access the raw methods on -} - -// ContextCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ContextCallerRaw struct { - Contract *ContextCaller // Generic read-only contract binding to access the raw methods on -} - -// ContextTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ContextTransactorRaw struct { - Contract *ContextTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewContext creates a new instance of Context, bound to a specific deployed contract. -func NewContext(address common.Address, backend bind.ContractBackend) (*Context, error) { - contract, err := bindContext(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &Context{ContextCaller: ContextCaller{contract: contract}, ContextTransactor: ContextTransactor{contract: contract}, ContextFilterer: ContextFilterer{contract: contract}}, nil -} - -// NewContextCaller creates a new read-only instance of Context, bound to a specific deployed contract. -func NewContextCaller(address common.Address, caller bind.ContractCaller) (*ContextCaller, error) { - contract, err := bindContext(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ContextCaller{contract: contract}, nil -} - -// NewContextTransactor creates a new write-only instance of Context, bound to a specific deployed contract. -func NewContextTransactor(address common.Address, transactor bind.ContractTransactor) (*ContextTransactor, error) { - contract, err := bindContext(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ContextTransactor{contract: contract}, nil -} - -// NewContextFilterer creates a new log filterer instance of Context, bound to a specific deployed contract. -func NewContextFilterer(address common.Address, filterer bind.ContractFilterer) (*ContextFilterer, error) { - contract, err := bindContext(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ContextFilterer{contract: contract}, nil -} - -// bindContext binds a generic wrapper to an already deployed contract. -func bindContext(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ContextMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Context *ContextRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Context.Contract.ContextCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Context *ContextRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Context.Contract.ContextTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Context *ContextRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Context.Contract.ContextTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_Context *ContextCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _Context.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_Context *ContextTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _Context.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_Context *ContextTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _Context.Contract.contract.Transact(opts, method, params...) -} - -// ERC165MetaData contains all meta data concerning the ERC165 contract. -var ERC165MetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "01ffc9a7": "supportsInterface(bytes4)", - }, -} - -// ERC165ABI is the input ABI used to generate the binding from. -// Deprecated: Use ERC165MetaData.ABI instead. -var ERC165ABI = ERC165MetaData.ABI - -// Deprecated: Use ERC165MetaData.Sigs instead. -// ERC165FuncSigs maps the 4-byte function signature to its string representation. -var ERC165FuncSigs = ERC165MetaData.Sigs - -// ERC165 is an auto generated Go binding around an Ethereum contract. -type ERC165 struct { - ERC165Caller // Read-only binding to the contract - ERC165Transactor // Write-only binding to the contract - ERC165Filterer // Log filterer for contract events -} - -// ERC165Caller is an auto generated read-only Go binding around an Ethereum contract. -type ERC165Caller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC165Transactor is an auto generated write-only Go binding around an Ethereum contract. -type ERC165Transactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC165Filterer is an auto generated log filtering Go binding around an Ethereum contract events. -type ERC165Filterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// ERC165Session is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type ERC165Session struct { - Contract *ERC165 // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ERC165CallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type ERC165CallerSession struct { - Contract *ERC165Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// ERC165TransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type ERC165TransactorSession struct { - Contract *ERC165Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// ERC165Raw is an auto generated low-level Go binding around an Ethereum contract. -type ERC165Raw struct { - Contract *ERC165 // Generic contract binding to access the raw methods on -} - -// ERC165CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type ERC165CallerRaw struct { - Contract *ERC165Caller // Generic read-only contract binding to access the raw methods on -} - -// ERC165TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type ERC165TransactorRaw struct { - Contract *ERC165Transactor // Generic write-only contract binding to access the raw methods on -} - -// NewERC165 creates a new instance of ERC165, bound to a specific deployed contract. -func NewERC165(address common.Address, backend bind.ContractBackend) (*ERC165, error) { - contract, err := bindERC165(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &ERC165{ERC165Caller: ERC165Caller{contract: contract}, ERC165Transactor: ERC165Transactor{contract: contract}, ERC165Filterer: ERC165Filterer{contract: contract}}, nil -} - -// NewERC165Caller creates a new read-only instance of ERC165, bound to a specific deployed contract. -func NewERC165Caller(address common.Address, caller bind.ContractCaller) (*ERC165Caller, error) { - contract, err := bindERC165(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &ERC165Caller{contract: contract}, nil -} - -// NewERC165Transactor creates a new write-only instance of ERC165, bound to a specific deployed contract. -func NewERC165Transactor(address common.Address, transactor bind.ContractTransactor) (*ERC165Transactor, error) { - contract, err := bindERC165(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &ERC165Transactor{contract: contract}, nil -} - -// NewERC165Filterer creates a new log filterer instance of ERC165, bound to a specific deployed contract. -func NewERC165Filterer(address common.Address, filterer bind.ContractFilterer) (*ERC165Filterer, error) { - contract, err := bindERC165(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &ERC165Filterer{contract: contract}, nil -} - -// bindERC165 binds a generic wrapper to an already deployed contract. -func bindERC165(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := ERC165MetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_ERC165 *ERC165Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC165.Contract.ERC165Caller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_ERC165 *ERC165Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC165.Contract.ERC165Transactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ERC165 *ERC165Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC165.Contract.ERC165Transactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_ERC165 *ERC165CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _ERC165.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_ERC165 *ERC165TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _ERC165.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_ERC165 *ERC165TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _ERC165.Contract.contract.Transact(opts, method, params...) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_ERC165 *ERC165Caller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _ERC165.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_ERC165 *ERC165Session) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _ERC165.Contract.SupportsInterface(&_ERC165.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_ERC165 *ERC165CallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _ERC165.Contract.SupportsInterface(&_ERC165.CallOpts, interfaceId) -} - -// EnumerableSetMetaData contains all meta data concerning the EnumerableSet contract. -var EnumerableSetMetaData = &bind.MetaData{ - ABI: "[]", - Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203a6e3f60ed51bcb9fc27641637557f1f938845d6b833150d5c8467b60921792564736f6c63430008140033", -} - -// EnumerableSetABI is the input ABI used to generate the binding from. -// Deprecated: Use EnumerableSetMetaData.ABI instead. -var EnumerableSetABI = EnumerableSetMetaData.ABI - -// EnumerableSetBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use EnumerableSetMetaData.Bin instead. -var EnumerableSetBin = EnumerableSetMetaData.Bin - -// DeployEnumerableSet deploys a new Ethereum contract, binding an instance of EnumerableSet to it. -func DeployEnumerableSet(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *EnumerableSet, error) { - parsed, err := EnumerableSetMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(EnumerableSetBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &EnumerableSet{EnumerableSetCaller: EnumerableSetCaller{contract: contract}, EnumerableSetTransactor: EnumerableSetTransactor{contract: contract}, EnumerableSetFilterer: EnumerableSetFilterer{contract: contract}}, nil -} - -// EnumerableSet is an auto generated Go binding around an Ethereum contract. -type EnumerableSet struct { - EnumerableSetCaller // Read-only binding to the contract - EnumerableSetTransactor // Write-only binding to the contract - EnumerableSetFilterer // Log filterer for contract events -} - -// EnumerableSetCaller is an auto generated read-only Go binding around an Ethereum contract. -type EnumerableSetCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EnumerableSetTransactor is an auto generated write-only Go binding around an Ethereum contract. -type EnumerableSetTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EnumerableSetFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type EnumerableSetFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// EnumerableSetSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type EnumerableSetSession struct { - Contract *EnumerableSet // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EnumerableSetCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type EnumerableSetCallerSession struct { - Contract *EnumerableSetCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// EnumerableSetTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type EnumerableSetTransactorSession struct { - Contract *EnumerableSetTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// EnumerableSetRaw is an auto generated low-level Go binding around an Ethereum contract. -type EnumerableSetRaw struct { - Contract *EnumerableSet // Generic contract binding to access the raw methods on -} - -// EnumerableSetCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type EnumerableSetCallerRaw struct { - Contract *EnumerableSetCaller // Generic read-only contract binding to access the raw methods on -} - -// EnumerableSetTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type EnumerableSetTransactorRaw struct { - Contract *EnumerableSetTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewEnumerableSet creates a new instance of EnumerableSet, bound to a specific deployed contract. -func NewEnumerableSet(address common.Address, backend bind.ContractBackend) (*EnumerableSet, error) { - contract, err := bindEnumerableSet(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &EnumerableSet{EnumerableSetCaller: EnumerableSetCaller{contract: contract}, EnumerableSetTransactor: EnumerableSetTransactor{contract: contract}, EnumerableSetFilterer: EnumerableSetFilterer{contract: contract}}, nil -} - -// NewEnumerableSetCaller creates a new read-only instance of EnumerableSet, bound to a specific deployed contract. -func NewEnumerableSetCaller(address common.Address, caller bind.ContractCaller) (*EnumerableSetCaller, error) { - contract, err := bindEnumerableSet(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &EnumerableSetCaller{contract: contract}, nil -} - -// NewEnumerableSetTransactor creates a new write-only instance of EnumerableSet, bound to a specific deployed contract. -func NewEnumerableSetTransactor(address common.Address, transactor bind.ContractTransactor) (*EnumerableSetTransactor, error) { - contract, err := bindEnumerableSet(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &EnumerableSetTransactor{contract: contract}, nil -} - -// NewEnumerableSetFilterer creates a new log filterer instance of EnumerableSet, bound to a specific deployed contract. -func NewEnumerableSetFilterer(address common.Address, filterer bind.ContractFilterer) (*EnumerableSetFilterer, error) { - contract, err := bindEnumerableSet(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &EnumerableSetFilterer{contract: contract}, nil -} - -// bindEnumerableSet binds a generic wrapper to an already deployed contract. -func bindEnumerableSet(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := EnumerableSetMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_EnumerableSet *EnumerableSetRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EnumerableSet.Contract.EnumerableSetCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_EnumerableSet *EnumerableSetRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EnumerableSet.Contract.EnumerableSetTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EnumerableSet *EnumerableSetRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EnumerableSet.Contract.EnumerableSetTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_EnumerableSet *EnumerableSetCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _EnumerableSet.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_EnumerableSet *EnumerableSetTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _EnumerableSet.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_EnumerableSet *EnumerableSetTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _EnumerableSet.Contract.contract.Transact(opts, method, params...) -} - -// FastBridgeMetaData contains all meta data concerning the FastBridge contract. -var FastBridgeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"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\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineNotExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineTooShort\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MsgValueIncorrect\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StatusIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionRelayed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositRefunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"BridgeProofDisputed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"}],\"name\":\"BridgeProofProvided\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainGasAmount\",\"type\":\"uint256\"}],\"name\":\"BridgeRelayed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"}],\"name\":\"BridgeRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldChainGasAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"ChainGasAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"FeeRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesSwept\",\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DISPUTE_PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_BPS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_RATE_MAX\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOVERNOR_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GUARD_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_DEADLINE_PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFUNDER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFUND_DELAY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RELAYER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structIFastBridge.BridgeParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"bridge\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"bridgeProofs\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"timestamp\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"bridgeRelays\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"bridgeStatuses\",\"outputs\":[{\"internalType\":\"enumFastBridge.BridgeStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"canClaim\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainGasAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deployBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"dispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"getBridgeTransaction\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"originSender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"originFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structIFastBridge.BridgeTransaction\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"destTxHash\",\"type\":\"bytes32\"}],\"name\":\"prove\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"refund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"setChainGasAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeeRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepProtocolFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "a217fddf": "DEFAULT_ADMIN_ROLE()", - "a5bbe22b": "DISPUTE_PERIOD()", - "bf333f2c": "FEE_BPS()", - "0f5f6ed7": "FEE_RATE_MAX()", - "ccc57490": "GOVERNOR_ROLE()", - "03ed0ee5": "GUARD_ROLE()", - "820688d5": "MIN_DEADLINE_PERIOD()", - "5960ccf2": "REFUNDER_ROLE()", - "190da595": "REFUND_DELAY()", - "926d7d7f": "RELAYER_ROLE()", - "45851694": "bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))", - "91ad5039": "bridgeProofs(bytes32)", - "8379a24f": "bridgeRelays(bytes32)", - "051287bc": "bridgeStatuses(bytes32)", - "aa9641ab": "canClaim(bytes32,address)", - "e00a83e0": "chainGasAmount()", - "41fcb612": "claim(bytes,address)", - "a3ec191a": "deployBlock()", - "add98c70": "dispute(bytes32)", - "ac11fb1a": "getBridgeTransaction(bytes)", - "248a9ca3": "getRoleAdmin(bytes32)", - "9010d07c": "getRoleMember(bytes32,uint256)", - "ca15c873": "getRoleMemberCount(bytes32)", - "2f2ff15d": "grantRole(bytes32,address)", - "91d14854": "hasRole(bytes32,address)", - "affed0e0": "nonce()", - "58f85880": "protocolFeeRate()", - "dcf844a7": "protocolFees(address)", - "886d36ff": "prove(bytes,bytes32)", - "5eb7d946": "refund(bytes)", - "8f0d6f17": "relay(bytes)", - "36568abe": "renounceRole(bytes32,address)", - "d547741f": "revokeRole(bytes32,address)", - "b250fe6b": "setChainGasAmount(uint256)", - "b13aa2d6": "setProtocolFeeRate(uint256)", - "01ffc9a7": "supportsInterface(bytes4)", - "06f333f2": "sweepProtocolFees(address,address)", - }, - Bin: "0x60a06040523480156200001157600080fd5b5060405162002d7a38038062002d7a833981016040819052620000349162000194565b80620000426000826200004f565b50504360805250620001bf565b6000806200005e84846200008c565b90508015620000835760008481526001602052604090206200008190846200013a565b505b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000131576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000e83390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000086565b50600062000086565b600062000083836001600160a01b0384166000818152600183016020526040812054620001315750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000086565b600060208284031215620001a757600080fd5b81516001600160a01b03811681146200008357600080fd5b608051612b9f620001db60003960006106510152612b9f6000f3fe60806040526004361061026a5760003560e01c80639010d07c11610153578063add98c70116100cb578063ca15c8731161007f578063d547741f11610064578063d547741f146107a1578063dcf844a7146107c1578063e00a83e0146107ee57600080fd5b8063ca15c8731461074d578063ccc574901461076d57600080fd5b8063b13aa2d6116100b0578063b13aa2d6146106f6578063b250fe6b14610716578063bf333f2c1461073657600080fd5b8063add98c70146106c0578063affed0e0146106e057600080fd5b8063a217fddf11610122578063a5bbe22b11610107578063a5bbe22b1461047f578063aa9641ab14610673578063ac11fb1a1461069357600080fd5b8063a217fddf1461062a578063a3ec191a1461063f57600080fd5b80639010d07c146104f857806391ad50391461053057806391d14854146105b2578063926d7d7f146105f657600080fd5b806341fcb612116101e65780635eb7d946116101b55780638379a24f1161019a5780638379a24f14610495578063886d36ff146104c55780638f0d6f17146104e557600080fd5b80635eb7d9461461045f578063820688d51461047f57600080fd5b806341fcb612146103e2578063458516941461040257806358f85880146104155780635960ccf21461042b57600080fd5b80630f5f6ed71161023d578063248a9ca311610222578063248a9ca3146103725780632f2ff15d146103a257806336568abe146103c257600080fd5b80630f5f6ed714610345578063190da5951461035b57600080fd5b806301ffc9a71461026f57806303ed0ee5146102a4578063051287bc146102e657806306f333f214610323575b600080fd5b34801561027b57600080fd5b5061028f61028a3660046122fc565b610804565b60405190151581526020015b60405180910390f35b3480156102b057600080fd5b506102d87f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d81565b60405190815260200161029b565b3480156102f257600080fd5b5061031661030136600461233e565b60056020526000908152604090205460ff1681565b60405161029b9190612386565b34801561032f57600080fd5b5061034361033e3660046123ec565b610860565b005b34801561035157600080fd5b506102d861271081565b34801561036757600080fd5b506102d862093a8081565b34801561037e57600080fd5b506102d861038d36600461233e565b60009081526020819052604090206001015490565b3480156103ae57600080fd5b506103436103bd366004612425565b610927565b3480156103ce57600080fd5b506103436103dd366004612425565b610952565b3480156103ee57600080fd5b506103436103fd366004612572565b61099e565b6103436104103660046125ef565b610bd7565b34801561042157600080fd5b506102d860025481565b34801561043757600080fd5b506102d87fdb9556138406326f00296e13ea2ad7db24ba82381212d816b1a40c23b466b32781565b34801561046b57600080fd5b5061034361047a366004612692565b610ee5565b34801561048b57600080fd5b506102d861070881565b3480156104a157600080fd5b5061028f6104b036600461233e565b60076020526000908152604090205460ff1681565b3480156104d157600080fd5b506103436104e03660046126cf565b6110bd565b6103436104f3366004612692565b6111f0565b34801561050457600080fd5b50610518610513366004612714565b611437565b6040516001600160a01b03909116815260200161029b565b34801561053c57600080fd5b5061058661054b36600461233e565b6006602052600090815260409020546bffffffffffffffffffffffff8116906c0100000000000000000000000090046001600160a01b031682565b604080516bffffffffffffffffffffffff90931683526001600160a01b0390911660208301520161029b565b3480156105be57600080fd5b5061028f6105cd366004612425565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561060257600080fd5b506102d87fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b34801561063657600080fd5b506102d8600081565b34801561064b57600080fd5b506102d87f000000000000000000000000000000000000000000000000000000000000000081565b34801561067f57600080fd5b5061028f61068e366004612425565b611456565b34801561069f57600080fd5b506106b36106ae366004612692565b611559565b60405161029b9190612736565b3480156106cc57600080fd5b506103436106db36600461233e565b6115cc565b3480156106ec57600080fd5b506102d860085481565b34801561070257600080fd5b5061034361071136600461233e565b611735565b34801561072257600080fd5b5061034361073136600461233e565b611817565b34801561074257600080fd5b506102d8620f424081565b34801561075957600080fd5b506102d861076836600461233e565b61187f565b34801561077957600080fd5b506102d87f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b3480156107ad57600080fd5b506103436107bc366004612425565b611896565b3480156107cd57600080fd5b506102d86107dc36600461281c565b60036020526000908152604090205481565b3480156107fa57600080fd5b506102d860045481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f00000000000000000000000000000000000000000000000000000000148061085a575061085a826118bb565b92915050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561088a81611952565b6001600160a01b038316600090815260036020526040812054908190036108b15750505050565b6001600160a01b0384166000818152600360205260408120556108d590848361195f565b604080516001600160a01b038087168252851660208201529081018290527f244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd9060600160405180910390a1505b505050565b60008281526020819052604090206001015461094281611952565b61094c8383611a82565b50505050565b6001600160a01b0381163314610994576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109228282611ab7565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc46109c881611952565b8251602084012060006109da85611559565b9050600260008381526005602052604090205460ff166004811115610a0157610a01612357565b14610a38576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600660209081526040918290208251808401909352546bffffffffffffffffffffffff811683526c0100000000000000000000000090046001600160a01b03169082018190523314610abb576040517f4af43a9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516107089042036bffffffffffffffffffffffff1611610b08576040517f1992d0bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600560205260409020805460ff1916600317905561010082015115610b645761010082015160808301516001600160a01b031660009081526003602052604081208054909190610b5e908490612868565b90915550505b608082015160c0830151610b826001600160a01b038316888361195f565b604080516001600160a01b03848116825260208201849052891691339188917f582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac67891015b60405180910390a45050505050505050565b46816000015163ffffffff1603610c1a576040517f7029fdf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a08101511580610c2d575060c0810151155b15610c64576040517fe38820c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608101516001600160a01b03161580610c89575060808101516001600160a01b0316155b15610cc0576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ccc61070842612868565b8161010001511015610d0a576040517f04b7fcc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610d1f3083606001518460a00151611ae4565b90506000806002541115610d4c57620f424060025483610d3f919061287b565b610d499190612892565b90505b610d5681836128cd565b915060006040518061018001604052804663ffffffff168152602001856000015163ffffffff16815260200185602001516001600160a01b0316815260200185604001516001600160a01b0316815260200185606001516001600160a01b0316815260200185608001516001600160a01b031681526020018481526020018560c0015181526020018381526020018560e0015115158152602001856101000151815260200160086000815480929190610e0e906128e0565b909155509052604051610e249190602001612736565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152828252805160208083019190912060008181526005835293909320805460ff191660011790558701518751606089015160808a015160c08b015160e08c015195985095966001600160a01b039094169587957f120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a95610ed6958b959094909390928e9261293c565b60405180910390a35050505050565b805160208201206000610ef783611559565b3360009081527fd2043bf65931af3dbecf60d0db8f40e4160406d7beb00522f4200cf4944a1eb8602052604090205490915060ff1615610f74578061014001514211610f6f576040517fe15ff9ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc0565b62093a80816101400151610f889190612868565b4211610fc0576040517fe15ff9ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008381526005602052604090205460ff166004811115610fe557610fe5612357565b1461101c576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260056020526040808220805460ff19166004179055820151608083015161010084015160c0850151929391926110579190612868565b905061106d6001600160a01b038316848361195f565b604080516001600160a01b0384811682526020820184905285169187917fb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958910160405180910390a3505050505050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc46110e781611952565b82516020840120600160008281526005602052604090205460ff16600481111561111357611113612357565b1461114a576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526005602090815260408083208054600260ff19909116179055805180820182526bffffffffffffffffffffffff4281168252338285018181528787526006865295849020925195516001600160a01b03166c0100000000000000000000000002959091169490941790555185815283917f4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4910160405180910390a350505050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc461121a81611952565b81516020830120600061122c84611559565b90504663ffffffff16816020015163ffffffff1614611277576040517f7029fdf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8061014001514211156112b6576040517f559895a300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090205460ff16156112ff576040517fbef7bb7d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600760205260409020805460ff19166001179055606081015160a082015160e083015160045461012085015161134857506000611342848484611ae4565b506113b9565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b0384160161138c5761134284846113878486612868565b611ae4565b611397848484611ae4565b506113b78473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee83611ae4565b505b845160808087015160a08089015160c0808b015160e08c01516040805163ffffffff90991689526001600160a01b0396871660208a0152938616938801939093526060870152938501528301849052861691339189917ff8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c9101610bc5565b600082815260016020526040812061144f9083611cb3565b9392505050565b6000600260008481526005602052604090205460ff16600481111561147d5761147d612357565b146114b4576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600660209081526040918290208251808401909352546bffffffffffffffffffffffff811683526001600160a01b036c01000000000000000000000000909104811691830182905284161461153a576040517f4af43a9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516107089042036bffffffffffffffffffffffff1611949350505050565b604080516101808101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082018190526101608201528251909161085a91840181019084016129ed565b7f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d6115f681611952565b600260008381526005602052604090205460ff16600481111561161b5761161b612357565b14611652576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600660209081526040918290208251808401909352546bffffffffffffffffffffffff8082168085526c010000000000000000000000009092046001600160a01b031693909201929092526107089142031611156116e1576040517f3e908aac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600560209081526040808320805460ff19166001179055600690915280822082905551339184917f0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad49190a35050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561175f81611952565b6127108211156117d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e657746656552617465203e206d61780000000000000000000000000000000060448201526064015b60405180910390fd5b600280549083905560408051828152602081018590527f14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb95791015b60405180910390a1505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561184181611952565b600480549083905560408051828152602081018590527f5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa910161180a565b600081815260016020526040812061085a90611cbf565b6000828152602081905260409020600101546118b181611952565b61094c8383611ab7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061085a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461085a565b61195c8133611cc9565b50565b306001600160a01b0383160361197457505050565b8060000361198157505050565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b03841601611a6e576000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119fe576040519150601f19603f3d011682016040523d82523d6000602084013e611a03565b606091505b505090508061094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c65640000000000000000000000000060448201526064016117c7565b6109226001600160a01b0384168383611d39565b600080611a8f8484611dad565b9050801561144f576000848152600160205260409020611aaf9084611e57565b509392505050565b600080611ac48484611e6c565b9050801561144f576000848152600160205260409020611aaf9084611eef565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611c4d57611b1c836001600160a01b0316611f04565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528416906370a0823190602401602060405180830381865afa158015611b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9f9190612ab9565b9050611bb66001600160a01b038416338685611faa565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528291908516906370a0823190602401602060405180830381865afa158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c9190612ab9565b611c4691906128cd565b905061144f565b348214611c86576040517f81de0bf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384163014611caa57611caa6001600160a01b038416858461195f565b50349392505050565b600061144f8383611fe3565b600061085a825490565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16611d35576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016117c7565b5050565b6040516001600160a01b0383811660248301526044820183905261092291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061200d565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16611e4f576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611e073390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161085a565b50600061085a565b600061144f836001600160a01b038416612089565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1615611e4f576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161085a565b600061144f836001600160a01b0384166120d0565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b03821601611f66576040517f7f523fe800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b03163b60000361195c576040517f7f523fe800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b03848116602483015283811660448301526064820183905261094c9186918216906323b872dd90608401611d66565b6000826000018281548110611ffa57611ffa612ad2565b9060005260206000200154905092915050565b60006120226001600160a01b038416836121c3565b905080516000141580156120475750808060200190518101906120459190612b01565b155b15610922576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016117c7565b6000818152600183016020526040812054611e4f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561085a565b600081815260018301602052604081205480156121b95760006120f46001836128cd565b8554909150600090612108906001906128cd565b905080821461216d57600086600001828154811061212857612128612ad2565b906000526020600020015490508087600001848154811061214b5761214b612ad2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061217e5761217e612b1e565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061085a565b600091505061085a565b606061144f8383600084600080856001600160a01b031684866040516121e99190612b4d565b60006040518083038185875af1925050503d8060008114612226576040519150601f19603f3d011682016040523d82523d6000602084013e61222b565b606091505b509150915061223b868383612245565b9695505050505050565b60608261225a57612255826122ba565b61144f565b815115801561227157506001600160a01b0384163b155b156122b3576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016117c7565b508061144f565b8051156122ca5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561230e57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461144f57600080fd5b60006020828403121561235057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600583106123c1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6001600160a01b038116811461195c57600080fd5b80356123e7816123c7565b919050565b600080604083850312156123ff57600080fd5b823561240a816123c7565b9150602083013561241a816123c7565b809150509250929050565b6000806040838503121561243857600080fd5b82359150602083013561241a816123c7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff8111828210171561249d5761249d61244a565b60405290565b604051610180810167ffffffffffffffff8111828210171561249d5761249d61244a565b600082601f8301126124d857600080fd5b813567ffffffffffffffff808211156124f3576124f361244a565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156125395761253961244a565b8160405283815286602085880101111561255257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561258557600080fd5b823567ffffffffffffffff81111561259c57600080fd5b6125a8858286016124c7565b925050602083013561241a816123c7565b63ffffffff8116811461195c57600080fd5b80356123e7816125b9565b801515811461195c57600080fd5b80356123e7816125d6565b6000610120828403121561260257600080fd5b61260a612479565b612613836125cb565b8152612621602084016123dc565b6020820152612632604084016123dc565b6040820152612643606084016123dc565b6060820152612654608084016123dc565b608082015260a083013560a082015260c083013560c082015261267960e084016125e4565b60e0820152610100928301359281019290925250919050565b6000602082840312156126a457600080fd5b813567ffffffffffffffff8111156126bb57600080fd5b6126c7848285016124c7565b949350505050565b600080604083850312156126e257600080fd5b823567ffffffffffffffff8111156126f957600080fd5b612705858286016124c7565b95602094909401359450505050565b6000806040838503121561272757600080fd5b50508035926020909101359150565b815163ffffffff1681526101808101602083015161275c602084018263ffffffff169052565b50604083015161277760408401826001600160a01b03169052565b50606083015161279260608401826001600160a01b03169052565b5060808301516127ad60808401826001600160a01b03169052565b5060a08301516127c860a08401826001600160a01b03169052565b5060c083015160c083015260e083015160e0830152610100808401518184015250610120808401516127fd8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b60006020828403121561282e57600080fd5b813561144f816123c7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561085a5761085a612839565b808202811582820484141761085a5761085a612839565b6000826128c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561085a5761085a612839565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361291157612911612839565b5060010190565b60005b8381101561293357818101518382015260200161291b565b50506000910152565b60e08152600088518060e084015261010061295d8282860160208e01612918565b63ffffffff9990991660208401526001600160a01b039788166040840152959096166060820152608081019390935260a0830191909152151560c0820152601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190910192915050565b80516123e7816125b9565b80516123e7816123c7565b80516123e7816125d6565b60006101808284031215612a0057600080fd5b612a086124a3565b612a11836129cc565b8152612a1f602084016129cc565b6020820152612a30604084016129d7565b6040820152612a41606084016129d7565b6060820152612a52608084016129d7565b6080820152612a6360a084016129d7565b60a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120612a968185016129e2565b908201526101408381015190820152610160928301519281019290925250919050565b600060208284031215612acb57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612b1357600080fd5b815161144f816125d6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251612b5f818460208701612918565b919091019291505056fea2646970667358221220e9dd17881b30b52cd3cbfc5932ec6ff3c3a01111638264cfdff6ef34d478bd7764736f6c63430008140033", -} - -// FastBridgeABI is the input ABI used to generate the binding from. -// Deprecated: Use FastBridgeMetaData.ABI instead. -var FastBridgeABI = FastBridgeMetaData.ABI - -// Deprecated: Use FastBridgeMetaData.Sigs instead. -// FastBridgeFuncSigs maps the 4-byte function signature to its string representation. -var FastBridgeFuncSigs = FastBridgeMetaData.Sigs - -// FastBridgeBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use FastBridgeMetaData.Bin instead. -var FastBridgeBin = FastBridgeMetaData.Bin - -// DeployFastBridge deploys a new Ethereum contract, binding an instance of FastBridge to it. -func DeployFastBridge(auth *bind.TransactOpts, backend bind.ContractBackend, _owner common.Address) (common.Address, *types.Transaction, *FastBridge, error) { - parsed, err := FastBridgeMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(FastBridgeBin), backend, _owner) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &FastBridge{FastBridgeCaller: FastBridgeCaller{contract: contract}, FastBridgeTransactor: FastBridgeTransactor{contract: contract}, FastBridgeFilterer: FastBridgeFilterer{contract: contract}}, nil -} - -// FastBridge is an auto generated Go binding around an Ethereum contract. -type FastBridge struct { - FastBridgeCaller // Read-only binding to the contract - FastBridgeTransactor // Write-only binding to the contract - FastBridgeFilterer // Log filterer for contract events -} - -// FastBridgeCaller is an auto generated read-only Go binding around an Ethereum contract. -type FastBridgeCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// FastBridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. -type FastBridgeTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// FastBridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type FastBridgeFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// FastBridgeSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type FastBridgeSession struct { - Contract *FastBridge // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// FastBridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type FastBridgeCallerSession struct { - Contract *FastBridgeCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// FastBridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type FastBridgeTransactorSession struct { - Contract *FastBridgeTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// FastBridgeRaw is an auto generated low-level Go binding around an Ethereum contract. -type FastBridgeRaw struct { - Contract *FastBridge // Generic contract binding to access the raw methods on -} - -// FastBridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type FastBridgeCallerRaw struct { - Contract *FastBridgeCaller // Generic read-only contract binding to access the raw methods on -} - -// FastBridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type FastBridgeTransactorRaw struct { - Contract *FastBridgeTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewFastBridge creates a new instance of FastBridge, bound to a specific deployed contract. -func NewFastBridge(address common.Address, backend bind.ContractBackend) (*FastBridge, error) { - contract, err := bindFastBridge(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &FastBridge{FastBridgeCaller: FastBridgeCaller{contract: contract}, FastBridgeTransactor: FastBridgeTransactor{contract: contract}, FastBridgeFilterer: FastBridgeFilterer{contract: contract}}, nil -} - -// NewFastBridgeCaller creates a new read-only instance of FastBridge, bound to a specific deployed contract. -func NewFastBridgeCaller(address common.Address, caller bind.ContractCaller) (*FastBridgeCaller, error) { - contract, err := bindFastBridge(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &FastBridgeCaller{contract: contract}, nil -} - -// NewFastBridgeTransactor creates a new write-only instance of FastBridge, bound to a specific deployed contract. -func NewFastBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*FastBridgeTransactor, error) { - contract, err := bindFastBridge(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &FastBridgeTransactor{contract: contract}, nil -} - -// NewFastBridgeFilterer creates a new log filterer instance of FastBridge, bound to a specific deployed contract. -func NewFastBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*FastBridgeFilterer, error) { - contract, err := bindFastBridge(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &FastBridgeFilterer{contract: contract}, nil -} - -// bindFastBridge binds a generic wrapper to an already deployed contract. -func bindFastBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := FastBridgeMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_FastBridge *FastBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _FastBridge.Contract.FastBridgeCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_FastBridge *FastBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _FastBridge.Contract.FastBridgeTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_FastBridge *FastBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _FastBridge.Contract.FastBridgeTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_FastBridge *FastBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _FastBridge.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_FastBridge *FastBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _FastBridge.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_FastBridge *FastBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _FastBridge.Contract.contract.Transact(opts, method, params...) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCaller) DEFAULTADMINROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "DEFAULT_ADMIN_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeSession) DEFAULTADMINROLE() ([32]byte, error) { - return _FastBridge.Contract.DEFAULTADMINROLE(&_FastBridge.CallOpts) -} - -// DEFAULTADMINROLE is a free data retrieval call binding the contract method 0xa217fddf. -// -// Solidity: function DEFAULT_ADMIN_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCallerSession) DEFAULTADMINROLE() ([32]byte, error) { - return _FastBridge.Contract.DEFAULTADMINROLE(&_FastBridge.CallOpts) -} - -// DISPUTEPERIOD is a free data retrieval call binding the contract method 0xa5bbe22b. -// -// Solidity: function DISPUTE_PERIOD() view returns(uint256) -func (_FastBridge *FastBridgeCaller) DISPUTEPERIOD(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "DISPUTE_PERIOD") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// DISPUTEPERIOD is a free data retrieval call binding the contract method 0xa5bbe22b. -// -// Solidity: function DISPUTE_PERIOD() view returns(uint256) -func (_FastBridge *FastBridgeSession) DISPUTEPERIOD() (*big.Int, error) { - return _FastBridge.Contract.DISPUTEPERIOD(&_FastBridge.CallOpts) -} - -// DISPUTEPERIOD is a free data retrieval call binding the contract method 0xa5bbe22b. -// -// Solidity: function DISPUTE_PERIOD() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) DISPUTEPERIOD() (*big.Int, error) { - return _FastBridge.Contract.DISPUTEPERIOD(&_FastBridge.CallOpts) -} - -// FEEBPS is a free data retrieval call binding the contract method 0xbf333f2c. -// -// Solidity: function FEE_BPS() view returns(uint256) -func (_FastBridge *FastBridgeCaller) FEEBPS(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "FEE_BPS") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// FEEBPS is a free data retrieval call binding the contract method 0xbf333f2c. -// -// Solidity: function FEE_BPS() view returns(uint256) -func (_FastBridge *FastBridgeSession) FEEBPS() (*big.Int, error) { - return _FastBridge.Contract.FEEBPS(&_FastBridge.CallOpts) -} - -// FEEBPS is a free data retrieval call binding the contract method 0xbf333f2c. -// -// Solidity: function FEE_BPS() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) FEEBPS() (*big.Int, error) { - return _FastBridge.Contract.FEEBPS(&_FastBridge.CallOpts) -} - -// FEERATEMAX is a free data retrieval call binding the contract method 0x0f5f6ed7. -// -// Solidity: function FEE_RATE_MAX() view returns(uint256) -func (_FastBridge *FastBridgeCaller) FEERATEMAX(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "FEE_RATE_MAX") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// FEERATEMAX is a free data retrieval call binding the contract method 0x0f5f6ed7. -// -// Solidity: function FEE_RATE_MAX() view returns(uint256) -func (_FastBridge *FastBridgeSession) FEERATEMAX() (*big.Int, error) { - return _FastBridge.Contract.FEERATEMAX(&_FastBridge.CallOpts) -} - -// FEERATEMAX is a free data retrieval call binding the contract method 0x0f5f6ed7. -// -// Solidity: function FEE_RATE_MAX() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) FEERATEMAX() (*big.Int, error) { - return _FastBridge.Contract.FEERATEMAX(&_FastBridge.CallOpts) -} - -// GOVERNORROLE is a free data retrieval call binding the contract method 0xccc57490. -// -// Solidity: function GOVERNOR_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCaller) GOVERNORROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "GOVERNOR_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GOVERNORROLE is a free data retrieval call binding the contract method 0xccc57490. -// -// Solidity: function GOVERNOR_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeSession) GOVERNORROLE() ([32]byte, error) { - return _FastBridge.Contract.GOVERNORROLE(&_FastBridge.CallOpts) -} - -// GOVERNORROLE is a free data retrieval call binding the contract method 0xccc57490. -// -// Solidity: function GOVERNOR_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCallerSession) GOVERNORROLE() ([32]byte, error) { - return _FastBridge.Contract.GOVERNORROLE(&_FastBridge.CallOpts) -} - -// GUARDROLE is a free data retrieval call binding the contract method 0x03ed0ee5. -// -// Solidity: function GUARD_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCaller) GUARDROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "GUARD_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GUARDROLE is a free data retrieval call binding the contract method 0x03ed0ee5. -// -// Solidity: function GUARD_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeSession) GUARDROLE() ([32]byte, error) { - return _FastBridge.Contract.GUARDROLE(&_FastBridge.CallOpts) -} - -// GUARDROLE is a free data retrieval call binding the contract method 0x03ed0ee5. -// -// Solidity: function GUARD_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCallerSession) GUARDROLE() ([32]byte, error) { - return _FastBridge.Contract.GUARDROLE(&_FastBridge.CallOpts) -} - -// MINDEADLINEPERIOD is a free data retrieval call binding the contract method 0x820688d5. -// -// Solidity: function MIN_DEADLINE_PERIOD() view returns(uint256) -func (_FastBridge *FastBridgeCaller) MINDEADLINEPERIOD(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "MIN_DEADLINE_PERIOD") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// MINDEADLINEPERIOD is a free data retrieval call binding the contract method 0x820688d5. -// -// Solidity: function MIN_DEADLINE_PERIOD() view returns(uint256) -func (_FastBridge *FastBridgeSession) MINDEADLINEPERIOD() (*big.Int, error) { - return _FastBridge.Contract.MINDEADLINEPERIOD(&_FastBridge.CallOpts) -} - -// MINDEADLINEPERIOD is a free data retrieval call binding the contract method 0x820688d5. -// -// Solidity: function MIN_DEADLINE_PERIOD() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) MINDEADLINEPERIOD() (*big.Int, error) { - return _FastBridge.Contract.MINDEADLINEPERIOD(&_FastBridge.CallOpts) -} - -// REFUNDERROLE is a free data retrieval call binding the contract method 0x5960ccf2. -// -// Solidity: function REFUNDER_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCaller) REFUNDERROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "REFUNDER_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// REFUNDERROLE is a free data retrieval call binding the contract method 0x5960ccf2. -// -// Solidity: function REFUNDER_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeSession) REFUNDERROLE() ([32]byte, error) { - return _FastBridge.Contract.REFUNDERROLE(&_FastBridge.CallOpts) -} - -// REFUNDERROLE is a free data retrieval call binding the contract method 0x5960ccf2. -// -// Solidity: function REFUNDER_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCallerSession) REFUNDERROLE() ([32]byte, error) { - return _FastBridge.Contract.REFUNDERROLE(&_FastBridge.CallOpts) -} - -// REFUNDDELAY is a free data retrieval call binding the contract method 0x190da595. -// -// Solidity: function REFUND_DELAY() view returns(uint256) -func (_FastBridge *FastBridgeCaller) REFUNDDELAY(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "REFUND_DELAY") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// REFUNDDELAY is a free data retrieval call binding the contract method 0x190da595. -// -// Solidity: function REFUND_DELAY() view returns(uint256) -func (_FastBridge *FastBridgeSession) REFUNDDELAY() (*big.Int, error) { - return _FastBridge.Contract.REFUNDDELAY(&_FastBridge.CallOpts) -} - -// REFUNDDELAY is a free data retrieval call binding the contract method 0x190da595. -// -// Solidity: function REFUND_DELAY() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) REFUNDDELAY() (*big.Int, error) { - return _FastBridge.Contract.REFUNDDELAY(&_FastBridge.CallOpts) -} - -// RELAYERROLE is a free data retrieval call binding the contract method 0x926d7d7f. -// -// Solidity: function RELAYER_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCaller) RELAYERROLE(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "RELAYER_ROLE") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// RELAYERROLE is a free data retrieval call binding the contract method 0x926d7d7f. -// -// Solidity: function RELAYER_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeSession) RELAYERROLE() ([32]byte, error) { - return _FastBridge.Contract.RELAYERROLE(&_FastBridge.CallOpts) -} - -// RELAYERROLE is a free data retrieval call binding the contract method 0x926d7d7f. -// -// Solidity: function RELAYER_ROLE() view returns(bytes32) -func (_FastBridge *FastBridgeCallerSession) RELAYERROLE() ([32]byte, error) { - return _FastBridge.Contract.RELAYERROLE(&_FastBridge.CallOpts) -} - -// BridgeProofs is a free data retrieval call binding the contract method 0x91ad5039. -// -// Solidity: function bridgeProofs(bytes32 ) view returns(uint96 timestamp, address relayer) -func (_FastBridge *FastBridgeCaller) BridgeProofs(opts *bind.CallOpts, arg0 [32]byte) (struct { - Timestamp *big.Int - Relayer common.Address -}, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "bridgeProofs", arg0) - - outstruct := new(struct { - Timestamp *big.Int - Relayer common.Address - }) - if err != nil { - return *outstruct, err - } - - outstruct.Timestamp = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - outstruct.Relayer = *abi.ConvertType(out[1], new(common.Address)).(*common.Address) - - return *outstruct, err - -} - -// BridgeProofs is a free data retrieval call binding the contract method 0x91ad5039. -// -// Solidity: function bridgeProofs(bytes32 ) view returns(uint96 timestamp, address relayer) -func (_FastBridge *FastBridgeSession) BridgeProofs(arg0 [32]byte) (struct { - Timestamp *big.Int - Relayer common.Address -}, error) { - return _FastBridge.Contract.BridgeProofs(&_FastBridge.CallOpts, arg0) -} - -// BridgeProofs is a free data retrieval call binding the contract method 0x91ad5039. -// -// Solidity: function bridgeProofs(bytes32 ) view returns(uint96 timestamp, address relayer) -func (_FastBridge *FastBridgeCallerSession) BridgeProofs(arg0 [32]byte) (struct { - Timestamp *big.Int - Relayer common.Address -}, error) { - return _FastBridge.Contract.BridgeProofs(&_FastBridge.CallOpts, arg0) -} - -// BridgeRelays is a free data retrieval call binding the contract method 0x8379a24f. -// -// Solidity: function bridgeRelays(bytes32 ) view returns(bool) -func (_FastBridge *FastBridgeCaller) BridgeRelays(opts *bind.CallOpts, arg0 [32]byte) (bool, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "bridgeRelays", arg0) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// BridgeRelays is a free data retrieval call binding the contract method 0x8379a24f. -// -// Solidity: function bridgeRelays(bytes32 ) view returns(bool) -func (_FastBridge *FastBridgeSession) BridgeRelays(arg0 [32]byte) (bool, error) { - return _FastBridge.Contract.BridgeRelays(&_FastBridge.CallOpts, arg0) -} - -// BridgeRelays is a free data retrieval call binding the contract method 0x8379a24f. -// -// Solidity: function bridgeRelays(bytes32 ) view returns(bool) -func (_FastBridge *FastBridgeCallerSession) BridgeRelays(arg0 [32]byte) (bool, error) { - return _FastBridge.Contract.BridgeRelays(&_FastBridge.CallOpts, arg0) -} - -// BridgeStatuses is a free data retrieval call binding the contract method 0x051287bc. -// -// Solidity: function bridgeStatuses(bytes32 ) view returns(uint8) -func (_FastBridge *FastBridgeCaller) BridgeStatuses(opts *bind.CallOpts, arg0 [32]byte) (uint8, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "bridgeStatuses", arg0) - - if err != nil { - return *new(uint8), err - } - - out0 := *abi.ConvertType(out[0], new(uint8)).(*uint8) - - return out0, err - -} - -// BridgeStatuses is a free data retrieval call binding the contract method 0x051287bc. -// -// Solidity: function bridgeStatuses(bytes32 ) view returns(uint8) -func (_FastBridge *FastBridgeSession) BridgeStatuses(arg0 [32]byte) (uint8, error) { - return _FastBridge.Contract.BridgeStatuses(&_FastBridge.CallOpts, arg0) -} - -// BridgeStatuses is a free data retrieval call binding the contract method 0x051287bc. -// -// Solidity: function bridgeStatuses(bytes32 ) view returns(uint8) -func (_FastBridge *FastBridgeCallerSession) BridgeStatuses(arg0 [32]byte) (uint8, error) { - return _FastBridge.Contract.BridgeStatuses(&_FastBridge.CallOpts, arg0) -} - -// CanClaim is a free data retrieval call binding the contract method 0xaa9641ab. -// -// Solidity: function canClaim(bytes32 transactionId, address relayer) view returns(bool) -func (_FastBridge *FastBridgeCaller) CanClaim(opts *bind.CallOpts, transactionId [32]byte, relayer common.Address) (bool, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "canClaim", transactionId, relayer) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// CanClaim is a free data retrieval call binding the contract method 0xaa9641ab. -// -// Solidity: function canClaim(bytes32 transactionId, address relayer) view returns(bool) -func (_FastBridge *FastBridgeSession) CanClaim(transactionId [32]byte, relayer common.Address) (bool, error) { - return _FastBridge.Contract.CanClaim(&_FastBridge.CallOpts, transactionId, relayer) -} - -// CanClaim is a free data retrieval call binding the contract method 0xaa9641ab. -// -// Solidity: function canClaim(bytes32 transactionId, address relayer) view returns(bool) -func (_FastBridge *FastBridgeCallerSession) CanClaim(transactionId [32]byte, relayer common.Address) (bool, error) { - return _FastBridge.Contract.CanClaim(&_FastBridge.CallOpts, transactionId, relayer) -} - -// ChainGasAmount is a free data retrieval call binding the contract method 0xe00a83e0. -// -// Solidity: function chainGasAmount() view returns(uint256) -func (_FastBridge *FastBridgeCaller) ChainGasAmount(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "chainGasAmount") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ChainGasAmount is a free data retrieval call binding the contract method 0xe00a83e0. -// -// Solidity: function chainGasAmount() view returns(uint256) -func (_FastBridge *FastBridgeSession) ChainGasAmount() (*big.Int, error) { - return _FastBridge.Contract.ChainGasAmount(&_FastBridge.CallOpts) -} - -// ChainGasAmount is a free data retrieval call binding the contract method 0xe00a83e0. -// -// Solidity: function chainGasAmount() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) ChainGasAmount() (*big.Int, error) { - return _FastBridge.Contract.ChainGasAmount(&_FastBridge.CallOpts) -} - -// DeployBlock is a free data retrieval call binding the contract method 0xa3ec191a. -// -// Solidity: function deployBlock() view returns(uint256) -func (_FastBridge *FastBridgeCaller) DeployBlock(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "deployBlock") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// DeployBlock is a free data retrieval call binding the contract method 0xa3ec191a. -// -// Solidity: function deployBlock() view returns(uint256) -func (_FastBridge *FastBridgeSession) DeployBlock() (*big.Int, error) { - return _FastBridge.Contract.DeployBlock(&_FastBridge.CallOpts) -} - -// DeployBlock is a free data retrieval call binding the contract method 0xa3ec191a. -// -// Solidity: function deployBlock() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) DeployBlock() (*big.Int, error) { - return _FastBridge.Contract.DeployBlock(&_FastBridge.CallOpts) -} - -// GetBridgeTransaction is a free data retrieval call binding the contract method 0xac11fb1a. -// -// Solidity: function getBridgeTransaction(bytes request) pure returns((uint32,uint32,address,address,address,address,uint256,uint256,uint256,bool,uint256,uint256)) -func (_FastBridge *FastBridgeCaller) GetBridgeTransaction(opts *bind.CallOpts, request []byte) (IFastBridgeBridgeTransaction, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "getBridgeTransaction", request) - - if err != nil { - return *new(IFastBridgeBridgeTransaction), err - } - - out0 := *abi.ConvertType(out[0], new(IFastBridgeBridgeTransaction)).(*IFastBridgeBridgeTransaction) - - return out0, err - -} - -// GetBridgeTransaction is a free data retrieval call binding the contract method 0xac11fb1a. -// -// Solidity: function getBridgeTransaction(bytes request) pure returns((uint32,uint32,address,address,address,address,uint256,uint256,uint256,bool,uint256,uint256)) -func (_FastBridge *FastBridgeSession) GetBridgeTransaction(request []byte) (IFastBridgeBridgeTransaction, error) { - return _FastBridge.Contract.GetBridgeTransaction(&_FastBridge.CallOpts, request) -} - -// GetBridgeTransaction is a free data retrieval call binding the contract method 0xac11fb1a. -// -// Solidity: function getBridgeTransaction(bytes request) pure returns((uint32,uint32,address,address,address,address,uint256,uint256,uint256,bool,uint256,uint256)) -func (_FastBridge *FastBridgeCallerSession) GetBridgeTransaction(request []byte) (IFastBridgeBridgeTransaction, error) { - return _FastBridge.Contract.GetBridgeTransaction(&_FastBridge.CallOpts, request) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_FastBridge *FastBridgeCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_FastBridge *FastBridgeSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _FastBridge.Contract.GetRoleAdmin(&_FastBridge.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_FastBridge *FastBridgeCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _FastBridge.Contract.GetRoleAdmin(&_FastBridge.CallOpts, role) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_FastBridge *FastBridgeCaller) GetRoleMember(opts *bind.CallOpts, role [32]byte, index *big.Int) (common.Address, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "getRoleMember", role, index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_FastBridge *FastBridgeSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _FastBridge.Contract.GetRoleMember(&_FastBridge.CallOpts, role, index) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_FastBridge *FastBridgeCallerSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _FastBridge.Contract.GetRoleMember(&_FastBridge.CallOpts, role, index) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_FastBridge *FastBridgeCaller) GetRoleMemberCount(opts *bind.CallOpts, role [32]byte) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "getRoleMemberCount", role) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_FastBridge *FastBridgeSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _FastBridge.Contract.GetRoleMemberCount(&_FastBridge.CallOpts, role) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _FastBridge.Contract.GetRoleMemberCount(&_FastBridge.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_FastBridge *FastBridgeCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_FastBridge *FastBridgeSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _FastBridge.Contract.HasRole(&_FastBridge.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_FastBridge *FastBridgeCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _FastBridge.Contract.HasRole(&_FastBridge.CallOpts, role, account) -} - -// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. -// -// Solidity: function nonce() view returns(uint256) -func (_FastBridge *FastBridgeCaller) Nonce(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "nonce") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. -// -// Solidity: function nonce() view returns(uint256) -func (_FastBridge *FastBridgeSession) Nonce() (*big.Int, error) { - return _FastBridge.Contract.Nonce(&_FastBridge.CallOpts) -} - -// Nonce is a free data retrieval call binding the contract method 0xaffed0e0. -// -// Solidity: function nonce() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) Nonce() (*big.Int, error) { - return _FastBridge.Contract.Nonce(&_FastBridge.CallOpts) -} - -// ProtocolFeeRate is a free data retrieval call binding the contract method 0x58f85880. -// -// Solidity: function protocolFeeRate() view returns(uint256) -func (_FastBridge *FastBridgeCaller) ProtocolFeeRate(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "protocolFeeRate") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ProtocolFeeRate is a free data retrieval call binding the contract method 0x58f85880. -// -// Solidity: function protocolFeeRate() view returns(uint256) -func (_FastBridge *FastBridgeSession) ProtocolFeeRate() (*big.Int, error) { - return _FastBridge.Contract.ProtocolFeeRate(&_FastBridge.CallOpts) -} - -// ProtocolFeeRate is a free data retrieval call binding the contract method 0x58f85880. -// -// Solidity: function protocolFeeRate() view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) ProtocolFeeRate() (*big.Int, error) { - return _FastBridge.Contract.ProtocolFeeRate(&_FastBridge.CallOpts) -} - -// ProtocolFees is a free data retrieval call binding the contract method 0xdcf844a7. -// -// Solidity: function protocolFees(address ) view returns(uint256) -func (_FastBridge *FastBridgeCaller) ProtocolFees(opts *bind.CallOpts, arg0 common.Address) (*big.Int, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "protocolFees", arg0) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// ProtocolFees is a free data retrieval call binding the contract method 0xdcf844a7. -// -// Solidity: function protocolFees(address ) view returns(uint256) -func (_FastBridge *FastBridgeSession) ProtocolFees(arg0 common.Address) (*big.Int, error) { - return _FastBridge.Contract.ProtocolFees(&_FastBridge.CallOpts, arg0) -} - -// ProtocolFees is a free data retrieval call binding the contract method 0xdcf844a7. -// -// Solidity: function protocolFees(address ) view returns(uint256) -func (_FastBridge *FastBridgeCallerSession) ProtocolFees(arg0 common.Address) (*big.Int, error) { - return _FastBridge.Contract.ProtocolFees(&_FastBridge.CallOpts, arg0) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_FastBridge *FastBridgeCaller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _FastBridge.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_FastBridge *FastBridgeSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _FastBridge.Contract.SupportsInterface(&_FastBridge.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_FastBridge *FastBridgeCallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _FastBridge.Contract.SupportsInterface(&_FastBridge.CallOpts, interfaceId) -} - -// Bridge is a paid mutator transaction binding the contract method 0x45851694. -// -// Solidity: function bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256) params) payable returns() -func (_FastBridge *FastBridgeTransactor) Bridge(opts *bind.TransactOpts, params IFastBridgeBridgeParams) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "bridge", params) -} - -// Bridge is a paid mutator transaction binding the contract method 0x45851694. -// -// Solidity: function bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256) params) payable returns() -func (_FastBridge *FastBridgeSession) Bridge(params IFastBridgeBridgeParams) (*types.Transaction, error) { - return _FastBridge.Contract.Bridge(&_FastBridge.TransactOpts, params) -} - -// Bridge is a paid mutator transaction binding the contract method 0x45851694. -// -// Solidity: function bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256) params) payable returns() -func (_FastBridge *FastBridgeTransactorSession) Bridge(params IFastBridgeBridgeParams) (*types.Transaction, error) { - return _FastBridge.Contract.Bridge(&_FastBridge.TransactOpts, params) -} - -// Claim is a paid mutator transaction binding the contract method 0x41fcb612. -// -// Solidity: function claim(bytes request, address to) returns() -func (_FastBridge *FastBridgeTransactor) Claim(opts *bind.TransactOpts, request []byte, to common.Address) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "claim", request, to) -} - -// Claim is a paid mutator transaction binding the contract method 0x41fcb612. -// -// Solidity: function claim(bytes request, address to) returns() -func (_FastBridge *FastBridgeSession) Claim(request []byte, to common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.Claim(&_FastBridge.TransactOpts, request, to) -} - -// Claim is a paid mutator transaction binding the contract method 0x41fcb612. -// -// Solidity: function claim(bytes request, address to) returns() -func (_FastBridge *FastBridgeTransactorSession) Claim(request []byte, to common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.Claim(&_FastBridge.TransactOpts, request, to) -} - -// Dispute is a paid mutator transaction binding the contract method 0xadd98c70. -// -// Solidity: function dispute(bytes32 transactionId) returns() -func (_FastBridge *FastBridgeTransactor) Dispute(opts *bind.TransactOpts, transactionId [32]byte) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "dispute", transactionId) -} - -// Dispute is a paid mutator transaction binding the contract method 0xadd98c70. -// -// Solidity: function dispute(bytes32 transactionId) returns() -func (_FastBridge *FastBridgeSession) Dispute(transactionId [32]byte) (*types.Transaction, error) { - return _FastBridge.Contract.Dispute(&_FastBridge.TransactOpts, transactionId) -} - -// Dispute is a paid mutator transaction binding the contract method 0xadd98c70. -// -// Solidity: function dispute(bytes32 transactionId) returns() -func (_FastBridge *FastBridgeTransactorSession) Dispute(transactionId [32]byte) (*types.Transaction, error) { - return _FastBridge.Contract.Dispute(&_FastBridge.TransactOpts, transactionId) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_FastBridge *FastBridgeTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_FastBridge *FastBridgeSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.GrantRole(&_FastBridge.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_FastBridge *FastBridgeTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.GrantRole(&_FastBridge.TransactOpts, role, account) -} - -// Prove is a paid mutator transaction binding the contract method 0x886d36ff. -// -// Solidity: function prove(bytes request, bytes32 destTxHash) returns() -func (_FastBridge *FastBridgeTransactor) Prove(opts *bind.TransactOpts, request []byte, destTxHash [32]byte) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "prove", request, destTxHash) -} - -// Prove is a paid mutator transaction binding the contract method 0x886d36ff. -// -// Solidity: function prove(bytes request, bytes32 destTxHash) returns() -func (_FastBridge *FastBridgeSession) Prove(request []byte, destTxHash [32]byte) (*types.Transaction, error) { - return _FastBridge.Contract.Prove(&_FastBridge.TransactOpts, request, destTxHash) -} - -// Prove is a paid mutator transaction binding the contract method 0x886d36ff. -// -// Solidity: function prove(bytes request, bytes32 destTxHash) returns() -func (_FastBridge *FastBridgeTransactorSession) Prove(request []byte, destTxHash [32]byte) (*types.Transaction, error) { - return _FastBridge.Contract.Prove(&_FastBridge.TransactOpts, request, destTxHash) -} - -// Refund is a paid mutator transaction binding the contract method 0x5eb7d946. -// -// Solidity: function refund(bytes request) returns() -func (_FastBridge *FastBridgeTransactor) Refund(opts *bind.TransactOpts, request []byte) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "refund", request) -} - -// Refund is a paid mutator transaction binding the contract method 0x5eb7d946. -// -// Solidity: function refund(bytes request) returns() -func (_FastBridge *FastBridgeSession) Refund(request []byte) (*types.Transaction, error) { - return _FastBridge.Contract.Refund(&_FastBridge.TransactOpts, request) -} - -// Refund is a paid mutator transaction binding the contract method 0x5eb7d946. -// -// Solidity: function refund(bytes request) returns() -func (_FastBridge *FastBridgeTransactorSession) Refund(request []byte) (*types.Transaction, error) { - return _FastBridge.Contract.Refund(&_FastBridge.TransactOpts, request) -} - -// Relay is a paid mutator transaction binding the contract method 0x8f0d6f17. -// -// Solidity: function relay(bytes request) payable returns() -func (_FastBridge *FastBridgeTransactor) Relay(opts *bind.TransactOpts, request []byte) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "relay", request) -} - -// Relay is a paid mutator transaction binding the contract method 0x8f0d6f17. -// -// Solidity: function relay(bytes request) payable returns() -func (_FastBridge *FastBridgeSession) Relay(request []byte) (*types.Transaction, error) { - return _FastBridge.Contract.Relay(&_FastBridge.TransactOpts, request) -} - -// Relay is a paid mutator transaction binding the contract method 0x8f0d6f17. -// -// Solidity: function relay(bytes request) payable returns() -func (_FastBridge *FastBridgeTransactorSession) Relay(request []byte) (*types.Transaction, error) { - return _FastBridge.Contract.Relay(&_FastBridge.TransactOpts, request) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_FastBridge *FastBridgeTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "renounceRole", role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_FastBridge *FastBridgeSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.RenounceRole(&_FastBridge.TransactOpts, role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_FastBridge *FastBridgeTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.RenounceRole(&_FastBridge.TransactOpts, role, callerConfirmation) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_FastBridge *FastBridgeTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_FastBridge *FastBridgeSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.RevokeRole(&_FastBridge.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_FastBridge *FastBridgeTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.RevokeRole(&_FastBridge.TransactOpts, role, account) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_FastBridge *FastBridgeTransactor) SetChainGasAmount(opts *bind.TransactOpts, newChainGasAmount *big.Int) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "setChainGasAmount", newChainGasAmount) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_FastBridge *FastBridgeSession) SetChainGasAmount(newChainGasAmount *big.Int) (*types.Transaction, error) { - return _FastBridge.Contract.SetChainGasAmount(&_FastBridge.TransactOpts, newChainGasAmount) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_FastBridge *FastBridgeTransactorSession) SetChainGasAmount(newChainGasAmount *big.Int) (*types.Transaction, error) { - return _FastBridge.Contract.SetChainGasAmount(&_FastBridge.TransactOpts, newChainGasAmount) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_FastBridge *FastBridgeTransactor) SetProtocolFeeRate(opts *bind.TransactOpts, newFeeRate *big.Int) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "setProtocolFeeRate", newFeeRate) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_FastBridge *FastBridgeSession) SetProtocolFeeRate(newFeeRate *big.Int) (*types.Transaction, error) { - return _FastBridge.Contract.SetProtocolFeeRate(&_FastBridge.TransactOpts, newFeeRate) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_FastBridge *FastBridgeTransactorSession) SetProtocolFeeRate(newFeeRate *big.Int) (*types.Transaction, error) { - return _FastBridge.Contract.SetProtocolFeeRate(&_FastBridge.TransactOpts, newFeeRate) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_FastBridge *FastBridgeTransactor) SweepProtocolFees(opts *bind.TransactOpts, token common.Address, recipient common.Address) (*types.Transaction, error) { - return _FastBridge.contract.Transact(opts, "sweepProtocolFees", token, recipient) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_FastBridge *FastBridgeSession) SweepProtocolFees(token common.Address, recipient common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.SweepProtocolFees(&_FastBridge.TransactOpts, token, recipient) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_FastBridge *FastBridgeTransactorSession) SweepProtocolFees(token common.Address, recipient common.Address) (*types.Transaction, error) { - return _FastBridge.Contract.SweepProtocolFees(&_FastBridge.TransactOpts, token, recipient) -} - -// FastBridgeBridgeDepositClaimedIterator is returned from FilterBridgeDepositClaimed and is used to iterate over the raw logs and unpacked data for BridgeDepositClaimed events raised by the FastBridge contract. -type FastBridgeBridgeDepositClaimedIterator struct { - Event *FastBridgeBridgeDepositClaimed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeBridgeDepositClaimedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeDepositClaimed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeDepositClaimed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeBridgeDepositClaimedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeBridgeDepositClaimedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeBridgeDepositClaimed represents a BridgeDepositClaimed event raised by the FastBridge contract. -type FastBridgeBridgeDepositClaimed struct { - TransactionId [32]byte - Relayer common.Address - To common.Address - Token common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeDepositClaimed is a free log retrieval operation binding the contract event 0x582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac678. -// -// Solidity: event BridgeDepositClaimed(bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount) -func (_FastBridge *FastBridgeFilterer) FilterBridgeDepositClaimed(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address, to []common.Address) (*FastBridgeBridgeDepositClaimedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "BridgeDepositClaimed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return &FastBridgeBridgeDepositClaimedIterator{contract: _FastBridge.contract, event: "BridgeDepositClaimed", logs: logs, sub: sub}, nil -} - -// WatchBridgeDepositClaimed is a free log subscription operation binding the contract event 0x582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac678. -// -// Solidity: event BridgeDepositClaimed(bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount) -func (_FastBridge *FastBridgeFilterer) WatchBridgeDepositClaimed(opts *bind.WatchOpts, sink chan<- *FastBridgeBridgeDepositClaimed, transactionId [][32]byte, relayer []common.Address, to []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "BridgeDepositClaimed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeBridgeDepositClaimed) - if err := _FastBridge.contract.UnpackLog(event, "BridgeDepositClaimed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeDepositClaimed is a log parse operation binding the contract event 0x582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac678. -// -// Solidity: event BridgeDepositClaimed(bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount) -func (_FastBridge *FastBridgeFilterer) ParseBridgeDepositClaimed(log types.Log) (*FastBridgeBridgeDepositClaimed, error) { - event := new(FastBridgeBridgeDepositClaimed) - if err := _FastBridge.contract.UnpackLog(event, "BridgeDepositClaimed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeBridgeDepositRefundedIterator is returned from FilterBridgeDepositRefunded and is used to iterate over the raw logs and unpacked data for BridgeDepositRefunded events raised by the FastBridge contract. -type FastBridgeBridgeDepositRefundedIterator struct { - Event *FastBridgeBridgeDepositRefunded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeBridgeDepositRefundedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeDepositRefunded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeDepositRefunded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeBridgeDepositRefundedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeBridgeDepositRefundedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeBridgeDepositRefunded represents a BridgeDepositRefunded event raised by the FastBridge contract. -type FastBridgeBridgeDepositRefunded struct { - TransactionId [32]byte - To common.Address - Token common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeDepositRefunded is a free log retrieval operation binding the contract event 0xb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958. -// -// Solidity: event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount) -func (_FastBridge *FastBridgeFilterer) FilterBridgeDepositRefunded(opts *bind.FilterOpts, transactionId [][32]byte, to []common.Address) (*FastBridgeBridgeDepositRefundedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "BridgeDepositRefunded", transactionIdRule, toRule) - if err != nil { - return nil, err - } - return &FastBridgeBridgeDepositRefundedIterator{contract: _FastBridge.contract, event: "BridgeDepositRefunded", logs: logs, sub: sub}, nil -} - -// WatchBridgeDepositRefunded is a free log subscription operation binding the contract event 0xb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958. -// -// Solidity: event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount) -func (_FastBridge *FastBridgeFilterer) WatchBridgeDepositRefunded(opts *bind.WatchOpts, sink chan<- *FastBridgeBridgeDepositRefunded, transactionId [][32]byte, to []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "BridgeDepositRefunded", transactionIdRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeBridgeDepositRefunded) - if err := _FastBridge.contract.UnpackLog(event, "BridgeDepositRefunded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeDepositRefunded is a log parse operation binding the contract event 0xb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958. -// -// Solidity: event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount) -func (_FastBridge *FastBridgeFilterer) ParseBridgeDepositRefunded(log types.Log) (*FastBridgeBridgeDepositRefunded, error) { - event := new(FastBridgeBridgeDepositRefunded) - if err := _FastBridge.contract.UnpackLog(event, "BridgeDepositRefunded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeBridgeProofDisputedIterator is returned from FilterBridgeProofDisputed and is used to iterate over the raw logs and unpacked data for BridgeProofDisputed events raised by the FastBridge contract. -type FastBridgeBridgeProofDisputedIterator struct { - Event *FastBridgeBridgeProofDisputed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeBridgeProofDisputedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeProofDisputed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeProofDisputed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeBridgeProofDisputedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeBridgeProofDisputedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeBridgeProofDisputed represents a BridgeProofDisputed event raised by the FastBridge contract. -type FastBridgeBridgeProofDisputed struct { - TransactionId [32]byte - Relayer common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeProofDisputed is a free log retrieval operation binding the contract event 0x0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad4. -// -// Solidity: event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer) -func (_FastBridge *FastBridgeFilterer) FilterBridgeProofDisputed(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address) (*FastBridgeBridgeProofDisputedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "BridgeProofDisputed", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return &FastBridgeBridgeProofDisputedIterator{contract: _FastBridge.contract, event: "BridgeProofDisputed", logs: logs, sub: sub}, nil -} - -// WatchBridgeProofDisputed is a free log subscription operation binding the contract event 0x0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad4. -// -// Solidity: event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer) -func (_FastBridge *FastBridgeFilterer) WatchBridgeProofDisputed(opts *bind.WatchOpts, sink chan<- *FastBridgeBridgeProofDisputed, transactionId [][32]byte, relayer []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "BridgeProofDisputed", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeBridgeProofDisputed) - if err := _FastBridge.contract.UnpackLog(event, "BridgeProofDisputed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeProofDisputed is a log parse operation binding the contract event 0x0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad4. -// -// Solidity: event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer) -func (_FastBridge *FastBridgeFilterer) ParseBridgeProofDisputed(log types.Log) (*FastBridgeBridgeProofDisputed, error) { - event := new(FastBridgeBridgeProofDisputed) - if err := _FastBridge.contract.UnpackLog(event, "BridgeProofDisputed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeBridgeProofProvidedIterator is returned from FilterBridgeProofProvided and is used to iterate over the raw logs and unpacked data for BridgeProofProvided events raised by the FastBridge contract. -type FastBridgeBridgeProofProvidedIterator struct { - Event *FastBridgeBridgeProofProvided // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeBridgeProofProvidedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeProofProvided) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeProofProvided) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeBridgeProofProvidedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeBridgeProofProvidedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeBridgeProofProvided represents a BridgeProofProvided event raised by the FastBridge contract. -type FastBridgeBridgeProofProvided struct { - TransactionId [32]byte - Relayer common.Address - TransactionHash [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeProofProvided is a free log retrieval operation binding the contract event 0x4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4. -// -// Solidity: event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash) -func (_FastBridge *FastBridgeFilterer) FilterBridgeProofProvided(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address) (*FastBridgeBridgeProofProvidedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "BridgeProofProvided", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return &FastBridgeBridgeProofProvidedIterator{contract: _FastBridge.contract, event: "BridgeProofProvided", logs: logs, sub: sub}, nil -} - -// WatchBridgeProofProvided is a free log subscription operation binding the contract event 0x4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4. -// -// Solidity: event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash) -func (_FastBridge *FastBridgeFilterer) WatchBridgeProofProvided(opts *bind.WatchOpts, sink chan<- *FastBridgeBridgeProofProvided, transactionId [][32]byte, relayer []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "BridgeProofProvided", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeBridgeProofProvided) - if err := _FastBridge.contract.UnpackLog(event, "BridgeProofProvided", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeProofProvided is a log parse operation binding the contract event 0x4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4. -// -// Solidity: event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash) -func (_FastBridge *FastBridgeFilterer) ParseBridgeProofProvided(log types.Log) (*FastBridgeBridgeProofProvided, error) { - event := new(FastBridgeBridgeProofProvided) - if err := _FastBridge.contract.UnpackLog(event, "BridgeProofProvided", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeBridgeRelayedIterator is returned from FilterBridgeRelayed and is used to iterate over the raw logs and unpacked data for BridgeRelayed events raised by the FastBridge contract. -type FastBridgeBridgeRelayedIterator struct { - Event *FastBridgeBridgeRelayed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeBridgeRelayedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeRelayed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeRelayed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeBridgeRelayedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeBridgeRelayedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeBridgeRelayed represents a BridgeRelayed event raised by the FastBridge contract. -type FastBridgeBridgeRelayed struct { - TransactionId [32]byte - Relayer common.Address - To common.Address - OriginChainId uint32 - OriginToken common.Address - DestToken common.Address - OriginAmount *big.Int - DestAmount *big.Int - ChainGasAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeRelayed is a free log retrieval operation binding the contract event 0xf8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c. -// -// Solidity: event BridgeRelayed(bytes32 indexed transactionId, address indexed relayer, address indexed to, uint32 originChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, uint256 chainGasAmount) -func (_FastBridge *FastBridgeFilterer) FilterBridgeRelayed(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address, to []common.Address) (*FastBridgeBridgeRelayedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "BridgeRelayed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return &FastBridgeBridgeRelayedIterator{contract: _FastBridge.contract, event: "BridgeRelayed", logs: logs, sub: sub}, nil -} - -// WatchBridgeRelayed is a free log subscription operation binding the contract event 0xf8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c. -// -// Solidity: event BridgeRelayed(bytes32 indexed transactionId, address indexed relayer, address indexed to, uint32 originChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, uint256 chainGasAmount) -func (_FastBridge *FastBridgeFilterer) WatchBridgeRelayed(opts *bind.WatchOpts, sink chan<- *FastBridgeBridgeRelayed, transactionId [][32]byte, relayer []common.Address, to []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "BridgeRelayed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeBridgeRelayed) - if err := _FastBridge.contract.UnpackLog(event, "BridgeRelayed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeRelayed is a log parse operation binding the contract event 0xf8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c. -// -// Solidity: event BridgeRelayed(bytes32 indexed transactionId, address indexed relayer, address indexed to, uint32 originChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, uint256 chainGasAmount) -func (_FastBridge *FastBridgeFilterer) ParseBridgeRelayed(log types.Log) (*FastBridgeBridgeRelayed, error) { - event := new(FastBridgeBridgeRelayed) - if err := _FastBridge.contract.UnpackLog(event, "BridgeRelayed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeBridgeRequestedIterator is returned from FilterBridgeRequested and is used to iterate over the raw logs and unpacked data for BridgeRequested events raised by the FastBridge contract. -type FastBridgeBridgeRequestedIterator struct { - Event *FastBridgeBridgeRequested // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeBridgeRequestedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeBridgeRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeBridgeRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeBridgeRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeBridgeRequested represents a BridgeRequested event raised by the FastBridge contract. -type FastBridgeBridgeRequested struct { - TransactionId [32]byte - Sender common.Address - Request []byte - DestChainId uint32 - OriginToken common.Address - DestToken common.Address - OriginAmount *big.Int - DestAmount *big.Int - SendChainGas bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeRequested is a free log retrieval operation binding the contract event 0x120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a. -// -// Solidity: event BridgeRequested(bytes32 indexed transactionId, address indexed sender, bytes request, uint32 destChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, bool sendChainGas) -func (_FastBridge *FastBridgeFilterer) FilterBridgeRequested(opts *bind.FilterOpts, transactionId [][32]byte, sender []common.Address) (*FastBridgeBridgeRequestedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "BridgeRequested", transactionIdRule, senderRule) - if err != nil { - return nil, err - } - return &FastBridgeBridgeRequestedIterator{contract: _FastBridge.contract, event: "BridgeRequested", logs: logs, sub: sub}, nil -} - -// WatchBridgeRequested is a free log subscription operation binding the contract event 0x120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a. -// -// Solidity: event BridgeRequested(bytes32 indexed transactionId, address indexed sender, bytes request, uint32 destChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, bool sendChainGas) -func (_FastBridge *FastBridgeFilterer) WatchBridgeRequested(opts *bind.WatchOpts, sink chan<- *FastBridgeBridgeRequested, transactionId [][32]byte, sender []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "BridgeRequested", transactionIdRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeBridgeRequested) - if err := _FastBridge.contract.UnpackLog(event, "BridgeRequested", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeRequested is a log parse operation binding the contract event 0x120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a. -// -// Solidity: event BridgeRequested(bytes32 indexed transactionId, address indexed sender, bytes request, uint32 destChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, bool sendChainGas) -func (_FastBridge *FastBridgeFilterer) ParseBridgeRequested(log types.Log) (*FastBridgeBridgeRequested, error) { - event := new(FastBridgeBridgeRequested) - if err := _FastBridge.contract.UnpackLog(event, "BridgeRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeChainGasAmountUpdatedIterator is returned from FilterChainGasAmountUpdated and is used to iterate over the raw logs and unpacked data for ChainGasAmountUpdated events raised by the FastBridge contract. -type FastBridgeChainGasAmountUpdatedIterator struct { - Event *FastBridgeChainGasAmountUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeChainGasAmountUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeChainGasAmountUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeChainGasAmountUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeChainGasAmountUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeChainGasAmountUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeChainGasAmountUpdated represents a ChainGasAmountUpdated event raised by the FastBridge contract. -type FastBridgeChainGasAmountUpdated struct { - OldChainGasAmount *big.Int - NewChainGasAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChainGasAmountUpdated is a free log retrieval operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_FastBridge *FastBridgeFilterer) FilterChainGasAmountUpdated(opts *bind.FilterOpts) (*FastBridgeChainGasAmountUpdatedIterator, error) { - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "ChainGasAmountUpdated") - if err != nil { - return nil, err - } - return &FastBridgeChainGasAmountUpdatedIterator{contract: _FastBridge.contract, event: "ChainGasAmountUpdated", logs: logs, sub: sub}, nil -} - -// WatchChainGasAmountUpdated is a free log subscription operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_FastBridge *FastBridgeFilterer) WatchChainGasAmountUpdated(opts *bind.WatchOpts, sink chan<- *FastBridgeChainGasAmountUpdated) (event.Subscription, error) { - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "ChainGasAmountUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeChainGasAmountUpdated) - if err := _FastBridge.contract.UnpackLog(event, "ChainGasAmountUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChainGasAmountUpdated is a log parse operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_FastBridge *FastBridgeFilterer) ParseChainGasAmountUpdated(log types.Log) (*FastBridgeChainGasAmountUpdated, error) { - event := new(FastBridgeChainGasAmountUpdated) - if err := _FastBridge.contract.UnpackLog(event, "ChainGasAmountUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeFeeRateUpdatedIterator is returned from FilterFeeRateUpdated and is used to iterate over the raw logs and unpacked data for FeeRateUpdated events raised by the FastBridge contract. -type FastBridgeFeeRateUpdatedIterator struct { - Event *FastBridgeFeeRateUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeFeeRateUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeFeeRateUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeFeeRateUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeFeeRateUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeFeeRateUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeFeeRateUpdated represents a FeeRateUpdated event raised by the FastBridge contract. -type FastBridgeFeeRateUpdated struct { - OldFeeRate *big.Int - NewFeeRate *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeeRateUpdated is a free log retrieval operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_FastBridge *FastBridgeFilterer) FilterFeeRateUpdated(opts *bind.FilterOpts) (*FastBridgeFeeRateUpdatedIterator, error) { - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "FeeRateUpdated") - if err != nil { - return nil, err - } - return &FastBridgeFeeRateUpdatedIterator{contract: _FastBridge.contract, event: "FeeRateUpdated", logs: logs, sub: sub}, nil -} - -// WatchFeeRateUpdated is a free log subscription operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_FastBridge *FastBridgeFilterer) WatchFeeRateUpdated(opts *bind.WatchOpts, sink chan<- *FastBridgeFeeRateUpdated) (event.Subscription, error) { - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "FeeRateUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeFeeRateUpdated) - if err := _FastBridge.contract.UnpackLog(event, "FeeRateUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseFeeRateUpdated is a log parse operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_FastBridge *FastBridgeFilterer) ParseFeeRateUpdated(log types.Log) (*FastBridgeFeeRateUpdated, error) { - event := new(FastBridgeFeeRateUpdated) - if err := _FastBridge.contract.UnpackLog(event, "FeeRateUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeFeesSweptIterator is returned from FilterFeesSwept and is used to iterate over the raw logs and unpacked data for FeesSwept events raised by the FastBridge contract. -type FastBridgeFeesSweptIterator struct { - Event *FastBridgeFeesSwept // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeFeesSweptIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeFeesSwept) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeFeesSwept) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeFeesSweptIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeFeesSweptIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeFeesSwept represents a FeesSwept event raised by the FastBridge contract. -type FastBridgeFeesSwept struct { - Token common.Address - Recipient common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeesSwept is a free log retrieval operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_FastBridge *FastBridgeFilterer) FilterFeesSwept(opts *bind.FilterOpts) (*FastBridgeFeesSweptIterator, error) { - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "FeesSwept") - if err != nil { - return nil, err - } - return &FastBridgeFeesSweptIterator{contract: _FastBridge.contract, event: "FeesSwept", logs: logs, sub: sub}, nil -} - -// WatchFeesSwept is a free log subscription operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_FastBridge *FastBridgeFilterer) WatchFeesSwept(opts *bind.WatchOpts, sink chan<- *FastBridgeFeesSwept) (event.Subscription, error) { - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "FeesSwept") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeFeesSwept) - if err := _FastBridge.contract.UnpackLog(event, "FeesSwept", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseFeesSwept is a log parse operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_FastBridge *FastBridgeFilterer) ParseFeesSwept(log types.Log) (*FastBridgeFeesSwept, error) { - event := new(FastBridgeFeesSwept) - if err := _FastBridge.contract.UnpackLog(event, "FeesSwept", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the FastBridge contract. -type FastBridgeRoleAdminChangedIterator struct { - Event *FastBridgeRoleAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeRoleAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeRoleAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeRoleAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeRoleAdminChanged represents a RoleAdminChanged event raised by the FastBridge contract. -type FastBridgeRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_FastBridge *FastBridgeFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*FastBridgeRoleAdminChangedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return &FastBridgeRoleAdminChangedIterator{contract: _FastBridge.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil -} - -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_FastBridge *FastBridgeFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *FastBridgeRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeRoleAdminChanged) - if err := _FastBridge.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_FastBridge *FastBridgeFilterer) ParseRoleAdminChanged(log types.Log) (*FastBridgeRoleAdminChanged, error) { - event := new(FastBridgeRoleAdminChanged) - if err := _FastBridge.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the FastBridge contract. -type FastBridgeRoleGrantedIterator struct { - Event *FastBridgeRoleGranted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeRoleGrantedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeRoleGranted represents a RoleGranted event raised by the FastBridge contract. -type FastBridgeRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_FastBridge *FastBridgeFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*FastBridgeRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &FastBridgeRoleGrantedIterator{contract: _FastBridge.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_FastBridge *FastBridgeFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *FastBridgeRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeRoleGranted) - if err := _FastBridge.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_FastBridge *FastBridgeFilterer) ParseRoleGranted(log types.Log) (*FastBridgeRoleGranted, error) { - event := new(FastBridgeRoleGranted) - if err := _FastBridge.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// FastBridgeRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the FastBridge contract. -type FastBridgeRoleRevokedIterator struct { - Event *FastBridgeRoleRevoked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *FastBridgeRoleRevokedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(FastBridgeRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(FastBridgeRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *FastBridgeRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *FastBridgeRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// FastBridgeRoleRevoked represents a RoleRevoked event raised by the FastBridge contract. -type FastBridgeRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_FastBridge *FastBridgeFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*FastBridgeRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _FastBridge.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &FastBridgeRoleRevokedIterator{contract: _FastBridge.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_FastBridge *FastBridgeFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *FastBridgeRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _FastBridge.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(FastBridgeRoleRevoked) - if err := _FastBridge.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_FastBridge *FastBridgeFilterer) ParseRoleRevoked(log types.Log) (*FastBridgeRoleRevoked, error) { - event := new(FastBridgeRoleRevoked) - if err := _FastBridge.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAccessControlMetaData contains all meta data concerning the IAccessControl contract. -var IAccessControlMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"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\":[{\"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\"}]", - Sigs: map[string]string{ - "248a9ca3": "getRoleAdmin(bytes32)", - "2f2ff15d": "grantRole(bytes32,address)", - "91d14854": "hasRole(bytes32,address)", - "36568abe": "renounceRole(bytes32,address)", - "d547741f": "revokeRole(bytes32,address)", - }, -} - -// IAccessControlABI is the input ABI used to generate the binding from. -// Deprecated: Use IAccessControlMetaData.ABI instead. -var IAccessControlABI = IAccessControlMetaData.ABI - -// Deprecated: Use IAccessControlMetaData.Sigs instead. -// IAccessControlFuncSigs maps the 4-byte function signature to its string representation. -var IAccessControlFuncSigs = IAccessControlMetaData.Sigs - -// IAccessControl is an auto generated Go binding around an Ethereum contract. -type IAccessControl struct { - IAccessControlCaller // Read-only binding to the contract - IAccessControlTransactor // Write-only binding to the contract - IAccessControlFilterer // Log filterer for contract events -} - -// IAccessControlCaller is an auto generated read-only Go binding around an Ethereum contract. -type IAccessControlCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAccessControlTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IAccessControlTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAccessControlFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IAccessControlFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAccessControlSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IAccessControlSession struct { - Contract *IAccessControl // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IAccessControlCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IAccessControlCallerSession struct { - Contract *IAccessControlCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IAccessControlTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IAccessControlTransactorSession struct { - Contract *IAccessControlTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IAccessControlRaw is an auto generated low-level Go binding around an Ethereum contract. -type IAccessControlRaw struct { - Contract *IAccessControl // Generic contract binding to access the raw methods on -} - -// IAccessControlCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IAccessControlCallerRaw struct { - Contract *IAccessControlCaller // Generic read-only contract binding to access the raw methods on -} - -// IAccessControlTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IAccessControlTransactorRaw struct { - Contract *IAccessControlTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIAccessControl creates a new instance of IAccessControl, bound to a specific deployed contract. -func NewIAccessControl(address common.Address, backend bind.ContractBackend) (*IAccessControl, error) { - contract, err := bindIAccessControl(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IAccessControl{IAccessControlCaller: IAccessControlCaller{contract: contract}, IAccessControlTransactor: IAccessControlTransactor{contract: contract}, IAccessControlFilterer: IAccessControlFilterer{contract: contract}}, nil -} - -// NewIAccessControlCaller creates a new read-only instance of IAccessControl, bound to a specific deployed contract. -func NewIAccessControlCaller(address common.Address, caller bind.ContractCaller) (*IAccessControlCaller, error) { - contract, err := bindIAccessControl(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IAccessControlCaller{contract: contract}, nil -} - -// NewIAccessControlTransactor creates a new write-only instance of IAccessControl, bound to a specific deployed contract. -func NewIAccessControlTransactor(address common.Address, transactor bind.ContractTransactor) (*IAccessControlTransactor, error) { - contract, err := bindIAccessControl(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IAccessControlTransactor{contract: contract}, nil -} - -// NewIAccessControlFilterer creates a new log filterer instance of IAccessControl, bound to a specific deployed contract. -func NewIAccessControlFilterer(address common.Address, filterer bind.ContractFilterer) (*IAccessControlFilterer, error) { - contract, err := bindIAccessControl(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IAccessControlFilterer{contract: contract}, nil -} - -// bindIAccessControl binds a generic wrapper to an already deployed contract. -func bindIAccessControl(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IAccessControlMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IAccessControl *IAccessControlRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IAccessControl.Contract.IAccessControlCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IAccessControl *IAccessControlRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IAccessControl.Contract.IAccessControlTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IAccessControl *IAccessControlRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IAccessControl.Contract.IAccessControlTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IAccessControl *IAccessControlCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IAccessControl.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IAccessControl *IAccessControlTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IAccessControl.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IAccessControl *IAccessControlTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IAccessControl.Contract.contract.Transact(opts, method, params...) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_IAccessControl *IAccessControlCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _IAccessControl.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_IAccessControl *IAccessControlSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _IAccessControl.Contract.GetRoleAdmin(&_IAccessControl.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_IAccessControl *IAccessControlCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _IAccessControl.Contract.GetRoleAdmin(&_IAccessControl.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_IAccessControl *IAccessControlCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _IAccessControl.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_IAccessControl *IAccessControlSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _IAccessControl.Contract.HasRole(&_IAccessControl.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_IAccessControl *IAccessControlCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _IAccessControl.Contract.HasRole(&_IAccessControl.CallOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_IAccessControl *IAccessControlTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControl.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_IAccessControl *IAccessControlSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControl.Contract.GrantRole(&_IAccessControl.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_IAccessControl *IAccessControlTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControl.Contract.GrantRole(&_IAccessControl.TransactOpts, role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_IAccessControl *IAccessControlTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _IAccessControl.contract.Transact(opts, "renounceRole", role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_IAccessControl *IAccessControlSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _IAccessControl.Contract.RenounceRole(&_IAccessControl.TransactOpts, role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_IAccessControl *IAccessControlTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _IAccessControl.Contract.RenounceRole(&_IAccessControl.TransactOpts, role, callerConfirmation) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_IAccessControl *IAccessControlTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControl.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_IAccessControl *IAccessControlSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControl.Contract.RevokeRole(&_IAccessControl.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_IAccessControl *IAccessControlTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControl.Contract.RevokeRole(&_IAccessControl.TransactOpts, role, account) -} - -// IAccessControlRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the IAccessControl contract. -type IAccessControlRoleAdminChangedIterator struct { - Event *IAccessControlRoleAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAccessControlRoleAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAccessControlRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAccessControlRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAccessControlRoleAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAccessControlRoleAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAccessControlRoleAdminChanged represents a RoleAdminChanged event raised by the IAccessControl contract. -type IAccessControlRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_IAccessControl *IAccessControlFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*IAccessControlRoleAdminChangedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _IAccessControl.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return &IAccessControlRoleAdminChangedIterator{contract: _IAccessControl.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil -} - -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_IAccessControl *IAccessControlFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *IAccessControlRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _IAccessControl.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAccessControlRoleAdminChanged) - if err := _IAccessControl.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_IAccessControl *IAccessControlFilterer) ParseRoleAdminChanged(log types.Log) (*IAccessControlRoleAdminChanged, error) { - event := new(IAccessControlRoleAdminChanged) - if err := _IAccessControl.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAccessControlRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the IAccessControl contract. -type IAccessControlRoleGrantedIterator struct { - Event *IAccessControlRoleGranted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAccessControlRoleGrantedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAccessControlRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAccessControlRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAccessControlRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAccessControlRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAccessControlRoleGranted represents a RoleGranted event raised by the IAccessControl contract. -type IAccessControlRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControl *IAccessControlFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*IAccessControlRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControl.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &IAccessControlRoleGrantedIterator{contract: _IAccessControl.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControl *IAccessControlFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *IAccessControlRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControl.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAccessControlRoleGranted) - if err := _IAccessControl.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControl *IAccessControlFilterer) ParseRoleGranted(log types.Log) (*IAccessControlRoleGranted, error) { - event := new(IAccessControlRoleGranted) - if err := _IAccessControl.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAccessControlRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the IAccessControl contract. -type IAccessControlRoleRevokedIterator struct { - Event *IAccessControlRoleRevoked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAccessControlRoleRevokedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAccessControlRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAccessControlRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAccessControlRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAccessControlRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAccessControlRoleRevoked represents a RoleRevoked event raised by the IAccessControl contract. -type IAccessControlRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControl *IAccessControlFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*IAccessControlRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControl.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &IAccessControlRoleRevokedIterator{contract: _IAccessControl.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControl *IAccessControlFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *IAccessControlRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControl.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAccessControlRoleRevoked) - if err := _IAccessControl.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControl *IAccessControlFilterer) ParseRoleRevoked(log types.Log) (*IAccessControlRoleRevoked, error) { - event := new(IAccessControlRoleRevoked) - if err := _IAccessControl.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAccessControlEnumerableMetaData contains all meta data concerning the IAccessControlEnumerable contract. -var IAccessControlEnumerableMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":[{\"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\"}]", - Sigs: map[string]string{ - "248a9ca3": "getRoleAdmin(bytes32)", - "9010d07c": "getRoleMember(bytes32,uint256)", - "ca15c873": "getRoleMemberCount(bytes32)", - "2f2ff15d": "grantRole(bytes32,address)", - "91d14854": "hasRole(bytes32,address)", - "36568abe": "renounceRole(bytes32,address)", - "d547741f": "revokeRole(bytes32,address)", - }, -} - -// IAccessControlEnumerableABI is the input ABI used to generate the binding from. -// Deprecated: Use IAccessControlEnumerableMetaData.ABI instead. -var IAccessControlEnumerableABI = IAccessControlEnumerableMetaData.ABI - -// Deprecated: Use IAccessControlEnumerableMetaData.Sigs instead. -// IAccessControlEnumerableFuncSigs maps the 4-byte function signature to its string representation. -var IAccessControlEnumerableFuncSigs = IAccessControlEnumerableMetaData.Sigs - -// IAccessControlEnumerable is an auto generated Go binding around an Ethereum contract. -type IAccessControlEnumerable struct { - IAccessControlEnumerableCaller // Read-only binding to the contract - IAccessControlEnumerableTransactor // Write-only binding to the contract - IAccessControlEnumerableFilterer // Log filterer for contract events -} - -// IAccessControlEnumerableCaller is an auto generated read-only Go binding around an Ethereum contract. -type IAccessControlEnumerableCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAccessControlEnumerableTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IAccessControlEnumerableTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAccessControlEnumerableFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IAccessControlEnumerableFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAccessControlEnumerableSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IAccessControlEnumerableSession struct { - Contract *IAccessControlEnumerable // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IAccessControlEnumerableCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IAccessControlEnumerableCallerSession struct { - Contract *IAccessControlEnumerableCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IAccessControlEnumerableTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IAccessControlEnumerableTransactorSession struct { - Contract *IAccessControlEnumerableTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IAccessControlEnumerableRaw is an auto generated low-level Go binding around an Ethereum contract. -type IAccessControlEnumerableRaw struct { - Contract *IAccessControlEnumerable // Generic contract binding to access the raw methods on -} - -// IAccessControlEnumerableCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IAccessControlEnumerableCallerRaw struct { - Contract *IAccessControlEnumerableCaller // Generic read-only contract binding to access the raw methods on -} - -// IAccessControlEnumerableTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IAccessControlEnumerableTransactorRaw struct { - Contract *IAccessControlEnumerableTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIAccessControlEnumerable creates a new instance of IAccessControlEnumerable, bound to a specific deployed contract. -func NewIAccessControlEnumerable(address common.Address, backend bind.ContractBackend) (*IAccessControlEnumerable, error) { - contract, err := bindIAccessControlEnumerable(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IAccessControlEnumerable{IAccessControlEnumerableCaller: IAccessControlEnumerableCaller{contract: contract}, IAccessControlEnumerableTransactor: IAccessControlEnumerableTransactor{contract: contract}, IAccessControlEnumerableFilterer: IAccessControlEnumerableFilterer{contract: contract}}, nil -} - -// NewIAccessControlEnumerableCaller creates a new read-only instance of IAccessControlEnumerable, bound to a specific deployed contract. -func NewIAccessControlEnumerableCaller(address common.Address, caller bind.ContractCaller) (*IAccessControlEnumerableCaller, error) { - contract, err := bindIAccessControlEnumerable(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IAccessControlEnumerableCaller{contract: contract}, nil -} - -// NewIAccessControlEnumerableTransactor creates a new write-only instance of IAccessControlEnumerable, bound to a specific deployed contract. -func NewIAccessControlEnumerableTransactor(address common.Address, transactor bind.ContractTransactor) (*IAccessControlEnumerableTransactor, error) { - contract, err := bindIAccessControlEnumerable(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IAccessControlEnumerableTransactor{contract: contract}, nil -} - -// NewIAccessControlEnumerableFilterer creates a new log filterer instance of IAccessControlEnumerable, bound to a specific deployed contract. -func NewIAccessControlEnumerableFilterer(address common.Address, filterer bind.ContractFilterer) (*IAccessControlEnumerableFilterer, error) { - contract, err := bindIAccessControlEnumerable(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IAccessControlEnumerableFilterer{contract: contract}, nil -} - -// bindIAccessControlEnumerable binds a generic wrapper to an already deployed contract. -func bindIAccessControlEnumerable(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IAccessControlEnumerableMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IAccessControlEnumerable *IAccessControlEnumerableRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IAccessControlEnumerable.Contract.IAccessControlEnumerableCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IAccessControlEnumerable *IAccessControlEnumerableRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.IAccessControlEnumerableTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IAccessControlEnumerable *IAccessControlEnumerableRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.IAccessControlEnumerableTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IAccessControlEnumerable *IAccessControlEnumerableCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IAccessControlEnumerable.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.contract.Transact(opts, method, params...) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_IAccessControlEnumerable *IAccessControlEnumerableCaller) GetRoleAdmin(opts *bind.CallOpts, role [32]byte) ([32]byte, error) { - var out []interface{} - err := _IAccessControlEnumerable.contract.Call(opts, &out, "getRoleAdmin", role) - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _IAccessControlEnumerable.Contract.GetRoleAdmin(&_IAccessControlEnumerable.CallOpts, role) -} - -// GetRoleAdmin is a free data retrieval call binding the contract method 0x248a9ca3. -// -// Solidity: function getRoleAdmin(bytes32 role) view returns(bytes32) -func (_IAccessControlEnumerable *IAccessControlEnumerableCallerSession) GetRoleAdmin(role [32]byte) ([32]byte, error) { - return _IAccessControlEnumerable.Contract.GetRoleAdmin(&_IAccessControlEnumerable.CallOpts, role) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_IAccessControlEnumerable *IAccessControlEnumerableCaller) GetRoleMember(opts *bind.CallOpts, role [32]byte, index *big.Int) (common.Address, error) { - var out []interface{} - err := _IAccessControlEnumerable.contract.Call(opts, &out, "getRoleMember", role, index) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _IAccessControlEnumerable.Contract.GetRoleMember(&_IAccessControlEnumerable.CallOpts, role, index) -} - -// GetRoleMember is a free data retrieval call binding the contract method 0x9010d07c. -// -// Solidity: function getRoleMember(bytes32 role, uint256 index) view returns(address) -func (_IAccessControlEnumerable *IAccessControlEnumerableCallerSession) GetRoleMember(role [32]byte, index *big.Int) (common.Address, error) { - return _IAccessControlEnumerable.Contract.GetRoleMember(&_IAccessControlEnumerable.CallOpts, role, index) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_IAccessControlEnumerable *IAccessControlEnumerableCaller) GetRoleMemberCount(opts *bind.CallOpts, role [32]byte) (*big.Int, error) { - var out []interface{} - err := _IAccessControlEnumerable.contract.Call(opts, &out, "getRoleMemberCount", role) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _IAccessControlEnumerable.Contract.GetRoleMemberCount(&_IAccessControlEnumerable.CallOpts, role) -} - -// GetRoleMemberCount is a free data retrieval call binding the contract method 0xca15c873. -// -// Solidity: function getRoleMemberCount(bytes32 role) view returns(uint256) -func (_IAccessControlEnumerable *IAccessControlEnumerableCallerSession) GetRoleMemberCount(role [32]byte) (*big.Int, error) { - return _IAccessControlEnumerable.Contract.GetRoleMemberCount(&_IAccessControlEnumerable.CallOpts, role) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_IAccessControlEnumerable *IAccessControlEnumerableCaller) HasRole(opts *bind.CallOpts, role [32]byte, account common.Address) (bool, error) { - var out []interface{} - err := _IAccessControlEnumerable.contract.Call(opts, &out, "hasRole", role, account) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _IAccessControlEnumerable.Contract.HasRole(&_IAccessControlEnumerable.CallOpts, role, account) -} - -// HasRole is a free data retrieval call binding the contract method 0x91d14854. -// -// Solidity: function hasRole(bytes32 role, address account) view returns(bool) -func (_IAccessControlEnumerable *IAccessControlEnumerableCallerSession) HasRole(role [32]byte, account common.Address) (bool, error) { - return _IAccessControlEnumerable.Contract.HasRole(&_IAccessControlEnumerable.CallOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactor) GrantRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.contract.Transact(opts, "grantRole", role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.GrantRole(&_IAccessControlEnumerable.TransactOpts, role, account) -} - -// GrantRole is a paid mutator transaction binding the contract method 0x2f2ff15d. -// -// Solidity: function grantRole(bytes32 role, address account) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactorSession) GrantRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.GrantRole(&_IAccessControlEnumerable.TransactOpts, role, account) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactor) RenounceRole(opts *bind.TransactOpts, role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.contract.Transact(opts, "renounceRole", role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.RenounceRole(&_IAccessControlEnumerable.TransactOpts, role, callerConfirmation) -} - -// RenounceRole is a paid mutator transaction binding the contract method 0x36568abe. -// -// Solidity: function renounceRole(bytes32 role, address callerConfirmation) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactorSession) RenounceRole(role [32]byte, callerConfirmation common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.RenounceRole(&_IAccessControlEnumerable.TransactOpts, role, callerConfirmation) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactor) RevokeRole(opts *bind.TransactOpts, role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.contract.Transact(opts, "revokeRole", role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.RevokeRole(&_IAccessControlEnumerable.TransactOpts, role, account) -} - -// RevokeRole is a paid mutator transaction binding the contract method 0xd547741f. -// -// Solidity: function revokeRole(bytes32 role, address account) returns() -func (_IAccessControlEnumerable *IAccessControlEnumerableTransactorSession) RevokeRole(role [32]byte, account common.Address) (*types.Transaction, error) { - return _IAccessControlEnumerable.Contract.RevokeRole(&_IAccessControlEnumerable.TransactOpts, role, account) -} - -// IAccessControlEnumerableRoleAdminChangedIterator is returned from FilterRoleAdminChanged and is used to iterate over the raw logs and unpacked data for RoleAdminChanged events raised by the IAccessControlEnumerable contract. -type IAccessControlEnumerableRoleAdminChangedIterator struct { - Event *IAccessControlEnumerableRoleAdminChanged // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAccessControlEnumerableRoleAdminChangedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAccessControlEnumerableRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAccessControlEnumerableRoleAdminChanged) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAccessControlEnumerableRoleAdminChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAccessControlEnumerableRoleAdminChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAccessControlEnumerableRoleAdminChanged represents a RoleAdminChanged event raised by the IAccessControlEnumerable contract. -type IAccessControlEnumerableRoleAdminChanged struct { - Role [32]byte - PreviousAdminRole [32]byte - NewAdminRole [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleAdminChanged is a free log retrieval operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) FilterRoleAdminChanged(opts *bind.FilterOpts, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (*IAccessControlEnumerableRoleAdminChangedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _IAccessControlEnumerable.contract.FilterLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return &IAccessControlEnumerableRoleAdminChangedIterator{contract: _IAccessControlEnumerable.contract, event: "RoleAdminChanged", logs: logs, sub: sub}, nil -} - -// WatchRoleAdminChanged is a free log subscription operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) WatchRoleAdminChanged(opts *bind.WatchOpts, sink chan<- *IAccessControlEnumerableRoleAdminChanged, role [][32]byte, previousAdminRole [][32]byte, newAdminRole [][32]byte) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var previousAdminRoleRule []interface{} - for _, previousAdminRoleItem := range previousAdminRole { - previousAdminRoleRule = append(previousAdminRoleRule, previousAdminRoleItem) - } - var newAdminRoleRule []interface{} - for _, newAdminRoleItem := range newAdminRole { - newAdminRoleRule = append(newAdminRoleRule, newAdminRoleItem) - } - - logs, sub, err := _IAccessControlEnumerable.contract.WatchLogs(opts, "RoleAdminChanged", roleRule, previousAdminRoleRule, newAdminRoleRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAccessControlEnumerableRoleAdminChanged) - if err := _IAccessControlEnumerable.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleAdminChanged is a log parse operation binding the contract event 0xbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff. -// -// Solidity: event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) ParseRoleAdminChanged(log types.Log) (*IAccessControlEnumerableRoleAdminChanged, error) { - event := new(IAccessControlEnumerableRoleAdminChanged) - if err := _IAccessControlEnumerable.contract.UnpackLog(event, "RoleAdminChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAccessControlEnumerableRoleGrantedIterator is returned from FilterRoleGranted and is used to iterate over the raw logs and unpacked data for RoleGranted events raised by the IAccessControlEnumerable contract. -type IAccessControlEnumerableRoleGrantedIterator struct { - Event *IAccessControlEnumerableRoleGranted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAccessControlEnumerableRoleGrantedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAccessControlEnumerableRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAccessControlEnumerableRoleGranted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAccessControlEnumerableRoleGrantedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAccessControlEnumerableRoleGrantedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAccessControlEnumerableRoleGranted represents a RoleGranted event raised by the IAccessControlEnumerable contract. -type IAccessControlEnumerableRoleGranted struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleGranted is a free log retrieval operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) FilterRoleGranted(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*IAccessControlEnumerableRoleGrantedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControlEnumerable.contract.FilterLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &IAccessControlEnumerableRoleGrantedIterator{contract: _IAccessControlEnumerable.contract, event: "RoleGranted", logs: logs, sub: sub}, nil -} - -// WatchRoleGranted is a free log subscription operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) WatchRoleGranted(opts *bind.WatchOpts, sink chan<- *IAccessControlEnumerableRoleGranted, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControlEnumerable.contract.WatchLogs(opts, "RoleGranted", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAccessControlEnumerableRoleGranted) - if err := _IAccessControlEnumerable.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleGranted is a log parse operation binding the contract event 0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d. -// -// Solidity: event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) ParseRoleGranted(log types.Log) (*IAccessControlEnumerableRoleGranted, error) { - event := new(IAccessControlEnumerableRoleGranted) - if err := _IAccessControlEnumerable.contract.UnpackLog(event, "RoleGranted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAccessControlEnumerableRoleRevokedIterator is returned from FilterRoleRevoked and is used to iterate over the raw logs and unpacked data for RoleRevoked events raised by the IAccessControlEnumerable contract. -type IAccessControlEnumerableRoleRevokedIterator struct { - Event *IAccessControlEnumerableRoleRevoked // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAccessControlEnumerableRoleRevokedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAccessControlEnumerableRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAccessControlEnumerableRoleRevoked) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAccessControlEnumerableRoleRevokedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAccessControlEnumerableRoleRevokedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAccessControlEnumerableRoleRevoked represents a RoleRevoked event raised by the IAccessControlEnumerable contract. -type IAccessControlEnumerableRoleRevoked struct { - Role [32]byte - Account common.Address - Sender common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRoleRevoked is a free log retrieval operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) FilterRoleRevoked(opts *bind.FilterOpts, role [][32]byte, account []common.Address, sender []common.Address) (*IAccessControlEnumerableRoleRevokedIterator, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControlEnumerable.contract.FilterLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return &IAccessControlEnumerableRoleRevokedIterator{contract: _IAccessControlEnumerable.contract, event: "RoleRevoked", logs: logs, sub: sub}, nil -} - -// WatchRoleRevoked is a free log subscription operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) WatchRoleRevoked(opts *bind.WatchOpts, sink chan<- *IAccessControlEnumerableRoleRevoked, role [][32]byte, account []common.Address, sender []common.Address) (event.Subscription, error) { - - var roleRule []interface{} - for _, roleItem := range role { - roleRule = append(roleRule, roleItem) - } - var accountRule []interface{} - for _, accountItem := range account { - accountRule = append(accountRule, accountItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IAccessControlEnumerable.contract.WatchLogs(opts, "RoleRevoked", roleRule, accountRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAccessControlEnumerableRoleRevoked) - if err := _IAccessControlEnumerable.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseRoleRevoked is a log parse operation binding the contract event 0xf6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b. -// -// Solidity: event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) -func (_IAccessControlEnumerable *IAccessControlEnumerableFilterer) ParseRoleRevoked(log types.Log) (*IAccessControlEnumerableRoleRevoked, error) { - event := new(IAccessControlEnumerableRoleRevoked) - if err := _IAccessControlEnumerable.contract.UnpackLog(event, "RoleRevoked", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAdminMetaData contains all meta data concerning the IAdmin contract. -var IAdminMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldChainGasAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"ChainGasAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"FeeRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesSwept\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"setChainGasAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeeRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepProtocolFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "b250fe6b": "setChainGasAmount(uint256)", - "b13aa2d6": "setProtocolFeeRate(uint256)", - "06f333f2": "sweepProtocolFees(address,address)", - }, -} - -// IAdminABI is the input ABI used to generate the binding from. -// Deprecated: Use IAdminMetaData.ABI instead. -var IAdminABI = IAdminMetaData.ABI - -// Deprecated: Use IAdminMetaData.Sigs instead. -// IAdminFuncSigs maps the 4-byte function signature to its string representation. -var IAdminFuncSigs = IAdminMetaData.Sigs - -// IAdmin is an auto generated Go binding around an Ethereum contract. -type IAdmin struct { - IAdminCaller // Read-only binding to the contract - IAdminTransactor // Write-only binding to the contract - IAdminFilterer // Log filterer for contract events -} - -// IAdminCaller is an auto generated read-only Go binding around an Ethereum contract. -type IAdminCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAdminTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IAdminTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAdminFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IAdminFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IAdminSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IAdminSession struct { - Contract *IAdmin // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IAdminCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IAdminCallerSession struct { - Contract *IAdminCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IAdminTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IAdminTransactorSession struct { - Contract *IAdminTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IAdminRaw is an auto generated low-level Go binding around an Ethereum contract. -type IAdminRaw struct { - Contract *IAdmin // Generic contract binding to access the raw methods on -} - -// IAdminCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IAdminCallerRaw struct { - Contract *IAdminCaller // Generic read-only contract binding to access the raw methods on -} - -// IAdminTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IAdminTransactorRaw struct { - Contract *IAdminTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIAdmin creates a new instance of IAdmin, bound to a specific deployed contract. -func NewIAdmin(address common.Address, backend bind.ContractBackend) (*IAdmin, error) { - contract, err := bindIAdmin(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IAdmin{IAdminCaller: IAdminCaller{contract: contract}, IAdminTransactor: IAdminTransactor{contract: contract}, IAdminFilterer: IAdminFilterer{contract: contract}}, nil -} - -// NewIAdminCaller creates a new read-only instance of IAdmin, bound to a specific deployed contract. -func NewIAdminCaller(address common.Address, caller bind.ContractCaller) (*IAdminCaller, error) { - contract, err := bindIAdmin(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IAdminCaller{contract: contract}, nil -} - -// NewIAdminTransactor creates a new write-only instance of IAdmin, bound to a specific deployed contract. -func NewIAdminTransactor(address common.Address, transactor bind.ContractTransactor) (*IAdminTransactor, error) { - contract, err := bindIAdmin(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IAdminTransactor{contract: contract}, nil -} - -// NewIAdminFilterer creates a new log filterer instance of IAdmin, bound to a specific deployed contract. -func NewIAdminFilterer(address common.Address, filterer bind.ContractFilterer) (*IAdminFilterer, error) { - contract, err := bindIAdmin(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IAdminFilterer{contract: contract}, nil -} - -// bindIAdmin binds a generic wrapper to an already deployed contract. -func bindIAdmin(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IAdminMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IAdmin *IAdminRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IAdmin.Contract.IAdminCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IAdmin *IAdminRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IAdmin.Contract.IAdminTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IAdmin *IAdminRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IAdmin.Contract.IAdminTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IAdmin *IAdminCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IAdmin.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IAdmin *IAdminTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IAdmin.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IAdmin *IAdminTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IAdmin.Contract.contract.Transact(opts, method, params...) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_IAdmin *IAdminTransactor) SetChainGasAmount(opts *bind.TransactOpts, newChainGasAmount *big.Int) (*types.Transaction, error) { - return _IAdmin.contract.Transact(opts, "setChainGasAmount", newChainGasAmount) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_IAdmin *IAdminSession) SetChainGasAmount(newChainGasAmount *big.Int) (*types.Transaction, error) { - return _IAdmin.Contract.SetChainGasAmount(&_IAdmin.TransactOpts, newChainGasAmount) -} - -// SetChainGasAmount is a paid mutator transaction binding the contract method 0xb250fe6b. -// -// Solidity: function setChainGasAmount(uint256 newChainGasAmount) returns() -func (_IAdmin *IAdminTransactorSession) SetChainGasAmount(newChainGasAmount *big.Int) (*types.Transaction, error) { - return _IAdmin.Contract.SetChainGasAmount(&_IAdmin.TransactOpts, newChainGasAmount) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_IAdmin *IAdminTransactor) SetProtocolFeeRate(opts *bind.TransactOpts, newFeeRate *big.Int) (*types.Transaction, error) { - return _IAdmin.contract.Transact(opts, "setProtocolFeeRate", newFeeRate) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_IAdmin *IAdminSession) SetProtocolFeeRate(newFeeRate *big.Int) (*types.Transaction, error) { - return _IAdmin.Contract.SetProtocolFeeRate(&_IAdmin.TransactOpts, newFeeRate) -} - -// SetProtocolFeeRate is a paid mutator transaction binding the contract method 0xb13aa2d6. -// -// Solidity: function setProtocolFeeRate(uint256 newFeeRate) returns() -func (_IAdmin *IAdminTransactorSession) SetProtocolFeeRate(newFeeRate *big.Int) (*types.Transaction, error) { - return _IAdmin.Contract.SetProtocolFeeRate(&_IAdmin.TransactOpts, newFeeRate) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_IAdmin *IAdminTransactor) SweepProtocolFees(opts *bind.TransactOpts, token common.Address, recipient common.Address) (*types.Transaction, error) { - return _IAdmin.contract.Transact(opts, "sweepProtocolFees", token, recipient) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_IAdmin *IAdminSession) SweepProtocolFees(token common.Address, recipient common.Address) (*types.Transaction, error) { - return _IAdmin.Contract.SweepProtocolFees(&_IAdmin.TransactOpts, token, recipient) -} - -// SweepProtocolFees is a paid mutator transaction binding the contract method 0x06f333f2. -// -// Solidity: function sweepProtocolFees(address token, address recipient) returns() -func (_IAdmin *IAdminTransactorSession) SweepProtocolFees(token common.Address, recipient common.Address) (*types.Transaction, error) { - return _IAdmin.Contract.SweepProtocolFees(&_IAdmin.TransactOpts, token, recipient) -} - -// IAdminChainGasAmountUpdatedIterator is returned from FilterChainGasAmountUpdated and is used to iterate over the raw logs and unpacked data for ChainGasAmountUpdated events raised by the IAdmin contract. -type IAdminChainGasAmountUpdatedIterator struct { - Event *IAdminChainGasAmountUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAdminChainGasAmountUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAdminChainGasAmountUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAdminChainGasAmountUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAdminChainGasAmountUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAdminChainGasAmountUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAdminChainGasAmountUpdated represents a ChainGasAmountUpdated event raised by the IAdmin contract. -type IAdminChainGasAmountUpdated struct { - OldChainGasAmount *big.Int - NewChainGasAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterChainGasAmountUpdated is a free log retrieval operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_IAdmin *IAdminFilterer) FilterChainGasAmountUpdated(opts *bind.FilterOpts) (*IAdminChainGasAmountUpdatedIterator, error) { - - logs, sub, err := _IAdmin.contract.FilterLogs(opts, "ChainGasAmountUpdated") - if err != nil { - return nil, err - } - return &IAdminChainGasAmountUpdatedIterator{contract: _IAdmin.contract, event: "ChainGasAmountUpdated", logs: logs, sub: sub}, nil -} - -// WatchChainGasAmountUpdated is a free log subscription operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_IAdmin *IAdminFilterer) WatchChainGasAmountUpdated(opts *bind.WatchOpts, sink chan<- *IAdminChainGasAmountUpdated) (event.Subscription, error) { - - logs, sub, err := _IAdmin.contract.WatchLogs(opts, "ChainGasAmountUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAdminChainGasAmountUpdated) - if err := _IAdmin.contract.UnpackLog(event, "ChainGasAmountUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseChainGasAmountUpdated is a log parse operation binding the contract event 0x5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa. -// -// Solidity: event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount) -func (_IAdmin *IAdminFilterer) ParseChainGasAmountUpdated(log types.Log) (*IAdminChainGasAmountUpdated, error) { - event := new(IAdminChainGasAmountUpdated) - if err := _IAdmin.contract.UnpackLog(event, "ChainGasAmountUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAdminFeeRateUpdatedIterator is returned from FilterFeeRateUpdated and is used to iterate over the raw logs and unpacked data for FeeRateUpdated events raised by the IAdmin contract. -type IAdminFeeRateUpdatedIterator struct { - Event *IAdminFeeRateUpdated // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAdminFeeRateUpdatedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAdminFeeRateUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAdminFeeRateUpdated) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAdminFeeRateUpdatedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAdminFeeRateUpdatedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAdminFeeRateUpdated represents a FeeRateUpdated event raised by the IAdmin contract. -type IAdminFeeRateUpdated struct { - OldFeeRate *big.Int - NewFeeRate *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeeRateUpdated is a free log retrieval operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_IAdmin *IAdminFilterer) FilterFeeRateUpdated(opts *bind.FilterOpts) (*IAdminFeeRateUpdatedIterator, error) { - - logs, sub, err := _IAdmin.contract.FilterLogs(opts, "FeeRateUpdated") - if err != nil { - return nil, err - } - return &IAdminFeeRateUpdatedIterator{contract: _IAdmin.contract, event: "FeeRateUpdated", logs: logs, sub: sub}, nil -} - -// WatchFeeRateUpdated is a free log subscription operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_IAdmin *IAdminFilterer) WatchFeeRateUpdated(opts *bind.WatchOpts, sink chan<- *IAdminFeeRateUpdated) (event.Subscription, error) { - - logs, sub, err := _IAdmin.contract.WatchLogs(opts, "FeeRateUpdated") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAdminFeeRateUpdated) - if err := _IAdmin.contract.UnpackLog(event, "FeeRateUpdated", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseFeeRateUpdated is a log parse operation binding the contract event 0x14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb957. -// -// Solidity: event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate) -func (_IAdmin *IAdminFilterer) ParseFeeRateUpdated(log types.Log) (*IAdminFeeRateUpdated, error) { - event := new(IAdminFeeRateUpdated) - if err := _IAdmin.contract.UnpackLog(event, "FeeRateUpdated", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IAdminFeesSweptIterator is returned from FilterFeesSwept and is used to iterate over the raw logs and unpacked data for FeesSwept events raised by the IAdmin contract. -type IAdminFeesSweptIterator struct { - Event *IAdminFeesSwept // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IAdminFeesSweptIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IAdminFeesSwept) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IAdminFeesSwept) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IAdminFeesSweptIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IAdminFeesSweptIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IAdminFeesSwept represents a FeesSwept event raised by the IAdmin contract. -type IAdminFeesSwept struct { - Token common.Address - Recipient common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterFeesSwept is a free log retrieval operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_IAdmin *IAdminFilterer) FilterFeesSwept(opts *bind.FilterOpts) (*IAdminFeesSweptIterator, error) { - - logs, sub, err := _IAdmin.contract.FilterLogs(opts, "FeesSwept") - if err != nil { - return nil, err - } - return &IAdminFeesSweptIterator{contract: _IAdmin.contract, event: "FeesSwept", logs: logs, sub: sub}, nil -} - -// WatchFeesSwept is a free log subscription operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_IAdmin *IAdminFilterer) WatchFeesSwept(opts *bind.WatchOpts, sink chan<- *IAdminFeesSwept) (event.Subscription, error) { - - logs, sub, err := _IAdmin.contract.WatchLogs(opts, "FeesSwept") - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IAdminFeesSwept) - if err := _IAdmin.contract.UnpackLog(event, "FeesSwept", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseFeesSwept is a log parse operation binding the contract event 0x244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd. -// -// Solidity: event FeesSwept(address token, address recipient, uint256 amount) -func (_IAdmin *IAdminFilterer) ParseFeesSwept(log types.Log) (*IAdminFeesSwept, error) { - event := new(IAdminFeesSwept) - if err := _IAdmin.contract.UnpackLog(event, "FeesSwept", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IERC165MetaData contains all meta data concerning the IERC165 contract. -var IERC165MetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "01ffc9a7": "supportsInterface(bytes4)", - }, -} - -// IERC165ABI is the input ABI used to generate the binding from. -// Deprecated: Use IERC165MetaData.ABI instead. -var IERC165ABI = IERC165MetaData.ABI - -// Deprecated: Use IERC165MetaData.Sigs instead. -// IERC165FuncSigs maps the 4-byte function signature to its string representation. -var IERC165FuncSigs = IERC165MetaData.Sigs - -// IERC165 is an auto generated Go binding around an Ethereum contract. -type IERC165 struct { - IERC165Caller // Read-only binding to the contract - IERC165Transactor // Write-only binding to the contract - IERC165Filterer // Log filterer for contract events -} - -// IERC165Caller is an auto generated read-only Go binding around an Ethereum contract. -type IERC165Caller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC165Transactor is an auto generated write-only Go binding around an Ethereum contract. -type IERC165Transactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC165Filterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IERC165Filterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC165Session is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IERC165Session struct { - Contract *IERC165 // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IERC165CallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IERC165CallerSession struct { - Contract *IERC165Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IERC165TransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IERC165TransactorSession struct { - Contract *IERC165Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IERC165Raw is an auto generated low-level Go binding around an Ethereum contract. -type IERC165Raw struct { - Contract *IERC165 // Generic contract binding to access the raw methods on -} - -// IERC165CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IERC165CallerRaw struct { - Contract *IERC165Caller // Generic read-only contract binding to access the raw methods on -} - -// IERC165TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IERC165TransactorRaw struct { - Contract *IERC165Transactor // Generic write-only contract binding to access the raw methods on -} - -// NewIERC165 creates a new instance of IERC165, bound to a specific deployed contract. -func NewIERC165(address common.Address, backend bind.ContractBackend) (*IERC165, error) { - contract, err := bindIERC165(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IERC165{IERC165Caller: IERC165Caller{contract: contract}, IERC165Transactor: IERC165Transactor{contract: contract}, IERC165Filterer: IERC165Filterer{contract: contract}}, nil -} - -// NewIERC165Caller creates a new read-only instance of IERC165, bound to a specific deployed contract. -func NewIERC165Caller(address common.Address, caller bind.ContractCaller) (*IERC165Caller, error) { - contract, err := bindIERC165(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IERC165Caller{contract: contract}, nil -} - -// NewIERC165Transactor creates a new write-only instance of IERC165, bound to a specific deployed contract. -func NewIERC165Transactor(address common.Address, transactor bind.ContractTransactor) (*IERC165Transactor, error) { - contract, err := bindIERC165(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IERC165Transactor{contract: contract}, nil -} - -// NewIERC165Filterer creates a new log filterer instance of IERC165, bound to a specific deployed contract. -func NewIERC165Filterer(address common.Address, filterer bind.ContractFilterer) (*IERC165Filterer, error) { - contract, err := bindIERC165(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IERC165Filterer{contract: contract}, nil -} - -// bindIERC165 binds a generic wrapper to an already deployed contract. -func bindIERC165(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IERC165MetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IERC165 *IERC165Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IERC165.Contract.IERC165Caller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IERC165 *IERC165Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IERC165.Contract.IERC165Transactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IERC165 *IERC165Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IERC165.Contract.IERC165Transactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IERC165 *IERC165CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IERC165.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IERC165 *IERC165TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IERC165.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IERC165 *IERC165TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IERC165.Contract.contract.Transact(opts, method, params...) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_IERC165 *IERC165Caller) SupportsInterface(opts *bind.CallOpts, interfaceId [4]byte) (bool, error) { - var out []interface{} - err := _IERC165.contract.Call(opts, &out, "supportsInterface", interfaceId) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_IERC165 *IERC165Session) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _IERC165.Contract.SupportsInterface(&_IERC165.CallOpts, interfaceId) -} - -// SupportsInterface is a free data retrieval call binding the contract method 0x01ffc9a7. -// -// Solidity: function supportsInterface(bytes4 interfaceId) view returns(bool) -func (_IERC165 *IERC165CallerSession) SupportsInterface(interfaceId [4]byte) (bool, error) { - return _IERC165.Contract.SupportsInterface(&_IERC165.CallOpts, interfaceId) -} - -// IERC20MetaData contains all meta data concerning the IERC20 contract. -var IERC20MetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "dd62ed3e": "allowance(address,address)", - "095ea7b3": "approve(address,uint256)", - "70a08231": "balanceOf(address)", - "18160ddd": "totalSupply()", - "a9059cbb": "transfer(address,uint256)", - "23b872dd": "transferFrom(address,address,uint256)", - }, -} - -// IERC20ABI is the input ABI used to generate the binding from. -// Deprecated: Use IERC20MetaData.ABI instead. -var IERC20ABI = IERC20MetaData.ABI - -// Deprecated: Use IERC20MetaData.Sigs instead. -// IERC20FuncSigs maps the 4-byte function signature to its string representation. -var IERC20FuncSigs = IERC20MetaData.Sigs - -// IERC20 is an auto generated Go binding around an Ethereum contract. -type IERC20 struct { - IERC20Caller // Read-only binding to the contract - IERC20Transactor // Write-only binding to the contract - IERC20Filterer // Log filterer for contract events -} - -// IERC20Caller is an auto generated read-only Go binding around an Ethereum contract. -type IERC20Caller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. -type IERC20Transactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IERC20Filterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC20Session is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IERC20Session struct { - Contract *IERC20 // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IERC20CallerSession struct { - Contract *IERC20Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IERC20TransactorSession struct { - Contract *IERC20Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IERC20Raw is an auto generated low-level Go binding around an Ethereum contract. -type IERC20Raw struct { - Contract *IERC20 // Generic contract binding to access the raw methods on -} - -// IERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IERC20CallerRaw struct { - Contract *IERC20Caller // Generic read-only contract binding to access the raw methods on -} - -// IERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IERC20TransactorRaw struct { - Contract *IERC20Transactor // Generic write-only contract binding to access the raw methods on -} - -// NewIERC20 creates a new instance of IERC20, bound to a specific deployed contract. -func NewIERC20(address common.Address, backend bind.ContractBackend) (*IERC20, error) { - contract, err := bindIERC20(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IERC20{IERC20Caller: IERC20Caller{contract: contract}, IERC20Transactor: IERC20Transactor{contract: contract}, IERC20Filterer: IERC20Filterer{contract: contract}}, nil -} - -// NewIERC20Caller creates a new read-only instance of IERC20, bound to a specific deployed contract. -func NewIERC20Caller(address common.Address, caller bind.ContractCaller) (*IERC20Caller, error) { - contract, err := bindIERC20(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IERC20Caller{contract: contract}, nil -} - -// NewIERC20Transactor creates a new write-only instance of IERC20, bound to a specific deployed contract. -func NewIERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*IERC20Transactor, error) { - contract, err := bindIERC20(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IERC20Transactor{contract: contract}, nil -} - -// NewIERC20Filterer creates a new log filterer instance of IERC20, bound to a specific deployed contract. -func NewIERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*IERC20Filterer, error) { - contract, err := bindIERC20(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IERC20Filterer{contract: contract}, nil -} - -// bindIERC20 binds a generic wrapper to an already deployed contract. -func bindIERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IERC20MetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IERC20 *IERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IERC20.Contract.IERC20Caller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IERC20 *IERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IERC20.Contract.IERC20Transactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IERC20 *IERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IERC20.Contract.IERC20Transactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IERC20 *IERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IERC20.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IERC20 *IERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IERC20.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IERC20 *IERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IERC20.Contract.contract.Transact(opts, method, params...) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_IERC20 *IERC20Caller) Allowance(opts *bind.CallOpts, owner common.Address, spender common.Address) (*big.Int, error) { - var out []interface{} - err := _IERC20.contract.Call(opts, &out, "allowance", owner, spender) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_IERC20 *IERC20Session) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _IERC20.Contract.Allowance(&_IERC20.CallOpts, owner, spender) -} - -// Allowance is a free data retrieval call binding the contract method 0xdd62ed3e. -// -// Solidity: function allowance(address owner, address spender) view returns(uint256) -func (_IERC20 *IERC20CallerSession) Allowance(owner common.Address, spender common.Address) (*big.Int, error) { - return _IERC20.Contract.Allowance(&_IERC20.CallOpts, owner, spender) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_IERC20 *IERC20Caller) BalanceOf(opts *bind.CallOpts, account common.Address) (*big.Int, error) { - var out []interface{} - err := _IERC20.contract.Call(opts, &out, "balanceOf", account) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_IERC20 *IERC20Session) BalanceOf(account common.Address) (*big.Int, error) { - return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account) -} - -// BalanceOf is a free data retrieval call binding the contract method 0x70a08231. -// -// Solidity: function balanceOf(address account) view returns(uint256) -func (_IERC20 *IERC20CallerSession) BalanceOf(account common.Address) (*big.Int, error) { - return _IERC20.Contract.BalanceOf(&_IERC20.CallOpts, account) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_IERC20 *IERC20Caller) TotalSupply(opts *bind.CallOpts) (*big.Int, error) { - var out []interface{} - err := _IERC20.contract.Call(opts, &out, "totalSupply") - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_IERC20 *IERC20Session) TotalSupply() (*big.Int, error) { - return _IERC20.Contract.TotalSupply(&_IERC20.CallOpts) -} - -// TotalSupply is a free data retrieval call binding the contract method 0x18160ddd. -// -// Solidity: function totalSupply() view returns(uint256) -func (_IERC20 *IERC20CallerSession) TotalSupply() (*big.Int, error) { - return _IERC20.Contract.TotalSupply(&_IERC20.CallOpts) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_IERC20 *IERC20Transactor) Approve(opts *bind.TransactOpts, spender common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.contract.Transact(opts, "approve", spender, value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_IERC20 *IERC20Session) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, value) -} - -// Approve is a paid mutator transaction binding the contract method 0x095ea7b3. -// -// Solidity: function approve(address spender, uint256 value) returns(bool) -func (_IERC20 *IERC20TransactorSession) Approve(spender common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.Contract.Approve(&_IERC20.TransactOpts, spender, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_IERC20 *IERC20Transactor) Transfer(opts *bind.TransactOpts, to common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.contract.Transact(opts, "transfer", to, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_IERC20 *IERC20Session) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.Contract.Transfer(&_IERC20.TransactOpts, to, value) -} - -// Transfer is a paid mutator transaction binding the contract method 0xa9059cbb. -// -// Solidity: function transfer(address to, uint256 value) returns(bool) -func (_IERC20 *IERC20TransactorSession) Transfer(to common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.Contract.Transfer(&_IERC20.TransactOpts, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_IERC20 *IERC20Transactor) TransferFrom(opts *bind.TransactOpts, from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.contract.Transact(opts, "transferFrom", from, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_IERC20 *IERC20Session) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.Contract.TransferFrom(&_IERC20.TransactOpts, from, to, value) -} - -// TransferFrom is a paid mutator transaction binding the contract method 0x23b872dd. -// -// Solidity: function transferFrom(address from, address to, uint256 value) returns(bool) -func (_IERC20 *IERC20TransactorSession) TransferFrom(from common.Address, to common.Address, value *big.Int) (*types.Transaction, error) { - return _IERC20.Contract.TransferFrom(&_IERC20.TransactOpts, from, to, value) -} - -// IERC20ApprovalIterator is returned from FilterApproval and is used to iterate over the raw logs and unpacked data for Approval events raised by the IERC20 contract. -type IERC20ApprovalIterator struct { - Event *IERC20Approval // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IERC20ApprovalIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IERC20Approval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IERC20Approval) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IERC20ApprovalIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IERC20ApprovalIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IERC20Approval represents a Approval event raised by the IERC20 contract. -type IERC20Approval struct { - Owner common.Address - Spender common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterApproval is a free log retrieval operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_IERC20 *IERC20Filterer) FilterApproval(opts *bind.FilterOpts, owner []common.Address, spender []common.Address) (*IERC20ApprovalIterator, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _IERC20.contract.FilterLogs(opts, "Approval", ownerRule, spenderRule) - if err != nil { - return nil, err - } - return &IERC20ApprovalIterator{contract: _IERC20.contract, event: "Approval", logs: logs, sub: sub}, nil -} - -// WatchApproval is a free log subscription operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_IERC20 *IERC20Filterer) WatchApproval(opts *bind.WatchOpts, sink chan<- *IERC20Approval, owner []common.Address, spender []common.Address) (event.Subscription, error) { - - var ownerRule []interface{} - for _, ownerItem := range owner { - ownerRule = append(ownerRule, ownerItem) - } - var spenderRule []interface{} - for _, spenderItem := range spender { - spenderRule = append(spenderRule, spenderItem) - } - - logs, sub, err := _IERC20.contract.WatchLogs(opts, "Approval", ownerRule, spenderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IERC20Approval) - if err := _IERC20.contract.UnpackLog(event, "Approval", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseApproval is a log parse operation binding the contract event 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925. -// -// Solidity: event Approval(address indexed owner, address indexed spender, uint256 value) -func (_IERC20 *IERC20Filterer) ParseApproval(log types.Log) (*IERC20Approval, error) { - event := new(IERC20Approval) - if err := _IERC20.contract.UnpackLog(event, "Approval", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IERC20TransferIterator is returned from FilterTransfer and is used to iterate over the raw logs and unpacked data for Transfer events raised by the IERC20 contract. -type IERC20TransferIterator struct { - Event *IERC20Transfer // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IERC20TransferIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IERC20Transfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IERC20Transfer) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IERC20TransferIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IERC20TransferIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IERC20Transfer represents a Transfer event raised by the IERC20 contract. -type IERC20Transfer struct { - From common.Address - To common.Address - Value *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterTransfer is a free log retrieval operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_IERC20 *IERC20Filterer) FilterTransfer(opts *bind.FilterOpts, from []common.Address, to []common.Address) (*IERC20TransferIterator, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IERC20.contract.FilterLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return &IERC20TransferIterator{contract: _IERC20.contract, event: "Transfer", logs: logs, sub: sub}, nil -} - -// WatchTransfer is a free log subscription operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_IERC20 *IERC20Filterer) WatchTransfer(opts *bind.WatchOpts, sink chan<- *IERC20Transfer, from []common.Address, to []common.Address) (event.Subscription, error) { - - var fromRule []interface{} - for _, fromItem := range from { - fromRule = append(fromRule, fromItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IERC20.contract.WatchLogs(opts, "Transfer", fromRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IERC20Transfer) - if err := _IERC20.contract.UnpackLog(event, "Transfer", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseTransfer is a log parse operation binding the contract event 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef. -// -// Solidity: event Transfer(address indexed from, address indexed to, uint256 value) -func (_IERC20 *IERC20Filterer) ParseTransfer(log types.Log) (*IERC20Transfer, error) { - event := new(IERC20Transfer) - if err := _IERC20.contract.UnpackLog(event, "Transfer", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IERC20PermitMetaData contains all meta data concerning the IERC20Permit contract. -var IERC20PermitMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "3644e515": "DOMAIN_SEPARATOR()", - "7ecebe00": "nonces(address)", - "d505accf": "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)", - }, -} - -// IERC20PermitABI is the input ABI used to generate the binding from. -// Deprecated: Use IERC20PermitMetaData.ABI instead. -var IERC20PermitABI = IERC20PermitMetaData.ABI - -// Deprecated: Use IERC20PermitMetaData.Sigs instead. -// IERC20PermitFuncSigs maps the 4-byte function signature to its string representation. -var IERC20PermitFuncSigs = IERC20PermitMetaData.Sigs - -// IERC20Permit is an auto generated Go binding around an Ethereum contract. -type IERC20Permit struct { - IERC20PermitCaller // Read-only binding to the contract - IERC20PermitTransactor // Write-only binding to the contract - IERC20PermitFilterer // Log filterer for contract events -} - -// IERC20PermitCaller is an auto generated read-only Go binding around an Ethereum contract. -type IERC20PermitCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC20PermitTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IERC20PermitTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC20PermitFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IERC20PermitFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IERC20PermitSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IERC20PermitSession struct { - Contract *IERC20Permit // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IERC20PermitCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IERC20PermitCallerSession struct { - Contract *IERC20PermitCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IERC20PermitTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IERC20PermitTransactorSession struct { - Contract *IERC20PermitTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IERC20PermitRaw is an auto generated low-level Go binding around an Ethereum contract. -type IERC20PermitRaw struct { - Contract *IERC20Permit // Generic contract binding to access the raw methods on -} - -// IERC20PermitCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IERC20PermitCallerRaw struct { - Contract *IERC20PermitCaller // Generic read-only contract binding to access the raw methods on -} - -// IERC20PermitTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IERC20PermitTransactorRaw struct { - Contract *IERC20PermitTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIERC20Permit creates a new instance of IERC20Permit, bound to a specific deployed contract. -func NewIERC20Permit(address common.Address, backend bind.ContractBackend) (*IERC20Permit, error) { - contract, err := bindIERC20Permit(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IERC20Permit{IERC20PermitCaller: IERC20PermitCaller{contract: contract}, IERC20PermitTransactor: IERC20PermitTransactor{contract: contract}, IERC20PermitFilterer: IERC20PermitFilterer{contract: contract}}, nil -} - -// NewIERC20PermitCaller creates a new read-only instance of IERC20Permit, bound to a specific deployed contract. -func NewIERC20PermitCaller(address common.Address, caller bind.ContractCaller) (*IERC20PermitCaller, error) { - contract, err := bindIERC20Permit(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IERC20PermitCaller{contract: contract}, nil -} - -// NewIERC20PermitTransactor creates a new write-only instance of IERC20Permit, bound to a specific deployed contract. -func NewIERC20PermitTransactor(address common.Address, transactor bind.ContractTransactor) (*IERC20PermitTransactor, error) { - contract, err := bindIERC20Permit(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IERC20PermitTransactor{contract: contract}, nil -} - -// NewIERC20PermitFilterer creates a new log filterer instance of IERC20Permit, bound to a specific deployed contract. -func NewIERC20PermitFilterer(address common.Address, filterer bind.ContractFilterer) (*IERC20PermitFilterer, error) { - contract, err := bindIERC20Permit(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IERC20PermitFilterer{contract: contract}, nil -} - -// bindIERC20Permit binds a generic wrapper to an already deployed contract. -func bindIERC20Permit(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IERC20PermitMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IERC20Permit *IERC20PermitRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IERC20Permit.Contract.IERC20PermitCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IERC20Permit *IERC20PermitRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IERC20Permit.Contract.IERC20PermitTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IERC20Permit *IERC20PermitRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IERC20Permit.Contract.IERC20PermitTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IERC20Permit *IERC20PermitCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IERC20Permit.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IERC20Permit *IERC20PermitTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IERC20Permit.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IERC20Permit *IERC20PermitTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IERC20Permit.Contract.contract.Transact(opts, method, params...) -} - -// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. -// -// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) -func (_IERC20Permit *IERC20PermitCaller) DOMAINSEPARATOR(opts *bind.CallOpts) ([32]byte, error) { - var out []interface{} - err := _IERC20Permit.contract.Call(opts, &out, "DOMAIN_SEPARATOR") - - if err != nil { - return *new([32]byte), err - } - - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) - - return out0, err - -} - -// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. -// -// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) -func (_IERC20Permit *IERC20PermitSession) DOMAINSEPARATOR() ([32]byte, error) { - return _IERC20Permit.Contract.DOMAINSEPARATOR(&_IERC20Permit.CallOpts) -} - -// DOMAINSEPARATOR is a free data retrieval call binding the contract method 0x3644e515. -// -// Solidity: function DOMAIN_SEPARATOR() view returns(bytes32) -func (_IERC20Permit *IERC20PermitCallerSession) DOMAINSEPARATOR() ([32]byte, error) { - return _IERC20Permit.Contract.DOMAINSEPARATOR(&_IERC20Permit.CallOpts) -} - -// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. -// -// Solidity: function nonces(address owner) view returns(uint256) -func (_IERC20Permit *IERC20PermitCaller) Nonces(opts *bind.CallOpts, owner common.Address) (*big.Int, error) { - var out []interface{} - err := _IERC20Permit.contract.Call(opts, &out, "nonces", owner) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. -// -// Solidity: function nonces(address owner) view returns(uint256) -func (_IERC20Permit *IERC20PermitSession) Nonces(owner common.Address) (*big.Int, error) { - return _IERC20Permit.Contract.Nonces(&_IERC20Permit.CallOpts, owner) -} - -// Nonces is a free data retrieval call binding the contract method 0x7ecebe00. -// -// Solidity: function nonces(address owner) view returns(uint256) -func (_IERC20Permit *IERC20PermitCallerSession) Nonces(owner common.Address) (*big.Int, error) { - return _IERC20Permit.Contract.Nonces(&_IERC20Permit.CallOpts, owner) -} - -// Permit is a paid mutator transaction binding the contract method 0xd505accf. -// -// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() -func (_IERC20Permit *IERC20PermitTransactor) Permit(opts *bind.TransactOpts, owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _IERC20Permit.contract.Transact(opts, "permit", owner, spender, value, deadline, v, r, s) -} - -// Permit is a paid mutator transaction binding the contract method 0xd505accf. -// -// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() -func (_IERC20Permit *IERC20PermitSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _IERC20Permit.Contract.Permit(&_IERC20Permit.TransactOpts, owner, spender, value, deadline, v, r, s) -} - -// Permit is a paid mutator transaction binding the contract method 0xd505accf. -// -// Solidity: function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) returns() -func (_IERC20Permit *IERC20PermitTransactorSession) Permit(owner common.Address, spender common.Address, value *big.Int, deadline *big.Int, v uint8, r [32]byte, s [32]byte) (*types.Transaction, error) { - return _IERC20Permit.Contract.Permit(&_IERC20Permit.TransactOpts, owner, spender, value, deadline, v, r, s) -} - -// IFastBridgeMetaData contains all meta data concerning the IFastBridge contract. -var IFastBridgeMetaData = &bind.MetaData{ - ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositRefunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"BridgeProofDisputed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"}],\"name\":\"BridgeProofProvided\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainGasAmount\",\"type\":\"uint256\"}],\"name\":\"BridgeRelayed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"}],\"name\":\"BridgeRequested\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"structIFastBridge.BridgeParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"bridge\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"canClaim\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"dispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"getBridgeTransaction\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"originSender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"originFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"structIFastBridge.BridgeTransaction\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"destTxHash\",\"type\":\"bytes32\"}],\"name\":\"prove\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"refund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]", - Sigs: map[string]string{ - "45851694": "bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))", - "aa9641ab": "canClaim(bytes32,address)", - "41fcb612": "claim(bytes,address)", - "add98c70": "dispute(bytes32)", - "ac11fb1a": "getBridgeTransaction(bytes)", - "886d36ff": "prove(bytes,bytes32)", - "5eb7d946": "refund(bytes)", - "8f0d6f17": "relay(bytes)", - }, -} - -// IFastBridgeABI is the input ABI used to generate the binding from. -// Deprecated: Use IFastBridgeMetaData.ABI instead. -var IFastBridgeABI = IFastBridgeMetaData.ABI - -// Deprecated: Use IFastBridgeMetaData.Sigs instead. -// IFastBridgeFuncSigs maps the 4-byte function signature to its string representation. -var IFastBridgeFuncSigs = IFastBridgeMetaData.Sigs - -// IFastBridge is an auto generated Go binding around an Ethereum contract. -type IFastBridge struct { - IFastBridgeCaller // Read-only binding to the contract - IFastBridgeTransactor // Write-only binding to the contract - IFastBridgeFilterer // Log filterer for contract events -} - -// IFastBridgeCaller is an auto generated read-only Go binding around an Ethereum contract. -type IFastBridgeCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IFastBridgeTransactor is an auto generated write-only Go binding around an Ethereum contract. -type IFastBridgeTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IFastBridgeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type IFastBridgeFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// IFastBridgeSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type IFastBridgeSession struct { - Contract *IFastBridge // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IFastBridgeCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type IFastBridgeCallerSession struct { - Contract *IFastBridgeCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// IFastBridgeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type IFastBridgeTransactorSession struct { - Contract *IFastBridgeTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// IFastBridgeRaw is an auto generated low-level Go binding around an Ethereum contract. -type IFastBridgeRaw struct { - Contract *IFastBridge // Generic contract binding to access the raw methods on -} - -// IFastBridgeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type IFastBridgeCallerRaw struct { - Contract *IFastBridgeCaller // Generic read-only contract binding to access the raw methods on -} - -// IFastBridgeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type IFastBridgeTransactorRaw struct { - Contract *IFastBridgeTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewIFastBridge creates a new instance of IFastBridge, bound to a specific deployed contract. -func NewIFastBridge(address common.Address, backend bind.ContractBackend) (*IFastBridge, error) { - contract, err := bindIFastBridge(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &IFastBridge{IFastBridgeCaller: IFastBridgeCaller{contract: contract}, IFastBridgeTransactor: IFastBridgeTransactor{contract: contract}, IFastBridgeFilterer: IFastBridgeFilterer{contract: contract}}, nil -} - -// NewIFastBridgeCaller creates a new read-only instance of IFastBridge, bound to a specific deployed contract. -func NewIFastBridgeCaller(address common.Address, caller bind.ContractCaller) (*IFastBridgeCaller, error) { - contract, err := bindIFastBridge(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &IFastBridgeCaller{contract: contract}, nil -} - -// NewIFastBridgeTransactor creates a new write-only instance of IFastBridge, bound to a specific deployed contract. -func NewIFastBridgeTransactor(address common.Address, transactor bind.ContractTransactor) (*IFastBridgeTransactor, error) { - contract, err := bindIFastBridge(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &IFastBridgeTransactor{contract: contract}, nil -} - -// NewIFastBridgeFilterer creates a new log filterer instance of IFastBridge, bound to a specific deployed contract. -func NewIFastBridgeFilterer(address common.Address, filterer bind.ContractFilterer) (*IFastBridgeFilterer, error) { - contract, err := bindIFastBridge(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &IFastBridgeFilterer{contract: contract}, nil -} - -// bindIFastBridge binds a generic wrapper to an already deployed contract. -func bindIFastBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := IFastBridgeMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IFastBridge *IFastBridgeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IFastBridge.Contract.IFastBridgeCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IFastBridge *IFastBridgeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IFastBridge.Contract.IFastBridgeTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IFastBridge *IFastBridgeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IFastBridge.Contract.IFastBridgeTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_IFastBridge *IFastBridgeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _IFastBridge.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_IFastBridge *IFastBridgeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _IFastBridge.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_IFastBridge *IFastBridgeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _IFastBridge.Contract.contract.Transact(opts, method, params...) -} - -// CanClaim is a free data retrieval call binding the contract method 0xaa9641ab. -// -// Solidity: function canClaim(bytes32 transactionId, address relayer) view returns(bool) -func (_IFastBridge *IFastBridgeCaller) CanClaim(opts *bind.CallOpts, transactionId [32]byte, relayer common.Address) (bool, error) { - var out []interface{} - err := _IFastBridge.contract.Call(opts, &out, "canClaim", transactionId, relayer) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// CanClaim is a free data retrieval call binding the contract method 0xaa9641ab. -// -// Solidity: function canClaim(bytes32 transactionId, address relayer) view returns(bool) -func (_IFastBridge *IFastBridgeSession) CanClaim(transactionId [32]byte, relayer common.Address) (bool, error) { - return _IFastBridge.Contract.CanClaim(&_IFastBridge.CallOpts, transactionId, relayer) -} - -// CanClaim is a free data retrieval call binding the contract method 0xaa9641ab. -// -// Solidity: function canClaim(bytes32 transactionId, address relayer) view returns(bool) -func (_IFastBridge *IFastBridgeCallerSession) CanClaim(transactionId [32]byte, relayer common.Address) (bool, error) { - return _IFastBridge.Contract.CanClaim(&_IFastBridge.CallOpts, transactionId, relayer) -} - -// GetBridgeTransaction is a free data retrieval call binding the contract method 0xac11fb1a. -// -// Solidity: function getBridgeTransaction(bytes request) pure returns((uint32,uint32,address,address,address,address,uint256,uint256,uint256,bool,uint256,uint256)) -func (_IFastBridge *IFastBridgeCaller) GetBridgeTransaction(opts *bind.CallOpts, request []byte) (IFastBridgeBridgeTransaction, error) { - var out []interface{} - err := _IFastBridge.contract.Call(opts, &out, "getBridgeTransaction", request) - - if err != nil { - return *new(IFastBridgeBridgeTransaction), err - } - - out0 := *abi.ConvertType(out[0], new(IFastBridgeBridgeTransaction)).(*IFastBridgeBridgeTransaction) - - return out0, err - -} - -// GetBridgeTransaction is a free data retrieval call binding the contract method 0xac11fb1a. -// -// Solidity: function getBridgeTransaction(bytes request) pure returns((uint32,uint32,address,address,address,address,uint256,uint256,uint256,bool,uint256,uint256)) -func (_IFastBridge *IFastBridgeSession) GetBridgeTransaction(request []byte) (IFastBridgeBridgeTransaction, error) { - return _IFastBridge.Contract.GetBridgeTransaction(&_IFastBridge.CallOpts, request) -} - -// GetBridgeTransaction is a free data retrieval call binding the contract method 0xac11fb1a. -// -// Solidity: function getBridgeTransaction(bytes request) pure returns((uint32,uint32,address,address,address,address,uint256,uint256,uint256,bool,uint256,uint256)) -func (_IFastBridge *IFastBridgeCallerSession) GetBridgeTransaction(request []byte) (IFastBridgeBridgeTransaction, error) { - return _IFastBridge.Contract.GetBridgeTransaction(&_IFastBridge.CallOpts, request) -} - -// Bridge is a paid mutator transaction binding the contract method 0x45851694. -// -// Solidity: function bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256) params) payable returns() -func (_IFastBridge *IFastBridgeTransactor) Bridge(opts *bind.TransactOpts, params IFastBridgeBridgeParams) (*types.Transaction, error) { - return _IFastBridge.contract.Transact(opts, "bridge", params) -} - -// Bridge is a paid mutator transaction binding the contract method 0x45851694. -// -// Solidity: function bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256) params) payable returns() -func (_IFastBridge *IFastBridgeSession) Bridge(params IFastBridgeBridgeParams) (*types.Transaction, error) { - return _IFastBridge.Contract.Bridge(&_IFastBridge.TransactOpts, params) -} - -// Bridge is a paid mutator transaction binding the contract method 0x45851694. -// -// Solidity: function bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256) params) payable returns() -func (_IFastBridge *IFastBridgeTransactorSession) Bridge(params IFastBridgeBridgeParams) (*types.Transaction, error) { - return _IFastBridge.Contract.Bridge(&_IFastBridge.TransactOpts, params) -} - -// Claim is a paid mutator transaction binding the contract method 0x41fcb612. -// -// Solidity: function claim(bytes request, address to) returns() -func (_IFastBridge *IFastBridgeTransactor) Claim(opts *bind.TransactOpts, request []byte, to common.Address) (*types.Transaction, error) { - return _IFastBridge.contract.Transact(opts, "claim", request, to) -} - -// Claim is a paid mutator transaction binding the contract method 0x41fcb612. -// -// Solidity: function claim(bytes request, address to) returns() -func (_IFastBridge *IFastBridgeSession) Claim(request []byte, to common.Address) (*types.Transaction, error) { - return _IFastBridge.Contract.Claim(&_IFastBridge.TransactOpts, request, to) -} - -// Claim is a paid mutator transaction binding the contract method 0x41fcb612. -// -// Solidity: function claim(bytes request, address to) returns() -func (_IFastBridge *IFastBridgeTransactorSession) Claim(request []byte, to common.Address) (*types.Transaction, error) { - return _IFastBridge.Contract.Claim(&_IFastBridge.TransactOpts, request, to) -} - -// Dispute is a paid mutator transaction binding the contract method 0xadd98c70. -// -// Solidity: function dispute(bytes32 transactionId) returns() -func (_IFastBridge *IFastBridgeTransactor) Dispute(opts *bind.TransactOpts, transactionId [32]byte) (*types.Transaction, error) { - return _IFastBridge.contract.Transact(opts, "dispute", transactionId) -} - -// Dispute is a paid mutator transaction binding the contract method 0xadd98c70. -// -// Solidity: function dispute(bytes32 transactionId) returns() -func (_IFastBridge *IFastBridgeSession) Dispute(transactionId [32]byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Dispute(&_IFastBridge.TransactOpts, transactionId) -} - -// Dispute is a paid mutator transaction binding the contract method 0xadd98c70. -// -// Solidity: function dispute(bytes32 transactionId) returns() -func (_IFastBridge *IFastBridgeTransactorSession) Dispute(transactionId [32]byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Dispute(&_IFastBridge.TransactOpts, transactionId) -} - -// Prove is a paid mutator transaction binding the contract method 0x886d36ff. -// -// Solidity: function prove(bytes request, bytes32 destTxHash) returns() -func (_IFastBridge *IFastBridgeTransactor) Prove(opts *bind.TransactOpts, request []byte, destTxHash [32]byte) (*types.Transaction, error) { - return _IFastBridge.contract.Transact(opts, "prove", request, destTxHash) -} - -// Prove is a paid mutator transaction binding the contract method 0x886d36ff. -// -// Solidity: function prove(bytes request, bytes32 destTxHash) returns() -func (_IFastBridge *IFastBridgeSession) Prove(request []byte, destTxHash [32]byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Prove(&_IFastBridge.TransactOpts, request, destTxHash) -} - -// Prove is a paid mutator transaction binding the contract method 0x886d36ff. -// -// Solidity: function prove(bytes request, bytes32 destTxHash) returns() -func (_IFastBridge *IFastBridgeTransactorSession) Prove(request []byte, destTxHash [32]byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Prove(&_IFastBridge.TransactOpts, request, destTxHash) -} - -// Refund is a paid mutator transaction binding the contract method 0x5eb7d946. -// -// Solidity: function refund(bytes request) returns() -func (_IFastBridge *IFastBridgeTransactor) Refund(opts *bind.TransactOpts, request []byte) (*types.Transaction, error) { - return _IFastBridge.contract.Transact(opts, "refund", request) -} - -// Refund is a paid mutator transaction binding the contract method 0x5eb7d946. -// -// Solidity: function refund(bytes request) returns() -func (_IFastBridge *IFastBridgeSession) Refund(request []byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Refund(&_IFastBridge.TransactOpts, request) -} - -// Refund is a paid mutator transaction binding the contract method 0x5eb7d946. -// -// Solidity: function refund(bytes request) returns() -func (_IFastBridge *IFastBridgeTransactorSession) Refund(request []byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Refund(&_IFastBridge.TransactOpts, request) -} - -// Relay is a paid mutator transaction binding the contract method 0x8f0d6f17. -// -// Solidity: function relay(bytes request) payable returns() -func (_IFastBridge *IFastBridgeTransactor) Relay(opts *bind.TransactOpts, request []byte) (*types.Transaction, error) { - return _IFastBridge.contract.Transact(opts, "relay", request) -} - -// Relay is a paid mutator transaction binding the contract method 0x8f0d6f17. -// -// Solidity: function relay(bytes request) payable returns() -func (_IFastBridge *IFastBridgeSession) Relay(request []byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Relay(&_IFastBridge.TransactOpts, request) -} - -// Relay is a paid mutator transaction binding the contract method 0x8f0d6f17. -// -// Solidity: function relay(bytes request) payable returns() -func (_IFastBridge *IFastBridgeTransactorSession) Relay(request []byte) (*types.Transaction, error) { - return _IFastBridge.Contract.Relay(&_IFastBridge.TransactOpts, request) -} - -// IFastBridgeBridgeDepositClaimedIterator is returned from FilterBridgeDepositClaimed and is used to iterate over the raw logs and unpacked data for BridgeDepositClaimed events raised by the IFastBridge contract. -type IFastBridgeBridgeDepositClaimedIterator struct { - Event *IFastBridgeBridgeDepositClaimed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IFastBridgeBridgeDepositClaimedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeDepositClaimed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeDepositClaimed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IFastBridgeBridgeDepositClaimedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFastBridgeBridgeDepositClaimedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFastBridgeBridgeDepositClaimed represents a BridgeDepositClaimed event raised by the IFastBridge contract. -type IFastBridgeBridgeDepositClaimed struct { - TransactionId [32]byte - Relayer common.Address - To common.Address - Token common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeDepositClaimed is a free log retrieval operation binding the contract event 0x582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac678. -// -// Solidity: event BridgeDepositClaimed(bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount) -func (_IFastBridge *IFastBridgeFilterer) FilterBridgeDepositClaimed(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address, to []common.Address) (*IFastBridgeBridgeDepositClaimedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IFastBridge.contract.FilterLogs(opts, "BridgeDepositClaimed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return &IFastBridgeBridgeDepositClaimedIterator{contract: _IFastBridge.contract, event: "BridgeDepositClaimed", logs: logs, sub: sub}, nil -} - -// WatchBridgeDepositClaimed is a free log subscription operation binding the contract event 0x582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac678. -// -// Solidity: event BridgeDepositClaimed(bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount) -func (_IFastBridge *IFastBridgeFilterer) WatchBridgeDepositClaimed(opts *bind.WatchOpts, sink chan<- *IFastBridgeBridgeDepositClaimed, transactionId [][32]byte, relayer []common.Address, to []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IFastBridge.contract.WatchLogs(opts, "BridgeDepositClaimed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IFastBridgeBridgeDepositClaimed) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeDepositClaimed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeDepositClaimed is a log parse operation binding the contract event 0x582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac678. -// -// Solidity: event BridgeDepositClaimed(bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount) -func (_IFastBridge *IFastBridgeFilterer) ParseBridgeDepositClaimed(log types.Log) (*IFastBridgeBridgeDepositClaimed, error) { - event := new(IFastBridgeBridgeDepositClaimed) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeDepositClaimed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IFastBridgeBridgeDepositRefundedIterator is returned from FilterBridgeDepositRefunded and is used to iterate over the raw logs and unpacked data for BridgeDepositRefunded events raised by the IFastBridge contract. -type IFastBridgeBridgeDepositRefundedIterator struct { - Event *IFastBridgeBridgeDepositRefunded // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IFastBridgeBridgeDepositRefundedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeDepositRefunded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeDepositRefunded) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IFastBridgeBridgeDepositRefundedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFastBridgeBridgeDepositRefundedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFastBridgeBridgeDepositRefunded represents a BridgeDepositRefunded event raised by the IFastBridge contract. -type IFastBridgeBridgeDepositRefunded struct { - TransactionId [32]byte - To common.Address - Token common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeDepositRefunded is a free log retrieval operation binding the contract event 0xb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958. -// -// Solidity: event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount) -func (_IFastBridge *IFastBridgeFilterer) FilterBridgeDepositRefunded(opts *bind.FilterOpts, transactionId [][32]byte, to []common.Address) (*IFastBridgeBridgeDepositRefundedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IFastBridge.contract.FilterLogs(opts, "BridgeDepositRefunded", transactionIdRule, toRule) - if err != nil { - return nil, err - } - return &IFastBridgeBridgeDepositRefundedIterator{contract: _IFastBridge.contract, event: "BridgeDepositRefunded", logs: logs, sub: sub}, nil -} - -// WatchBridgeDepositRefunded is a free log subscription operation binding the contract event 0xb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958. -// -// Solidity: event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount) -func (_IFastBridge *IFastBridgeFilterer) WatchBridgeDepositRefunded(opts *bind.WatchOpts, sink chan<- *IFastBridgeBridgeDepositRefunded, transactionId [][32]byte, to []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IFastBridge.contract.WatchLogs(opts, "BridgeDepositRefunded", transactionIdRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IFastBridgeBridgeDepositRefunded) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeDepositRefunded", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeDepositRefunded is a log parse operation binding the contract event 0xb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958. -// -// Solidity: event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount) -func (_IFastBridge *IFastBridgeFilterer) ParseBridgeDepositRefunded(log types.Log) (*IFastBridgeBridgeDepositRefunded, error) { - event := new(IFastBridgeBridgeDepositRefunded) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeDepositRefunded", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IFastBridgeBridgeProofDisputedIterator is returned from FilterBridgeProofDisputed and is used to iterate over the raw logs and unpacked data for BridgeProofDisputed events raised by the IFastBridge contract. -type IFastBridgeBridgeProofDisputedIterator struct { - Event *IFastBridgeBridgeProofDisputed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IFastBridgeBridgeProofDisputedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeProofDisputed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeProofDisputed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IFastBridgeBridgeProofDisputedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFastBridgeBridgeProofDisputedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFastBridgeBridgeProofDisputed represents a BridgeProofDisputed event raised by the IFastBridge contract. -type IFastBridgeBridgeProofDisputed struct { - TransactionId [32]byte - Relayer common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeProofDisputed is a free log retrieval operation binding the contract event 0x0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad4. -// -// Solidity: event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer) -func (_IFastBridge *IFastBridgeFilterer) FilterBridgeProofDisputed(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address) (*IFastBridgeBridgeProofDisputedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _IFastBridge.contract.FilterLogs(opts, "BridgeProofDisputed", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return &IFastBridgeBridgeProofDisputedIterator{contract: _IFastBridge.contract, event: "BridgeProofDisputed", logs: logs, sub: sub}, nil -} - -// WatchBridgeProofDisputed is a free log subscription operation binding the contract event 0x0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad4. -// -// Solidity: event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer) -func (_IFastBridge *IFastBridgeFilterer) WatchBridgeProofDisputed(opts *bind.WatchOpts, sink chan<- *IFastBridgeBridgeProofDisputed, transactionId [][32]byte, relayer []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _IFastBridge.contract.WatchLogs(opts, "BridgeProofDisputed", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IFastBridgeBridgeProofDisputed) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeProofDisputed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeProofDisputed is a log parse operation binding the contract event 0x0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad4. -// -// Solidity: event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer) -func (_IFastBridge *IFastBridgeFilterer) ParseBridgeProofDisputed(log types.Log) (*IFastBridgeBridgeProofDisputed, error) { - event := new(IFastBridgeBridgeProofDisputed) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeProofDisputed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IFastBridgeBridgeProofProvidedIterator is returned from FilterBridgeProofProvided and is used to iterate over the raw logs and unpacked data for BridgeProofProvided events raised by the IFastBridge contract. -type IFastBridgeBridgeProofProvidedIterator struct { - Event *IFastBridgeBridgeProofProvided // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IFastBridgeBridgeProofProvidedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeProofProvided) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeProofProvided) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IFastBridgeBridgeProofProvidedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFastBridgeBridgeProofProvidedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFastBridgeBridgeProofProvided represents a BridgeProofProvided event raised by the IFastBridge contract. -type IFastBridgeBridgeProofProvided struct { - TransactionId [32]byte - Relayer common.Address - TransactionHash [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeProofProvided is a free log retrieval operation binding the contract event 0x4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4. -// -// Solidity: event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash) -func (_IFastBridge *IFastBridgeFilterer) FilterBridgeProofProvided(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address) (*IFastBridgeBridgeProofProvidedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _IFastBridge.contract.FilterLogs(opts, "BridgeProofProvided", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return &IFastBridgeBridgeProofProvidedIterator{contract: _IFastBridge.contract, event: "BridgeProofProvided", logs: logs, sub: sub}, nil -} - -// WatchBridgeProofProvided is a free log subscription operation binding the contract event 0x4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4. -// -// Solidity: event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash) -func (_IFastBridge *IFastBridgeFilterer) WatchBridgeProofProvided(opts *bind.WatchOpts, sink chan<- *IFastBridgeBridgeProofProvided, transactionId [][32]byte, relayer []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - - logs, sub, err := _IFastBridge.contract.WatchLogs(opts, "BridgeProofProvided", transactionIdRule, relayerRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IFastBridgeBridgeProofProvided) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeProofProvided", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeProofProvided is a log parse operation binding the contract event 0x4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4. -// -// Solidity: event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash) -func (_IFastBridge *IFastBridgeFilterer) ParseBridgeProofProvided(log types.Log) (*IFastBridgeBridgeProofProvided, error) { - event := new(IFastBridgeBridgeProofProvided) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeProofProvided", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IFastBridgeBridgeRelayedIterator is returned from FilterBridgeRelayed and is used to iterate over the raw logs and unpacked data for BridgeRelayed events raised by the IFastBridge contract. -type IFastBridgeBridgeRelayedIterator struct { - Event *IFastBridgeBridgeRelayed // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IFastBridgeBridgeRelayedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeRelayed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeRelayed) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IFastBridgeBridgeRelayedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFastBridgeBridgeRelayedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFastBridgeBridgeRelayed represents a BridgeRelayed event raised by the IFastBridge contract. -type IFastBridgeBridgeRelayed struct { - TransactionId [32]byte - Relayer common.Address - To common.Address - OriginChainId uint32 - OriginToken common.Address - DestToken common.Address - OriginAmount *big.Int - DestAmount *big.Int - ChainGasAmount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeRelayed is a free log retrieval operation binding the contract event 0xf8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c. -// -// Solidity: event BridgeRelayed(bytes32 indexed transactionId, address indexed relayer, address indexed to, uint32 originChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, uint256 chainGasAmount) -func (_IFastBridge *IFastBridgeFilterer) FilterBridgeRelayed(opts *bind.FilterOpts, transactionId [][32]byte, relayer []common.Address, to []common.Address) (*IFastBridgeBridgeRelayedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IFastBridge.contract.FilterLogs(opts, "BridgeRelayed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return &IFastBridgeBridgeRelayedIterator{contract: _IFastBridge.contract, event: "BridgeRelayed", logs: logs, sub: sub}, nil -} - -// WatchBridgeRelayed is a free log subscription operation binding the contract event 0xf8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c. -// -// Solidity: event BridgeRelayed(bytes32 indexed transactionId, address indexed relayer, address indexed to, uint32 originChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, uint256 chainGasAmount) -func (_IFastBridge *IFastBridgeFilterer) WatchBridgeRelayed(opts *bind.WatchOpts, sink chan<- *IFastBridgeBridgeRelayed, transactionId [][32]byte, relayer []common.Address, to []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var relayerRule []interface{} - for _, relayerItem := range relayer { - relayerRule = append(relayerRule, relayerItem) - } - var toRule []interface{} - for _, toItem := range to { - toRule = append(toRule, toItem) - } - - logs, sub, err := _IFastBridge.contract.WatchLogs(opts, "BridgeRelayed", transactionIdRule, relayerRule, toRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IFastBridgeBridgeRelayed) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeRelayed", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeRelayed is a log parse operation binding the contract event 0xf8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c. -// -// Solidity: event BridgeRelayed(bytes32 indexed transactionId, address indexed relayer, address indexed to, uint32 originChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, uint256 chainGasAmount) -func (_IFastBridge *IFastBridgeFilterer) ParseBridgeRelayed(log types.Log) (*IFastBridgeBridgeRelayed, error) { - event := new(IFastBridgeBridgeRelayed) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeRelayed", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// IFastBridgeBridgeRequestedIterator is returned from FilterBridgeRequested and is used to iterate over the raw logs and unpacked data for BridgeRequested events raised by the IFastBridge contract. -type IFastBridgeBridgeRequestedIterator struct { - Event *IFastBridgeBridgeRequested // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *IFastBridgeBridgeRequestedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(IFastBridgeBridgeRequested) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *IFastBridgeBridgeRequestedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *IFastBridgeBridgeRequestedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// IFastBridgeBridgeRequested represents a BridgeRequested event raised by the IFastBridge contract. -type IFastBridgeBridgeRequested struct { - TransactionId [32]byte - Sender common.Address - Request []byte - DestChainId uint32 - OriginToken common.Address - DestToken common.Address - OriginAmount *big.Int - DestAmount *big.Int - SendChainGas bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterBridgeRequested is a free log retrieval operation binding the contract event 0x120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a. -// -// Solidity: event BridgeRequested(bytes32 indexed transactionId, address indexed sender, bytes request, uint32 destChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, bool sendChainGas) -func (_IFastBridge *IFastBridgeFilterer) FilterBridgeRequested(opts *bind.FilterOpts, transactionId [][32]byte, sender []common.Address) (*IFastBridgeBridgeRequestedIterator, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IFastBridge.contract.FilterLogs(opts, "BridgeRequested", transactionIdRule, senderRule) - if err != nil { - return nil, err - } - return &IFastBridgeBridgeRequestedIterator{contract: _IFastBridge.contract, event: "BridgeRequested", logs: logs, sub: sub}, nil -} - -// WatchBridgeRequested is a free log subscription operation binding the contract event 0x120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a. -// -// Solidity: event BridgeRequested(bytes32 indexed transactionId, address indexed sender, bytes request, uint32 destChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, bool sendChainGas) -func (_IFastBridge *IFastBridgeFilterer) WatchBridgeRequested(opts *bind.WatchOpts, sink chan<- *IFastBridgeBridgeRequested, transactionId [][32]byte, sender []common.Address) (event.Subscription, error) { - - var transactionIdRule []interface{} - for _, transactionIdItem := range transactionId { - transactionIdRule = append(transactionIdRule, transactionIdItem) - } - var senderRule []interface{} - for _, senderItem := range sender { - senderRule = append(senderRule, senderItem) - } - - logs, sub, err := _IFastBridge.contract.WatchLogs(opts, "BridgeRequested", transactionIdRule, senderRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(IFastBridgeBridgeRequested) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeRequested", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseBridgeRequested is a log parse operation binding the contract event 0x120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a. -// -// Solidity: event BridgeRequested(bytes32 indexed transactionId, address indexed sender, bytes request, uint32 destChainId, address originToken, address destToken, uint256 originAmount, uint256 destAmount, bool sendChainGas) -func (_IFastBridge *IFastBridgeFilterer) ParseBridgeRequested(log types.Log) (*IFastBridgeBridgeRequested, error) { - event := new(IFastBridgeBridgeRequested) - if err := _IFastBridge.contract.UnpackLog(event, "BridgeRequested", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// SafeERC20MetaData contains all meta data concerning the SafeERC20 contract. -var SafeERC20MetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentAllowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestedDecrease\",\"type\":\"uint256\"}],\"name\":\"SafeERC20FailedDecreaseAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"}]", - Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220666e86cec9574f32fc5a03b62558b15e14d370d438ddcd50d491395202b88bd664736f6c63430008140033", -} - -// SafeERC20ABI is the input ABI used to generate the binding from. -// Deprecated: Use SafeERC20MetaData.ABI instead. -var SafeERC20ABI = SafeERC20MetaData.ABI - -// SafeERC20Bin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use SafeERC20MetaData.Bin instead. -var SafeERC20Bin = SafeERC20MetaData.Bin - -// DeploySafeERC20 deploys a new Ethereum contract, binding an instance of SafeERC20 to it. -func DeploySafeERC20(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *SafeERC20, error) { - parsed, err := SafeERC20MetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(SafeERC20Bin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &SafeERC20{SafeERC20Caller: SafeERC20Caller{contract: contract}, SafeERC20Transactor: SafeERC20Transactor{contract: contract}, SafeERC20Filterer: SafeERC20Filterer{contract: contract}}, nil -} - -// SafeERC20 is an auto generated Go binding around an Ethereum contract. -type SafeERC20 struct { - SafeERC20Caller // Read-only binding to the contract - SafeERC20Transactor // Write-only binding to the contract - SafeERC20Filterer // Log filterer for contract events -} - -// SafeERC20Caller is an auto generated read-only Go binding around an Ethereum contract. -type SafeERC20Caller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeERC20Transactor is an auto generated write-only Go binding around an Ethereum contract. -type SafeERC20Transactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeERC20Filterer is an auto generated log filtering Go binding around an Ethereum contract events. -type SafeERC20Filterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// SafeERC20Session is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type SafeERC20Session struct { - Contract *SafeERC20 // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SafeERC20CallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type SafeERC20CallerSession struct { - Contract *SafeERC20Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// SafeERC20TransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type SafeERC20TransactorSession struct { - Contract *SafeERC20Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// SafeERC20Raw is an auto generated low-level Go binding around an Ethereum contract. -type SafeERC20Raw struct { - Contract *SafeERC20 // Generic contract binding to access the raw methods on -} - -// SafeERC20CallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type SafeERC20CallerRaw struct { - Contract *SafeERC20Caller // Generic read-only contract binding to access the raw methods on -} - -// SafeERC20TransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type SafeERC20TransactorRaw struct { - Contract *SafeERC20Transactor // Generic write-only contract binding to access the raw methods on -} - -// NewSafeERC20 creates a new instance of SafeERC20, bound to a specific deployed contract. -func NewSafeERC20(address common.Address, backend bind.ContractBackend) (*SafeERC20, error) { - contract, err := bindSafeERC20(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &SafeERC20{SafeERC20Caller: SafeERC20Caller{contract: contract}, SafeERC20Transactor: SafeERC20Transactor{contract: contract}, SafeERC20Filterer: SafeERC20Filterer{contract: contract}}, nil -} - -// NewSafeERC20Caller creates a new read-only instance of SafeERC20, bound to a specific deployed contract. -func NewSafeERC20Caller(address common.Address, caller bind.ContractCaller) (*SafeERC20Caller, error) { - contract, err := bindSafeERC20(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &SafeERC20Caller{contract: contract}, nil -} - -// NewSafeERC20Transactor creates a new write-only instance of SafeERC20, bound to a specific deployed contract. -func NewSafeERC20Transactor(address common.Address, transactor bind.ContractTransactor) (*SafeERC20Transactor, error) { - contract, err := bindSafeERC20(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &SafeERC20Transactor{contract: contract}, nil -} - -// NewSafeERC20Filterer creates a new log filterer instance of SafeERC20, bound to a specific deployed contract. -func NewSafeERC20Filterer(address common.Address, filterer bind.ContractFilterer) (*SafeERC20Filterer, error) { - contract, err := bindSafeERC20(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &SafeERC20Filterer{contract: contract}, nil -} - -// bindSafeERC20 binds a generic wrapper to an already deployed contract. -func bindSafeERC20(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := SafeERC20MetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SafeERC20 *SafeERC20Raw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _SafeERC20.Contract.SafeERC20Caller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SafeERC20 *SafeERC20Raw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SafeERC20.Contract.SafeERC20Transactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SafeERC20 *SafeERC20Raw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SafeERC20.Contract.SafeERC20Transactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_SafeERC20 *SafeERC20CallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _SafeERC20.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_SafeERC20 *SafeERC20TransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _SafeERC20.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_SafeERC20 *SafeERC20TransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _SafeERC20.Contract.contract.Transact(opts, method, params...) -} - -// UniversalTokenLibMetaData contains all meta data concerning the UniversalTokenLib contract. -var UniversalTokenLibMetaData = &bind.MetaData{ - ABI: "[]", - Bin: "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e4e2d25d1ecf953d0c56b6c7466118f3a795674cafbd14e67cc1d0633ea190a764736f6c63430008140033", -} - -// UniversalTokenLibABI is the input ABI used to generate the binding from. -// Deprecated: Use UniversalTokenLibMetaData.ABI instead. -var UniversalTokenLibABI = UniversalTokenLibMetaData.ABI - -// UniversalTokenLibBin is the compiled bytecode used for deploying new contracts. -// Deprecated: Use UniversalTokenLibMetaData.Bin instead. -var UniversalTokenLibBin = UniversalTokenLibMetaData.Bin - -// DeployUniversalTokenLib deploys a new Ethereum contract, binding an instance of UniversalTokenLib to it. -func DeployUniversalTokenLib(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, *types.Transaction, *UniversalTokenLib, error) { - parsed, err := UniversalTokenLibMetaData.GetAbi() - if err != nil { - return common.Address{}, nil, nil, err - } - if parsed == nil { - return common.Address{}, nil, nil, errors.New("GetABI returned nil") - } - - address, tx, contract, err := bind.DeployContract(auth, *parsed, common.FromHex(UniversalTokenLibBin), backend) - if err != nil { - return common.Address{}, nil, nil, err - } - return address, tx, &UniversalTokenLib{UniversalTokenLibCaller: UniversalTokenLibCaller{contract: contract}, UniversalTokenLibTransactor: UniversalTokenLibTransactor{contract: contract}, UniversalTokenLibFilterer: UniversalTokenLibFilterer{contract: contract}}, nil -} - -// UniversalTokenLib is an auto generated Go binding around an Ethereum contract. -type UniversalTokenLib struct { - UniversalTokenLibCaller // Read-only binding to the contract - UniversalTokenLibTransactor // Write-only binding to the contract - UniversalTokenLibFilterer // Log filterer for contract events -} - -// UniversalTokenLibCaller is an auto generated read-only Go binding around an Ethereum contract. -type UniversalTokenLibCaller struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniversalTokenLibTransactor is an auto generated write-only Go binding around an Ethereum contract. -type UniversalTokenLibTransactor struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniversalTokenLibFilterer is an auto generated log filtering Go binding around an Ethereum contract events. -type UniversalTokenLibFilterer struct { - contract *bind.BoundContract // Generic contract wrapper for the low level calls -} - -// UniversalTokenLibSession is an auto generated Go binding around an Ethereum contract, -// with pre-set call and transact options. -type UniversalTokenLibSession struct { - Contract *UniversalTokenLib // Generic contract binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// UniversalTokenLibCallerSession is an auto generated read-only Go binding around an Ethereum contract, -// with pre-set call options. -type UniversalTokenLibCallerSession struct { - Contract *UniversalTokenLibCaller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session -} - -// UniversalTokenLibTransactorSession is an auto generated write-only Go binding around an Ethereum contract, -// with pre-set transact options. -type UniversalTokenLibTransactorSession struct { - Contract *UniversalTokenLibTransactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session -} - -// UniversalTokenLibRaw is an auto generated low-level Go binding around an Ethereum contract. -type UniversalTokenLibRaw struct { - Contract *UniversalTokenLib // Generic contract binding to access the raw methods on -} - -// UniversalTokenLibCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. -type UniversalTokenLibCallerRaw struct { - Contract *UniversalTokenLibCaller // Generic read-only contract binding to access the raw methods on -} - -// UniversalTokenLibTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. -type UniversalTokenLibTransactorRaw struct { - Contract *UniversalTokenLibTransactor // Generic write-only contract binding to access the raw methods on -} - -// NewUniversalTokenLib creates a new instance of UniversalTokenLib, bound to a specific deployed contract. -func NewUniversalTokenLib(address common.Address, backend bind.ContractBackend) (*UniversalTokenLib, error) { - contract, err := bindUniversalTokenLib(address, backend, backend, backend) - if err != nil { - return nil, err - } - return &UniversalTokenLib{UniversalTokenLibCaller: UniversalTokenLibCaller{contract: contract}, UniversalTokenLibTransactor: UniversalTokenLibTransactor{contract: contract}, UniversalTokenLibFilterer: UniversalTokenLibFilterer{contract: contract}}, nil -} - -// NewUniversalTokenLibCaller creates a new read-only instance of UniversalTokenLib, bound to a specific deployed contract. -func NewUniversalTokenLibCaller(address common.Address, caller bind.ContractCaller) (*UniversalTokenLibCaller, error) { - contract, err := bindUniversalTokenLib(address, caller, nil, nil) - if err != nil { - return nil, err - } - return &UniversalTokenLibCaller{contract: contract}, nil -} - -// NewUniversalTokenLibTransactor creates a new write-only instance of UniversalTokenLib, bound to a specific deployed contract. -func NewUniversalTokenLibTransactor(address common.Address, transactor bind.ContractTransactor) (*UniversalTokenLibTransactor, error) { - contract, err := bindUniversalTokenLib(address, nil, transactor, nil) - if err != nil { - return nil, err - } - return &UniversalTokenLibTransactor{contract: contract}, nil -} - -// NewUniversalTokenLibFilterer creates a new log filterer instance of UniversalTokenLib, bound to a specific deployed contract. -func NewUniversalTokenLibFilterer(address common.Address, filterer bind.ContractFilterer) (*UniversalTokenLibFilterer, error) { - contract, err := bindUniversalTokenLib(address, nil, nil, filterer) - if err != nil { - return nil, err - } - return &UniversalTokenLibFilterer{contract: contract}, nil -} - -// bindUniversalTokenLib binds a generic wrapper to an already deployed contract. -func bindUniversalTokenLib(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := UniversalTokenLibMetaData.GetAbi() - if err != nil { - return nil, err - } - return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_UniversalTokenLib *UniversalTokenLibRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _UniversalTokenLib.Contract.UniversalTokenLibCaller.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_UniversalTokenLib *UniversalTokenLibRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _UniversalTokenLib.Contract.UniversalTokenLibTransactor.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_UniversalTokenLib *UniversalTokenLibRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _UniversalTokenLib.Contract.UniversalTokenLibTransactor.contract.Transact(opts, method, params...) -} - -// Call invokes the (constant) contract method with params as input values and -// sets the output to result. The result type might be a single field for simple -// returns, a slice of interfaces for anonymous returns and a struct for named -// returns. -func (_UniversalTokenLib *UniversalTokenLibCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { - return _UniversalTokenLib.Contract.contract.Call(opts, result, method, params...) -} - -// Transfer initiates a plain transaction to move funds to the contract, calling -// its default method if one is available. -func (_UniversalTokenLib *UniversalTokenLibTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { - return _UniversalTokenLib.Contract.contract.Transfer(opts) -} - -// Transact invokes the (paid) contract method with params as input values. -func (_UniversalTokenLib *UniversalTokenLibTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - return _UniversalTokenLib.Contract.contract.Transact(opts, method, params...) -} diff --git a/services/rfq/contracts/fastbridge/fastbridge.contractinfo.json b/services/rfq/contracts/fastbridge/fastbridge.contractinfo.json deleted file mode 100644 index 09ad87a951..0000000000 --- a/services/rfq/contracts/fastbridge/fastbridge.contractinfo.json +++ /dev/null @@ -1 +0,0 @@ -{"solidity/FastBridge.sol:AccessControl":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":[{"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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Contract module that allows children to implement role-based access control mechanisms. This is a lightweight version that doesn't allow enumerating role members except through off-chain means by accessing the contract event logs. Some applications may benefit from on-chain enumerability, for those cases see {AccessControlEnumerable}. Roles are referred to by their `bytes32` identifier. These should be exposed in the external API and be unique. The best way to achieve this is by using `public constant` hash digests: ```solidity bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\"); ``` Roles can be used to represent a set of permissions. To restrict access to a function call, use {hasRole}: ```solidity function foo() public { require(hasRole(MY_ROLE, msg.sender)); ... } ``` Roles can be granted and revoked dynamically via the {grantRole} and {revokeRole} functions. Each role has an associated admin role, and only accounts that have a role's admin role can call {grantRole} and {revokeRole}. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means that only accounts with this role will be able to grant or revoke other roles. More complex role relationships can be created by using {_setRoleAdmin}. WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to grant and revoke this role. Extra precautions should be taken to secure accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} to enforce additional security measures for this role.","errors":{"AccessControlBadConfirmation()":[{"details":"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."}],"AccessControlUnauthorizedAccount(address,bytes32)":[{"details":"The `account` is missing a role."}]},"events":{"RoleAdminChanged(bytes32,bytes32,bytes32)":{"details":"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."},"RoleGranted(bytes32,address,address)":{"details":"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."},"RoleRevoked(bytes32,address,address)":{"details":"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"}},"kind":"dev","methods":{"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event."},"supportsInterface(bytes4)":{"details":"See {IERC165-supportsInterface}."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"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\":[{\"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\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract module that allows children to implement role-based access control mechanisms. This is a lightweight version that doesn't allow enumerating role members except through off-chain means by accessing the contract event logs. Some applications may benefit from on-chain enumerability, for those cases see {AccessControlEnumerable}. Roles are referred to by their `bytes32` identifier. These should be exposed in the external API and be unique. The best way to achieve this is by using `public constant` hash digests: ```solidity bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\"); ``` Roles can be used to represent a set of permissions. To restrict access to a function call, use {hasRole}: ```solidity function foo() public { require(hasRole(MY_ROLE, msg.sender)); ... } ``` Roles can be granted and revoked dynamically via the {grantRole} and {revokeRole} functions. Each role has an associated admin role, and only accounts that have a role's admin role can call {grantRole} and {revokeRole}. By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means that only accounts with this role will be able to grant or revoke other roles. More complex role relationships can be created by using {_setRoleAdmin}. WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to grant and revoke this role. Extra precautions should be taken to secure accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules} to enforce additional security measures for this role.\",\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"AccessControl\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"DEFAULT_ADMIN_ROLE()":"a217fddf","getRoleAdmin(bytes32)":"248a9ca3","grantRole(bytes32,address)":"2f2ff15d","hasRole(bytes32,address)":"91d14854","renounceRole(bytes32,address)":"36568abe","revokeRole(bytes32,address)":"d547741f","supportsInterface(bytes4)":"01ffc9a7"}},"solidity/FastBridge.sol:AccessControlEnumerable":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Extension of {AccessControl} that allows enumerating the members of each role.","errors":{"AccessControlBadConfirmation()":[{"details":"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."}],"AccessControlUnauthorizedAccount(address,bytes32)":[{"details":"The `account` is missing a role."}]},"events":{"RoleAdminChanged(bytes32,bytes32,bytes32)":{"details":"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."},"RoleGranted(bytes32,address,address)":{"details":"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."},"RoleRevoked(bytes32,address,address)":{"details":"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"}},"kind":"dev","methods":{"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}."},"getRoleMember(bytes32,uint256)":{"details":"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information."},"getRoleMemberCount(bytes32)":{"details":"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event."},"supportsInterface(bytes4)":{"details":"See {IERC165-supportsInterface}."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":[{\"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\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Extension of {AccessControl} that allows enumerating the members of each role.\",\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"AccessControlEnumerable\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"DEFAULT_ADMIN_ROLE()":"a217fddf","getRoleAdmin(bytes32)":"248a9ca3","getRoleMember(bytes32,uint256)":"9010d07c","getRoleMemberCount(bytes32)":"ca15c873","grantRole(bytes32,address)":"2f2ff15d","hasRole(bytes32,address)":"91d14854","renounceRole(bytes32,address)":"36568abe","revokeRole(bytes32,address)":"d547741f","supportsInterface(bytes4)":"01ffc9a7"}},"solidity/FastBridge.sol:Address":{"code":"0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c02bf2e5594888dce767567f7c2924eb180fd6f6904899db27dad663ca8f547864736f6c63430008140033","runtime-code":"0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220c02bf2e5594888dce767567f7c2924eb180fd6f6904899db27dad663ca8f547864736f6c63430008140033","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"15598:6066:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;15598:6066:0;;;;;;;;;;;;;;;;;","srcMapRuntime":"15598:6066:0:-:0;;;;;;;;","abiDefinition":[{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Collection of functions related to the address type","errors":{"AddressEmptyCode(address)":[{"details":"There's no code at `target` (it is not a contract)."}],"AddressInsufficientBalance(address)":[{"details":"The ETH balance of the account is not enough to perform the operation."}],"FailedInnerCall()":[{"details":"A call to an address target failed. The target may have reverted."}]},"kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"Collection of functions related to the address type\",\"errors\":{\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}]},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"Address\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{}},"solidity/FastBridge.sol:Admin":{"code":"0x60806040523480156200001157600080fd5b50604051620014123803806200141283398101604081905262000034916200018e565b6200004160008262000049565b5050620001b9565b60008062000058848462000086565b905080156200007d5760008481526001602052604090206200007b908462000134565b505b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff166200012b576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000e23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000080565b50600062000080565b60006200007d836001600160a01b03841660008181526001830160205260408120546200012b5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000080565b600060208284031215620001a157600080fd5b81516001600160a01b03811681146200007d57600080fd5b61124980620001c96000396000f3fe608060405234801561001057600080fd5b50600436106101775760003560e01c806391d14854116100d8578063bf333f2c1161008c578063d547741f11610066578063d547741f14610385578063dcf844a714610398578063e00a83e0146103b857600080fd5b8063bf333f2c14610341578063ca15c8731461034b578063ccc574901461035e57600080fd5b8063a217fddf116100bd578063a217fddf14610313578063b13aa2d61461031b578063b250fe6b1461032e57600080fd5b806391d14854146102a8578063926d7d7f146102ec57600080fd5b80632f2ff15d1161012f57806358f858801161011457806358f85880146102405780635960ccf2146102495780639010d07c1461027057600080fd5b80632f2ff15d1461021a57806336568abe1461022d57600080fd5b806306f333f21161016057806306f333f2146101d95780630f5f6ed7146101ee578063248a9ca3146101f757600080fd5b806301ffc9a71461017c57806303ed0ee5146101a4575b600080fd5b61018f61018a366004611013565b6103c1565b60405190151581526020015b60405180910390f35b6101cb7f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d81565b60405190815260200161019b565b6101ec6101e736600461107e565b61041d565b005b6101cb61271081565b6101cb6102053660046110b1565b60009081526020819052604090206001015490565b6101ec6102283660046110ca565b61050b565b6101ec61023b3660046110ca565b610536565b6101cb60025481565b6101cb7fdb9556138406326f00296e13ea2ad7db24ba82381212d816b1a40c23b466b32781565b61028361027e3660046110ed565b61058f565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b61018f6102b63660046110ca565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6101cb7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b6101cb600081565b6101ec6103293660046110b1565b6105ae565b6101ec61033c3660046110b1565b610690565b6101cb620f424081565b6101cb6103593660046110b1565b6106f8565b6101cb7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b6101ec6103933660046110ca565b61070f565b6101cb6103a636600461110f565b60036020526000908152604090205481565b6101cb60045481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f000000000000000000000000000000000000000000000000000000001480610417575061041782610734565b92915050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610447816107cb565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120549081900361047b5750505050565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408120556104ac9084836107d8565b6040805173ffffffffffffffffffffffffffffffffffffffff8087168252851660208201529081018290527f244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd9060600160405180910390a1505b505050565b600082815260208190526040902060010154610526816107cb565b610530838361092f565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610585576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105068282610964565b60008281526001602052604081206105a79083610991565b9392505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556105d8816107cb565b612710821115610649576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e657746656552617465203e206d61780000000000000000000000000000000060448201526064015b60405180910390fd5b600280549083905560408051828152602081018590527f14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb95791015b60405180910390a1505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556106ba816107cb565b600480549083905560408051828152602081018590527f5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa9101610683565b60008181526001602052604081206104179061099d565b60008281526020819052604090206001015461072a816107cb565b6105308383610964565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061041757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610417565b6107d581336109a7565b50565b3073ffffffffffffffffffffffffffffffffffffffff8316036107fa57505050565b8060000361080757505050565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff84160161090e5760008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461089e576040519150601f19603f3d011682016040523d82523d6000602084013e6108a3565b606091505b5050905080610530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610640565b61050673ffffffffffffffffffffffffffffffffffffffff84168383610a31565b60008061093c8484610abe565b905080156105a757600084815260016020526040902061095c9084610bba565b509392505050565b6000806109718484610bdc565b905080156105a757600084815260016020526040902061095c9084610c97565b60006105a78383610cb9565b6000610417825490565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a2d576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260248101839052604401610640565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610506908490610ce3565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16610bb25760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610b503390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610417565b506000610417565b60006105a78373ffffffffffffffffffffffffffffffffffffffff8416610d79565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1615610bb25760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610417565b60006105a78373ffffffffffffffffffffffffffffffffffffffff8416610dc0565b6000826000018281548110610cd057610cd061112a565b9060005260206000200154905092915050565b6000610d0573ffffffffffffffffffffffffffffffffffffffff841683610eb3565b90508051600014158015610d2a575080806020019051810190610d289190611159565b155b15610506576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610640565b6000818152600183016020526040812054610bb257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610417565b60008181526001830160205260408120548015610ea9576000610de460018361117b565b8554909150600090610df89060019061117b565b9050808214610e5d576000866000018281548110610e1857610e1861112a565b9060005260206000200154905080876000018481548110610e3b57610e3b61112a565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e6e57610e6e6111b5565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610417565b6000915050610417565b60606105a783836000846000808573ffffffffffffffffffffffffffffffffffffffff168486604051610ee691906111e4565b60006040518083038185875af1925050503d8060008114610f23576040519150601f19603f3d011682016040523d82523d6000602084013e610f28565b606091505b5091509150610f38868383610f42565b9695505050505050565b606082610f5757610f5282610fd1565b6105a7565b8151158015610f7b575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610fca576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610640565b50806105a7565b805115610fe15780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561102557600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146105a757600080fd5b803573ffffffffffffffffffffffffffffffffffffffff8116811461107957600080fd5b919050565b6000806040838503121561109157600080fd5b61109a83611055565b91506110a860208401611055565b90509250929050565b6000602082840312156110c357600080fd5b5035919050565b600080604083850312156110dd57600080fd5b823591506110a860208401611055565b6000806040838503121561110057600080fd5b50508035926020909101359150565b60006020828403121561112157600080fd5b6105a782611055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561116b57600080fd5b815180151581146105a757600080fd5b81810381811115610417577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000825160005b8181101561120557602081860181015185830152016111eb565b50600092019182525091905056fea26469706673582212207051827fc52cd8db023eca7a58610870ecfcd93ea76d5ed3296b385ea81ce18e64736f6c63430008140033","runtime-code":"0x608060405234801561001057600080fd5b50600436106101775760003560e01c806391d14854116100d8578063bf333f2c1161008c578063d547741f11610066578063d547741f14610385578063dcf844a714610398578063e00a83e0146103b857600080fd5b8063bf333f2c14610341578063ca15c8731461034b578063ccc574901461035e57600080fd5b8063a217fddf116100bd578063a217fddf14610313578063b13aa2d61461031b578063b250fe6b1461032e57600080fd5b806391d14854146102a8578063926d7d7f146102ec57600080fd5b80632f2ff15d1161012f57806358f858801161011457806358f85880146102405780635960ccf2146102495780639010d07c1461027057600080fd5b80632f2ff15d1461021a57806336568abe1461022d57600080fd5b806306f333f21161016057806306f333f2146101d95780630f5f6ed7146101ee578063248a9ca3146101f757600080fd5b806301ffc9a71461017c57806303ed0ee5146101a4575b600080fd5b61018f61018a366004611013565b6103c1565b60405190151581526020015b60405180910390f35b6101cb7f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d81565b60405190815260200161019b565b6101ec6101e736600461107e565b61041d565b005b6101cb61271081565b6101cb6102053660046110b1565b60009081526020819052604090206001015490565b6101ec6102283660046110ca565b61050b565b6101ec61023b3660046110ca565b610536565b6101cb60025481565b6101cb7fdb9556138406326f00296e13ea2ad7db24ba82381212d816b1a40c23b466b32781565b61028361027e3660046110ed565b61058f565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161019b565b61018f6102b63660046110ca565b60009182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6101cb7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b6101cb600081565b6101ec6103293660046110b1565b6105ae565b6101ec61033c3660046110b1565b610690565b6101cb620f424081565b6101cb6103593660046110b1565b6106f8565b6101cb7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b6101ec6103933660046110ca565b61070f565b6101cb6103a636600461110f565b60036020526000908152604090205481565b6101cb60045481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f000000000000000000000000000000000000000000000000000000001480610417575061041782610734565b92915050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f55610447816107cb565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600360205260408120549081900361047b5750505050565b73ffffffffffffffffffffffffffffffffffffffff84166000818152600360205260408120556104ac9084836107d8565b6040805173ffffffffffffffffffffffffffffffffffffffff8087168252851660208201529081018290527f244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd9060600160405180910390a1505b505050565b600082815260208190526040902060010154610526816107cb565b610530838361092f565b50505050565b73ffffffffffffffffffffffffffffffffffffffff81163314610585576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6105068282610964565b60008281526001602052604081206105a79083610991565b9392505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556105d8816107cb565b612710821115610649576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e657746656552617465203e206d61780000000000000000000000000000000060448201526064015b60405180910390fd5b600280549083905560408051828152602081018590527f14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb95791015b60405180910390a1505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f556106ba816107cb565b600480549083905560408051828152602081018590527f5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa9101610683565b60008181526001602052604081206104179061099d565b60008281526020819052604090206001015461072a816107cb565b6105308383610964565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061041757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610417565b6107d581336109a7565b50565b3073ffffffffffffffffffffffffffffffffffffffff8316036107fa57505050565b8060000361080757505050565b7fffffffffffffffffffffffff111111111111111111111111111111111111111273ffffffffffffffffffffffffffffffffffffffff84160161090e5760008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461089e576040519150601f19603f3d011682016040523d82523d6000602084013e6108a3565b606091505b5050905080610530576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c6564000000000000000000000000006044820152606401610640565b61050673ffffffffffffffffffffffffffffffffffffffff84168383610a31565b60008061093c8484610abe565b905080156105a757600084815260016020526040902061095c9084610bba565b509392505050565b6000806109718484610bdc565b905080156105a757600084815260016020526040902061095c9084610c97565b60006105a78383610cb9565b6000610417825490565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610a2d576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8216600482015260248101839052604401610640565b5050565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610506908490610ce3565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff16610bb25760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055610b503390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610417565b506000610417565b60006105a78373ffffffffffffffffffffffffffffffffffffffff8416610d79565b60008281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1615610bb25760008381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610417565b60006105a78373ffffffffffffffffffffffffffffffffffffffff8416610dc0565b6000826000018281548110610cd057610cd061112a565b9060005260206000200154905092915050565b6000610d0573ffffffffffffffffffffffffffffffffffffffff841683610eb3565b90508051600014158015610d2a575080806020019051810190610d289190611159565b155b15610506576040517f5274afe700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152602401610640565b6000818152600183016020526040812054610bb257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610417565b60008181526001830160205260408120548015610ea9576000610de460018361117b565b8554909150600090610df89060019061117b565b9050808214610e5d576000866000018281548110610e1857610e1861112a565b9060005260206000200154905080876000018481548110610e3b57610e3b61112a565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080610e6e57610e6e6111b5565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610417565b6000915050610417565b60606105a783836000846000808573ffffffffffffffffffffffffffffffffffffffff168486604051610ee691906111e4565b60006040518083038185875af1925050503d8060008114610f23576040519150601f19603f3d011682016040523d82523d6000602084013e610f28565b606091505b5091509150610f38868383610f42565b9695505050505050565b606082610f5757610f5282610fd1565b6105a7565b8151158015610f7b575073ffffffffffffffffffffffffffffffffffffffff84163b155b15610fca576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85166004820152602401610640565b50806105a7565b805115610fe15780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561102557600080fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146105a757600080fd5b803573ffffffffffffffffffffffffffffffffffffffff8116811461107957600080fd5b919050565b6000806040838503121561109157600080fd5b61109a83611055565b91506110a860208401611055565b90509250929050565b6000602082840312156110c357600080fd5b5035919050565b600080604083850312156110dd57600080fd5b823591506110a860208401611055565b6000806040838503121561110057600080fd5b50508035926020909101359150565b60006020828403121561112157600080fd5b6105a782611055565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006020828403121561116b57600080fd5b815180151581146105a757600080fd5b81810381811115610417577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000825160005b8181101561120557602081860181015185830152016111eb565b50600092019182525091905056fea26469706673582212207051827fc52cd8db023eca7a58610870ecfcd93ea76d5ed3296b385ea81ce18e64736f6c63430008140033","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"56322:1843:0:-:0;;;57149:83;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;57187:38;46359:4;57218:6;57187:10;:38::i;:::-;;57149:83;56322:1843;;55672:257;55758:4;;55789:31;55806:4;55812:7;55789:16;:31::i;:::-;55774:46;;55834:7;55830:69;;;55857:18;;;;:12;:18;;;;;:31;;55880:7;55857:22;:31::i;:::-;;55830:69;55915:7;-1:-1:-1;55672:257:0;;;;;:::o;50306:316::-;50383:4;47081:12;;;;;;;;;;;-1:-1:-1;;;;;47081:29:0;;;;;;;;;;;;50399:217;;50442:6;:12;;;;;;;;;;;-1:-1:-1;;;;;50442:29:0;;;;;;;;;:36;;-1:-1:-1;;50442:36:0;50474:4;50442:36;;;50524:12;22402:10;;22323:96;50524:12;-1:-1:-1;;;;;50497:40:0;50515:7;-1:-1:-1;;;;;50497:40:0;50509:4;50497:40;;;;;;;;;;-1:-1:-1;50558:4:0;50551:11;;50399:217;-1:-1:-1;50600:5:0;50593:12;;31847:150;31917:4;31940:50;31945:3;-1:-1:-1;;;;;31965:23:0;;25835:4;27891:21;;;:14;;;:21;;;;;;25851:321;;-1:-1:-1;25893:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;26075:18;;26051:21;;;:14;;;:21;;;;;;:42;;;;26107:11;;14:290:1;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;179:16;;-1:-1:-1;;;;;224:31:1;;214:42;;204:70;;270:1;267;260:12;14:290;56322:1843:0;;;;;;","srcMapRuntime":"56322:1843:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54332:212;;;;;;:::i;:::-;;:::i;:::-;;;516:14:1;;509:22;491:41;;479:2;464:18;54332:212:0;;;;;;;;56562:60;;56599:23;56562:60;;;;;689:25:1;;;677:2;662:18;56562:60:0;543:177:1;57534:359:0;;;;;;:::i;:::-;;:::i;:::-;;56744:45;;56783:6;56744:45;;47937:120;;;;;;:::i;:::-;48002:7;48028:12;;;;;;;;;;:22;;;;47937:120;48353:136;;;;;;:::i;:::-;;:::i;49455:245::-;;;;;;:::i;:::-;;:::i;56906:30::-;;;;;;56490:66;;56530:26;56490:66;;55129:142;;;;;;:::i;:::-;;:::i;:::-;;;2246:42:1;2234:55;;;2216:74;;2204:2;2189:18;55129:142:0;2070:226:1;46981:136:0;;;;;;:::i;:::-;47058:4;47081:12;;;;;;;;;;;:29;;;;;;;;;;;;;;;;46981:136;56420:64;;56459:25;56420:64;;46314:49;;46359:4;46314:49;;57238:290;;;;;;:::i;:::-;;:::i;57899:264::-;;;;;;:::i;:::-;;:::i;56701:37::-;;56735:3;56701:37;;55439:131;;;;;;:::i;:::-;;:::i;56628:66::-;;56668:26;56628:66;;48769:138;;;;;;:::i;:::-;;:::i;56992:47::-;;;;;;:::i;:::-;;;;;;;;;;;;;;57113:29;;;;;;54332:212;54417:4;54440:57;;;54455:42;54440:57;;:97;;;54501:36;54525:11;54501:23;:36::i;:::-;54433:104;54332:212;-1:-1:-1;;54332:212:0:o;57534:359::-;56668:26;46591:16;46602:4;46591:10;:16::i;:::-;57658:19:::1;::::0;::::1;57638:17;57658:19:::0;;;:12:::1;:19;::::0;;;;;;57691:14;;;57687:27:::1;;57707:7;57534:359:::0;;;:::o;57687:27::-:1;57755:19;::::0;::::1;57777:1;57755:19:::0;;;:12:::1;:19;::::0;;;;:23;57788:45:::1;::::0;57812:9;57823;57788:23:::1;:45::i;:::-;57848:38;::::0;;2889:42:1;2958:15;;;2940:34;;3010:15;;3005:2;2990:18;;2983:43;3042:18;;;3035:34;;;57848:38:0::1;::::0;2867:2:1;2852:18;57848:38:0::1;;;;;;;57628:265;46617:1;57534:359:::0;;;:::o;48353:136::-;48002:7;48028:12;;;;;;;;;;:22;;;46591:16;46602:4;46591:10;:16::i;:::-;48457:25:::1;48468:4;48474:7;48457:10;:25::i;:::-;;48353:136:::0;;;:::o;49455:245::-;49548:34;;;22402:10;49548:34;49544:102;;49605:30;;;;;;;;;;;;;;49544:102;49656:37;49668:4;49674:18;49656:11;:37::i;55129:142::-;55210:7;55236:18;;;:12;:18;;;;;:28;;55258:5;55236:21;:28::i;:::-;55229:35;55129:142;-1:-1:-1;;;55129:142:0:o;57238:290::-;56668:26;46591:16;46602:4;46591:10;:16::i;:::-;56783:6:::1;57337:10;:26;;57329:55;;;::::0;::::1;::::0;;3282:2:1;57329:55:0::1;::::0;::::1;3264:21:1::0;3321:2;3301:18;;;3294:30;3360:18;3340;;;3333:46;3396:18;;57329:55:0::1;;;;;;;;;57415:15;::::0;;57440:28;;;;57483:38:::1;::::0;;3599:25:1;;;3655:2;3640:18;;3633:34;;;57483:38:0::1;::::0;3572:18:1;57483:38:0::1;;;;;;;;57319:209;57238:290:::0;;:::o;57899:264::-;56668:26;46591:16;46602:4;46591:10;:16::i;:::-;58024:14:::1;::::0;;58048:34;;;;58097:59:::1;::::0;;3599:25:1;;;3655:2;3640:18;;3633:34;;;58097:59:0::1;::::0;3572:18:1;58097:59:0::1;3425:248:1::0;55439:131:0;55510:7;55536:18;;;:12;:18;;;;;:27;;:25;:27::i;48769:138::-;48002:7;48028:12;;;;;;;;;;:22;;;46591:16;46602:4;46591:10;:16::i;:::-;48874:26:::1;48886:4;48892:7;48874:11;:26::i;46692:202::-:0;46777:4;46800:47;;;46815:32;46800:47;;:87;;-1:-1:-1;38607:25:0;38592:40;;;;46851:36;38493:146;47326:103;47392:30;47403:4;22402:10;47392;:30::i;:::-;47326:103;:::o;51604:653::-;51779:4;51765:19;;;;51761:32;;51604:653;;;:::o;51761:32::-;51865:5;51874:1;51865:10;51861:23;;51604:653;;;:::o;51861:23::-;51897:20;;;;;51893:358;;52077:12;52094:2;:7;;52109:5;52094:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;52076:43;;;52141:7;52133:39;;;;;;;4090:2:1;52133:39:0;;;4072:21:1;4129:2;4109:18;;;4102:30;4168:21;4148:18;;;4141:49;4207:18;;52133:39:0;3888:343:1;51893:358:0;52203:37;:26;;;52230:2;52234:5;52203:26;:37::i;55672:257::-;55758:4;55774:12;55789:31;55806:4;55812:7;55789:16;:31::i;:::-;55774:46;;55834:7;55830:69;;;55857:18;;;;:12;:18;;;;;:31;;55880:7;55857:22;:31::i;:::-;;55915:7;55672:257;-1:-1:-1;;;55672:257:0:o;56032:262::-;56119:4;56135:12;56150:32;56168:4;56174:7;56150:17;:32::i;:::-;56135:47;;56196:7;56192:72;;;56219:18;;;;:12;:18;;;;;:34;;56245:7;56219:25;:34::i;33105:156::-;33179:7;33229:22;33233:3;33245:5;33229:3;:22::i;32648:115::-;32711:7;32737:19;32745:3;28087:18;;28005:107;47559:197;47058:4;47081:12;;;;;;;;;;;:29;;;;;;;;;;;;;47642:108;;47692:47;;;;;4440:42:1;4428:55;;47692:47:0;;;4410:74:1;4500:18;;;4493:34;;;4383:18;;47692:47:0;4236:297:1;47642:108:0;47559:197;;:::o;39809:160::-;39918:43;;;39933:14;4428:55:1;;39918:43:0;;;4410:74:1;4500:18;;;;4493:34;;;39918:43:0;;;;;;;;;;4383:18:1;;;;39918:43:0;;;;;;;;;;;;;;39891:71;;39911:5;;39891:19;:71::i;50306:316::-;50383:4;47081:12;;;;;;;;;;;:29;;;;;;;;;;;;;50399:217;;50442:6;:12;;;;;;;;;;;:29;;;;;;;;;;:36;;;;50474:4;50442:36;;;50524:12;22402:10;;22323:96;50524:12;50497:40;;50515:7;50497:40;;50509:4;50497:40;;;;;;;;;;-1:-1:-1;50558:4:0;50551:11;;50399:217;-1:-1:-1;50600:5:0;50593:12;;31847:150;31917:4;31940:50;31945:3;31965:23;;;31940:4;:50::i;50857:317::-;50935:4;47081:12;;;;;;;;;;;:29;;;;;;;;;;;;;50951:217;;;51025:5;50993:12;;;;;;;;;;;:29;;;;;;;;;;;:37;;;;;;51049:40;22402:10;;50993:12;;51049:40;;51025:5;51049:40;-1:-1:-1;51110:4:0;51103:11;;32165:156;32238:4;32261:53;32269:3;32289:23;;;32261:7;:53::i;28454:118::-;28521:7;28547:3;:11;;28559:5;28547:18;;;;;;;;:::i;:::-;;;;;;;;;28540:25;;28454:118;;;;:::o;42565:629::-;42984:23;43010:33;:27;;;43038:4;43010:27;:33::i;:::-;42984:59;;43057:10;:17;43078:1;43057:22;;:57;;;;;43095:10;43084:30;;;;;;;;;;;;:::i;:::-;43083:31;43057:57;43053:135;;;43137:40;;;;;2246:42:1;2234:55;;43137:40:0;;;2216:74:1;2189:18;;43137:40:0;2070:226:1;25772:406:0;25835:4;27891:21;;;:14;;;:21;;;;;;25851:321;;-1:-1:-1;25893:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;26075:18;;26051:21;;;:14;;;:21;;;;;;:42;;;;26107:11;;26346:1368;26412:4;26541:21;;;:14;;;:21;;;;;;26577:13;;26573:1135;;26944:18;26965:12;26976:1;26965:8;:12;:::i;:::-;27011:18;;26944:33;;-1:-1:-1;26991:17:0;;27011:22;;27032:1;;27011:22;:::i;:::-;26991:42;;27066:9;27052:10;:23;27048:378;;27095:17;27115:3;:11;;27127:9;27115:22;;;;;;;;:::i;:::-;;;;;;;;;27095:42;;27262:9;27236:3;:11;;27248:10;27236:23;;;;;;;;:::i;:::-;;;;;;;;;;;;:35;;;;27375:25;;;:14;;;:25;;;;;:36;;;27048:378;27504:17;;:3;;:17;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;27607:3;:14;;:21;27622:5;27607:21;;;;;;;;;;;27600:28;;;27650:4;27643:11;;;;;;;26573:1135;27692:5;27685:12;;;;;18108:151;18183:12;18214:38;18236:6;18244:4;18250:1;18183:12;18824;18838:23;18865:6;:11;;18884:5;18891:4;18865:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18823:73;;;;18913:55;18940:6;18948:7;18957:10;18913:26;:55::i;:::-;18906:62;18583:392;-1:-1:-1;;;;;;18583:392:0:o;20028:582::-;20172:12;20201:7;20196:408;;20224:19;20232:10;20224:7;:19::i;:::-;20196:408;;;20448:17;;:22;:49;;;;-1:-1:-1;20474:18:0;;;;:23;20448:49;20444:119;;;20524:24;;;;;2246:42:1;2234:55;;20524:24:0;;;2216:74:1;2189:18;;20524:24:0;2070:226:1;20444:119:0;-1:-1:-1;20583:10:0;20576:17;;21146:516;21277:17;;:21;21273:383;;21505:10;21499:17;21561:15;21548:10;21544:2;21540:19;21533:44;21273:383;21628:17;;;;;;;;;;;;;;14:332:1;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;180:9;167:23;230:66;223:5;219:78;212:5;209:89;199:117;;312:1;309;302:12;725:196;793:20;;853:42;842:54;;832:65;;822:93;;911:1;908;901:12;822:93;725:196;;;:::o;926:260::-;994:6;1002;1055:2;1043:9;1034:7;1030:23;1026:32;1023:52;;;1071:1;1068;1061:12;1023:52;1094:29;1113:9;1094:29;:::i;:::-;1084:39;;1142:38;1176:2;1165:9;1161:18;1142:38;:::i;:::-;1132:48;;926:260;;;;;:::o;1373:180::-;1432:6;1485:2;1473:9;1464:7;1460:23;1456:32;1453:52;;;1501:1;1498;1491:12;1453:52;-1:-1:-1;1524:23:1;;1373:180;-1:-1:-1;1373:180:1:o;1558:254::-;1626:6;1634;1687:2;1675:9;1666:7;1662:23;1658:32;1655:52;;;1703:1;1700;1693:12;1655:52;1739:9;1726:23;1716:33;;1768:38;1802:2;1791:9;1787:18;1768:38;:::i;1817:248::-;1885:6;1893;1946:2;1934:9;1925:7;1921:23;1917:32;1914:52;;;1962:1;1959;1952:12;1914:52;-1:-1:-1;;1985:23:1;;;2055:2;2040:18;;;2027:32;;-1:-1:-1;1817:248:1:o;2486:186::-;2545:6;2598:2;2586:9;2577:7;2573:23;2569:32;2566:52;;;2614:1;2611;2604:12;2566:52;2637:29;2656:9;2637:29;:::i;4840:184::-;4892:77;4889:1;4882:88;4989:4;4986:1;4979:15;5013:4;5010:1;5003:15;5029:277;5096:6;5149:2;5137:9;5128:7;5124:23;5120:32;5117:52;;;5165:1;5162;5155:12;5117:52;5197:9;5191:16;5250:5;5243:13;5236:21;5229:5;5226:32;5216:60;;5272:1;5269;5262:12;5311:282;5378:9;;;5399:11;;;5396:191;;;5443:77;5440:1;5433:88;5544:4;5541:1;5534:15;5572:4;5569:1;5562:15;5598:184;5650:77;5647:1;5640:88;5747:4;5744:1;5737:15;5771:4;5768:1;5761:15;5787:412;5916:3;5954:6;5948:13;5979:1;5989:129;6003:6;6000:1;5997:13;5989:129;;;6101:4;6085:14;;;6081:25;;6075:32;6062:11;;;6055:53;6018:12;5989:129;;;-1:-1:-1;6173:1:1;6137:16;;6162:13;;;-1:-1:-1;6137:16:1;5787:412;-1:-1:-1;5787:412:1:o","abiDefinition":[{"inputs":[{"internalType":"address","name":"_owner","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":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldChainGasAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newChainGasAmount","type":"uint256"}],"name":"ChainGasAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"FeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesSwept","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_RATE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOVERNOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUARD_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REFUNDER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RELAYER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainGasAmount","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":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"protocolFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"protocolFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"newChainGasAmount","type":"uint256"}],"name":"setChainGasAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"setProtocolFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepProtocolFees","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{"chainGasAmount()":{"notice":"Chain gas amount to forward as rebate if requested"},"protocolFeeRate()":{"notice":"Protocol fee rate taken on origin amount deposited in origin chain"},"protocolFees(address)":{"notice":"Protocol fee amounts accumulated"}},"version":1},"developerDoc":{"errors":{"AccessControlBadConfirmation()":[{"details":"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."}],"AccessControlUnauthorizedAccount(address,bytes32)":[{"details":"The `account` is missing a role."}],"AddressEmptyCode(address)":[{"details":"There's no code at `target` (it is not a contract)."}],"AddressInsufficientBalance(address)":[{"details":"The ETH balance of the account is not enough to perform the operation."}],"FailedInnerCall()":[{"details":"A call to an address target failed. The target may have reverted."}],"SafeERC20FailedOperation(address)":[{"details":"An operation with an ERC20 token failed."}]},"events":{"RoleAdminChanged(bytes32,bytes32,bytes32)":{"details":"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."},"RoleGranted(bytes32,address,address)":{"details":"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."},"RoleRevoked(bytes32,address,address)":{"details":"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"}},"kind":"dev","methods":{"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}."},"getRoleMember(bytes32,uint256)":{"details":"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information."},"getRoleMemberCount(bytes32)":{"details":"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event."},"supportsInterface(bytes4)":{"details":"See {IERC165-supportsInterface}."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"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\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldChainGasAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"ChainGasAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"FeeRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesSwept\",\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_BPS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_RATE_MAX\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOVERNOR_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GUARD_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFUNDER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RELAYER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainGasAmount\",\"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\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"protocolFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"setChainGasAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeeRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepProtocolFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}],\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"chainGasAmount()\":{\"notice\":\"Chain gas amount to forward as rebate if requested\"},\"protocolFeeRate()\":{\"notice\":\"Protocol fee rate taken on origin amount deposited in origin chain\"},\"protocolFees(address)\":{\"notice\":\"Protocol fee amounts accumulated\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"Admin\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"DEFAULT_ADMIN_ROLE()":"a217fddf","FEE_BPS()":"bf333f2c","FEE_RATE_MAX()":"0f5f6ed7","GOVERNOR_ROLE()":"ccc57490","GUARD_ROLE()":"03ed0ee5","REFUNDER_ROLE()":"5960ccf2","RELAYER_ROLE()":"926d7d7f","chainGasAmount()":"e00a83e0","getRoleAdmin(bytes32)":"248a9ca3","getRoleMember(bytes32,uint256)":"9010d07c","getRoleMemberCount(bytes32)":"ca15c873","grantRole(bytes32,address)":"2f2ff15d","hasRole(bytes32,address)":"91d14854","protocolFeeRate()":"58f85880","protocolFees(address)":"dcf844a7","renounceRole(bytes32,address)":"36568abe","revokeRole(bytes32,address)":"d547741f","setChainGasAmount(uint256)":"b250fe6b","setProtocolFeeRate(uint256)":"b13aa2d6","supportsInterface(bytes4)":"01ffc9a7","sweepProtocolFees(address,address)":"06f333f2"}},"solidity/FastBridge.sol:Context":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"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.","kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"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.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"Context\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{}},"solidity/FastBridge.sol:ERC165":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ```","kind":"dev","methods":{"supportsInterface(bytes4)":{"details":"See {IERC165-supportsInterface}."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Implementation of the {IERC165} interface. Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check for the additional interface id that will be supported. For example: ```solidity function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); } ```\",\"kind\":\"dev\",\"methods\":{\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"ERC165\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"supportsInterface(bytes4)":"01ffc9a7"}},"solidity/FastBridge.sol:EnumerableSet":{"code":"0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203a6e3f60ed51bcb9fc27641637557f1f938845d6b833150d5c8467b60921792564736f6c63430008140033","runtime-code":"0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212203a6e3f60ed51bcb9fc27641637557f1f938845d6b833150d5c8467b60921792564736f6c63430008140033","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"24861:11640:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;24861:11640:0;;;;;;;;;;;;;;;;;","srcMapRuntime":"24861:11640:0:-:0;;;;;;;;","abiDefinition":[],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Library for managing https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive types. Sets have the following properties: - Elements are added, removed, and checked for existence in constant time (O(1)). - Elements are enumerated in O(n). No guarantees are made on the ordering. ```solidity contract Example { // Add the library methods using EnumerableSet for EnumerableSet.AddressSet; // Declare a set state variable EnumerableSet.AddressSet private mySet; } ``` As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) and `uint256` (`UintSet`) are supported. [WARNING] ==== Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. ====","kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Library for managing https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive types. Sets have the following properties: - Elements are added, removed, and checked for existence in constant time (O(1)). - Elements are enumerated in O(n). No guarantees are made on the ordering. ```solidity contract Example { // Add the library methods using EnumerableSet for EnumerableSet.AddressSet; // Declare a set state variable EnumerableSet.AddressSet private mySet; } ``` As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) and `uint256` (`UintSet`) are supported. [WARNING] ==== Trying to delete such a structure from storage will likely result in data corruption, rendering the structure unusable. See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an array of EnumerableSet. ====\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"EnumerableSet\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{}},"solidity/FastBridge.sol:FastBridge":{"code":"0x60a06040523480156200001157600080fd5b5060405162002d7a38038062002d7a833981016040819052620000349162000194565b80620000426000826200004f565b50504360805250620001bf565b6000806200005e84846200008c565b90508015620000835760008481526001602052604090206200008190846200013a565b505b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1662000131576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055620000e83390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600162000086565b50600062000086565b600062000083836001600160a01b0384166000818152600183016020526040812054620001315750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000086565b600060208284031215620001a757600080fd5b81516001600160a01b03811681146200008357600080fd5b608051612b9f620001db60003960006106510152612b9f6000f3fe60806040526004361061026a5760003560e01c80639010d07c11610153578063add98c70116100cb578063ca15c8731161007f578063d547741f11610064578063d547741f146107a1578063dcf844a7146107c1578063e00a83e0146107ee57600080fd5b8063ca15c8731461074d578063ccc574901461076d57600080fd5b8063b13aa2d6116100b0578063b13aa2d6146106f6578063b250fe6b14610716578063bf333f2c1461073657600080fd5b8063add98c70146106c0578063affed0e0146106e057600080fd5b8063a217fddf11610122578063a5bbe22b11610107578063a5bbe22b1461047f578063aa9641ab14610673578063ac11fb1a1461069357600080fd5b8063a217fddf1461062a578063a3ec191a1461063f57600080fd5b80639010d07c146104f857806391ad50391461053057806391d14854146105b2578063926d7d7f146105f657600080fd5b806341fcb612116101e65780635eb7d946116101b55780638379a24f1161019a5780638379a24f14610495578063886d36ff146104c55780638f0d6f17146104e557600080fd5b80635eb7d9461461045f578063820688d51461047f57600080fd5b806341fcb612146103e2578063458516941461040257806358f85880146104155780635960ccf21461042b57600080fd5b80630f5f6ed71161023d578063248a9ca311610222578063248a9ca3146103725780632f2ff15d146103a257806336568abe146103c257600080fd5b80630f5f6ed714610345578063190da5951461035b57600080fd5b806301ffc9a71461026f57806303ed0ee5146102a4578063051287bc146102e657806306f333f214610323575b600080fd5b34801561027b57600080fd5b5061028f61028a3660046122fc565b610804565b60405190151581526020015b60405180910390f35b3480156102b057600080fd5b506102d87f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d81565b60405190815260200161029b565b3480156102f257600080fd5b5061031661030136600461233e565b60056020526000908152604090205460ff1681565b60405161029b9190612386565b34801561032f57600080fd5b5061034361033e3660046123ec565b610860565b005b34801561035157600080fd5b506102d861271081565b34801561036757600080fd5b506102d862093a8081565b34801561037e57600080fd5b506102d861038d36600461233e565b60009081526020819052604090206001015490565b3480156103ae57600080fd5b506103436103bd366004612425565b610927565b3480156103ce57600080fd5b506103436103dd366004612425565b610952565b3480156103ee57600080fd5b506103436103fd366004612572565b61099e565b6103436104103660046125ef565b610bd7565b34801561042157600080fd5b506102d860025481565b34801561043757600080fd5b506102d87fdb9556138406326f00296e13ea2ad7db24ba82381212d816b1a40c23b466b32781565b34801561046b57600080fd5b5061034361047a366004612692565b610ee5565b34801561048b57600080fd5b506102d861070881565b3480156104a157600080fd5b5061028f6104b036600461233e565b60076020526000908152604090205460ff1681565b3480156104d157600080fd5b506103436104e03660046126cf565b6110bd565b6103436104f3366004612692565b6111f0565b34801561050457600080fd5b50610518610513366004612714565b611437565b6040516001600160a01b03909116815260200161029b565b34801561053c57600080fd5b5061058661054b36600461233e565b6006602052600090815260409020546bffffffffffffffffffffffff8116906c0100000000000000000000000090046001600160a01b031682565b604080516bffffffffffffffffffffffff90931683526001600160a01b0390911660208301520161029b565b3480156105be57600080fd5b5061028f6105cd366004612425565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561060257600080fd5b506102d87fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b34801561063657600080fd5b506102d8600081565b34801561064b57600080fd5b506102d87f000000000000000000000000000000000000000000000000000000000000000081565b34801561067f57600080fd5b5061028f61068e366004612425565b611456565b34801561069f57600080fd5b506106b36106ae366004612692565b611559565b60405161029b9190612736565b3480156106cc57600080fd5b506103436106db36600461233e565b6115cc565b3480156106ec57600080fd5b506102d860085481565b34801561070257600080fd5b5061034361071136600461233e565b611735565b34801561072257600080fd5b5061034361073136600461233e565b611817565b34801561074257600080fd5b506102d8620f424081565b34801561075957600080fd5b506102d861076836600461233e565b61187f565b34801561077957600080fd5b506102d87f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b3480156107ad57600080fd5b506103436107bc366004612425565b611896565b3480156107cd57600080fd5b506102d86107dc36600461281c565b60036020526000908152604090205481565b3480156107fa57600080fd5b506102d860045481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f00000000000000000000000000000000000000000000000000000000148061085a575061085a826118bb565b92915050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561088a81611952565b6001600160a01b038316600090815260036020526040812054908190036108b15750505050565b6001600160a01b0384166000818152600360205260408120556108d590848361195f565b604080516001600160a01b038087168252851660208201529081018290527f244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd9060600160405180910390a1505b505050565b60008281526020819052604090206001015461094281611952565b61094c8383611a82565b50505050565b6001600160a01b0381163314610994576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109228282611ab7565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc46109c881611952565b8251602084012060006109da85611559565b9050600260008381526005602052604090205460ff166004811115610a0157610a01612357565b14610a38576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600660209081526040918290208251808401909352546bffffffffffffffffffffffff811683526c0100000000000000000000000090046001600160a01b03169082018190523314610abb576040517f4af43a9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516107089042036bffffffffffffffffffffffff1611610b08576040517f1992d0bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600560205260409020805460ff1916600317905561010082015115610b645761010082015160808301516001600160a01b031660009081526003602052604081208054909190610b5e908490612868565b90915550505b608082015160c0830151610b826001600160a01b038316888361195f565b604080516001600160a01b03848116825260208201849052891691339188917f582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac67891015b60405180910390a45050505050505050565b46816000015163ffffffff1603610c1a576040517f7029fdf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a08101511580610c2d575060c0810151155b15610c64576040517fe38820c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608101516001600160a01b03161580610c89575060808101516001600160a01b0316155b15610cc0576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ccc61070842612868565b8161010001511015610d0a576040517f04b7fcc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610d1f3083606001518460a00151611ae4565b90506000806002541115610d4c57620f424060025483610d3f919061287b565b610d499190612892565b90505b610d5681836128cd565b915060006040518061018001604052804663ffffffff168152602001856000015163ffffffff16815260200185602001516001600160a01b0316815260200185604001516001600160a01b0316815260200185606001516001600160a01b0316815260200185608001516001600160a01b031681526020018481526020018560c0015181526020018381526020018560e0015115158152602001856101000151815260200160086000815480929190610e0e906128e0565b909155509052604051610e249190602001612736565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152828252805160208083019190912060008181526005835293909320805460ff191660011790558701518751606089015160808a015160c08b015160e08c015195985095966001600160a01b039094169587957f120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a95610ed6958b959094909390928e9261293c565b60405180910390a35050505050565b805160208201206000610ef783611559565b3360009081527fd2043bf65931af3dbecf60d0db8f40e4160406d7beb00522f4200cf4944a1eb8602052604090205490915060ff1615610f74578061014001514211610f6f576040517fe15ff9ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc0565b62093a80816101400151610f889190612868565b4211610fc0576040517fe15ff9ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008381526005602052604090205460ff166004811115610fe557610fe5612357565b1461101c576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260056020526040808220805460ff19166004179055820151608083015161010084015160c0850151929391926110579190612868565b905061106d6001600160a01b038316848361195f565b604080516001600160a01b0384811682526020820184905285169187917fb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958910160405180910390a3505050505050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc46110e781611952565b82516020840120600160008281526005602052604090205460ff16600481111561111357611113612357565b1461114a576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526005602090815260408083208054600260ff19909116179055805180820182526bffffffffffffffffffffffff4281168252338285018181528787526006865295849020925195516001600160a01b03166c0100000000000000000000000002959091169490941790555185815283917f4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4910160405180910390a350505050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc461121a81611952565b81516020830120600061122c84611559565b90504663ffffffff16816020015163ffffffff1614611277576040517f7029fdf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8061014001514211156112b6576040517f559895a300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090205460ff16156112ff576040517fbef7bb7d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600760205260409020805460ff19166001179055606081015160a082015160e083015160045461012085015161134857506000611342848484611ae4565b506113b9565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b0384160161138c5761134284846113878486612868565b611ae4565b611397848484611ae4565b506113b78473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee83611ae4565b505b845160808087015160a08089015160c0808b015160e08c01516040805163ffffffff90991689526001600160a01b0396871660208a0152938616938801939093526060870152938501528301849052861691339189917ff8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c9101610bc5565b600082815260016020526040812061144f9083611cb3565b9392505050565b6000600260008481526005602052604090205460ff16600481111561147d5761147d612357565b146114b4576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600660209081526040918290208251808401909352546bffffffffffffffffffffffff811683526001600160a01b036c01000000000000000000000000909104811691830182905284161461153a576040517f4af43a9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516107089042036bffffffffffffffffffffffff1611949350505050565b604080516101808101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082018190526101608201528251909161085a91840181019084016129ed565b7f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d6115f681611952565b600260008381526005602052604090205460ff16600481111561161b5761161b612357565b14611652576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600660209081526040918290208251808401909352546bffffffffffffffffffffffff8082168085526c010000000000000000000000009092046001600160a01b031693909201929092526107089142031611156116e1576040517f3e908aac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600560209081526040808320805460ff19166001179055600690915280822082905551339184917f0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad49190a35050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561175f81611952565b6127108211156117d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e657746656552617465203e206d61780000000000000000000000000000000060448201526064015b60405180910390fd5b600280549083905560408051828152602081018590527f14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb95791015b60405180910390a1505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561184181611952565b600480549083905560408051828152602081018590527f5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa910161180a565b600081815260016020526040812061085a90611cbf565b6000828152602081905260409020600101546118b181611952565b61094c8383611ab7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061085a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461085a565b61195c8133611cc9565b50565b306001600160a01b0383160361197457505050565b8060000361198157505050565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b03841601611a6e576000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119fe576040519150601f19603f3d011682016040523d82523d6000602084013e611a03565b606091505b505090508061094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c65640000000000000000000000000060448201526064016117c7565b6109226001600160a01b0384168383611d39565b600080611a8f8484611dad565b9050801561144f576000848152600160205260409020611aaf9084611e57565b509392505050565b600080611ac48484611e6c565b9050801561144f576000848152600160205260409020611aaf9084611eef565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611c4d57611b1c836001600160a01b0316611f04565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528416906370a0823190602401602060405180830381865afa158015611b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9f9190612ab9565b9050611bb66001600160a01b038416338685611faa565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528291908516906370a0823190602401602060405180830381865afa158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c9190612ab9565b611c4691906128cd565b905061144f565b348214611c86576040517f81de0bf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384163014611caa57611caa6001600160a01b038416858461195f565b50349392505050565b600061144f8383611fe3565b600061085a825490565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16611d35576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016117c7565b5050565b6040516001600160a01b0383811660248301526044820183905261092291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061200d565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16611e4f576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611e073390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161085a565b50600061085a565b600061144f836001600160a01b038416612089565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1615611e4f576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161085a565b600061144f836001600160a01b0384166120d0565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b03821601611f66576040517f7f523fe800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b03163b60000361195c576040517f7f523fe800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b03848116602483015283811660448301526064820183905261094c9186918216906323b872dd90608401611d66565b6000826000018281548110611ffa57611ffa612ad2565b9060005260206000200154905092915050565b60006120226001600160a01b038416836121c3565b905080516000141580156120475750808060200190518101906120459190612b01565b155b15610922576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016117c7565b6000818152600183016020526040812054611e4f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561085a565b600081815260018301602052604081205480156121b95760006120f46001836128cd565b8554909150600090612108906001906128cd565b905080821461216d57600086600001828154811061212857612128612ad2565b906000526020600020015490508087600001848154811061214b5761214b612ad2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061217e5761217e612b1e565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061085a565b600091505061085a565b606061144f8383600084600080856001600160a01b031684866040516121e99190612b4d565b60006040518083038185875af1925050503d8060008114612226576040519150601f19603f3d011682016040523d82523d6000602084013e61222b565b606091505b509150915061223b868383612245565b9695505050505050565b60608261225a57612255826122ba565b61144f565b815115801561227157506001600160a01b0384163b155b156122b3576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016117c7565b508061144f565b8051156122ca5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561230e57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461144f57600080fd5b60006020828403121561235057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600583106123c1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6001600160a01b038116811461195c57600080fd5b80356123e7816123c7565b919050565b600080604083850312156123ff57600080fd5b823561240a816123c7565b9150602083013561241a816123c7565b809150509250929050565b6000806040838503121561243857600080fd5b82359150602083013561241a816123c7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff8111828210171561249d5761249d61244a565b60405290565b604051610180810167ffffffffffffffff8111828210171561249d5761249d61244a565b600082601f8301126124d857600080fd5b813567ffffffffffffffff808211156124f3576124f361244a565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156125395761253961244a565b8160405283815286602085880101111561255257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561258557600080fd5b823567ffffffffffffffff81111561259c57600080fd5b6125a8858286016124c7565b925050602083013561241a816123c7565b63ffffffff8116811461195c57600080fd5b80356123e7816125b9565b801515811461195c57600080fd5b80356123e7816125d6565b6000610120828403121561260257600080fd5b61260a612479565b612613836125cb565b8152612621602084016123dc565b6020820152612632604084016123dc565b6040820152612643606084016123dc565b6060820152612654608084016123dc565b608082015260a083013560a082015260c083013560c082015261267960e084016125e4565b60e0820152610100928301359281019290925250919050565b6000602082840312156126a457600080fd5b813567ffffffffffffffff8111156126bb57600080fd5b6126c7848285016124c7565b949350505050565b600080604083850312156126e257600080fd5b823567ffffffffffffffff8111156126f957600080fd5b612705858286016124c7565b95602094909401359450505050565b6000806040838503121561272757600080fd5b50508035926020909101359150565b815163ffffffff1681526101808101602083015161275c602084018263ffffffff169052565b50604083015161277760408401826001600160a01b03169052565b50606083015161279260608401826001600160a01b03169052565b5060808301516127ad60808401826001600160a01b03169052565b5060a08301516127c860a08401826001600160a01b03169052565b5060c083015160c083015260e083015160e0830152610100808401518184015250610120808401516127fd8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b60006020828403121561282e57600080fd5b813561144f816123c7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561085a5761085a612839565b808202811582820484141761085a5761085a612839565b6000826128c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561085a5761085a612839565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361291157612911612839565b5060010190565b60005b8381101561293357818101518382015260200161291b565b50506000910152565b60e08152600088518060e084015261010061295d8282860160208e01612918565b63ffffffff9990991660208401526001600160a01b039788166040840152959096166060820152608081019390935260a0830191909152151560c0820152601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190910192915050565b80516123e7816125b9565b80516123e7816123c7565b80516123e7816125d6565b60006101808284031215612a0057600080fd5b612a086124a3565b612a11836129cc565b8152612a1f602084016129cc565b6020820152612a30604084016129d7565b6040820152612a41606084016129d7565b6060820152612a52608084016129d7565b6080820152612a6360a084016129d7565b60a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120612a968185016129e2565b908201526101408381015190820152610160928301519281019290925250919050565b600060208284031215612acb57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612b1357600080fd5b815161144f816125d6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251612b5f818460208701612918565b919091019291505056fea2646970667358221220e9dd17881b30b52cd3cbfc5932ec6ff3c3a01111638264cfdff6ef34d478bd7764736f6c63430008140033","runtime-code":"0x60806040526004361061026a5760003560e01c80639010d07c11610153578063add98c70116100cb578063ca15c8731161007f578063d547741f11610064578063d547741f146107a1578063dcf844a7146107c1578063e00a83e0146107ee57600080fd5b8063ca15c8731461074d578063ccc574901461076d57600080fd5b8063b13aa2d6116100b0578063b13aa2d6146106f6578063b250fe6b14610716578063bf333f2c1461073657600080fd5b8063add98c70146106c0578063affed0e0146106e057600080fd5b8063a217fddf11610122578063a5bbe22b11610107578063a5bbe22b1461047f578063aa9641ab14610673578063ac11fb1a1461069357600080fd5b8063a217fddf1461062a578063a3ec191a1461063f57600080fd5b80639010d07c146104f857806391ad50391461053057806391d14854146105b2578063926d7d7f146105f657600080fd5b806341fcb612116101e65780635eb7d946116101b55780638379a24f1161019a5780638379a24f14610495578063886d36ff146104c55780638f0d6f17146104e557600080fd5b80635eb7d9461461045f578063820688d51461047f57600080fd5b806341fcb612146103e2578063458516941461040257806358f85880146104155780635960ccf21461042b57600080fd5b80630f5f6ed71161023d578063248a9ca311610222578063248a9ca3146103725780632f2ff15d146103a257806336568abe146103c257600080fd5b80630f5f6ed714610345578063190da5951461035b57600080fd5b806301ffc9a71461026f57806303ed0ee5146102a4578063051287bc146102e657806306f333f214610323575b600080fd5b34801561027b57600080fd5b5061028f61028a3660046122fc565b610804565b60405190151581526020015b60405180910390f35b3480156102b057600080fd5b506102d87f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d81565b60405190815260200161029b565b3480156102f257600080fd5b5061031661030136600461233e565b60056020526000908152604090205460ff1681565b60405161029b9190612386565b34801561032f57600080fd5b5061034361033e3660046123ec565b610860565b005b34801561035157600080fd5b506102d861271081565b34801561036757600080fd5b506102d862093a8081565b34801561037e57600080fd5b506102d861038d36600461233e565b60009081526020819052604090206001015490565b3480156103ae57600080fd5b506103436103bd366004612425565b610927565b3480156103ce57600080fd5b506103436103dd366004612425565b610952565b3480156103ee57600080fd5b506103436103fd366004612572565b61099e565b6103436104103660046125ef565b610bd7565b34801561042157600080fd5b506102d860025481565b34801561043757600080fd5b506102d87fdb9556138406326f00296e13ea2ad7db24ba82381212d816b1a40c23b466b32781565b34801561046b57600080fd5b5061034361047a366004612692565b610ee5565b34801561048b57600080fd5b506102d861070881565b3480156104a157600080fd5b5061028f6104b036600461233e565b60076020526000908152604090205460ff1681565b3480156104d157600080fd5b506103436104e03660046126cf565b6110bd565b6103436104f3366004612692565b6111f0565b34801561050457600080fd5b50610518610513366004612714565b611437565b6040516001600160a01b03909116815260200161029b565b34801561053c57600080fd5b5061058661054b36600461233e565b6006602052600090815260409020546bffffffffffffffffffffffff8116906c0100000000000000000000000090046001600160a01b031682565b604080516bffffffffffffffffffffffff90931683526001600160a01b0390911660208301520161029b565b3480156105be57600080fd5b5061028f6105cd366004612425565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561060257600080fd5b506102d87fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b34801561063657600080fd5b506102d8600081565b34801561064b57600080fd5b506102d87f000000000000000000000000000000000000000000000000000000000000000081565b34801561067f57600080fd5b5061028f61068e366004612425565b611456565b34801561069f57600080fd5b506106b36106ae366004612692565b611559565b60405161029b9190612736565b3480156106cc57600080fd5b506103436106db36600461233e565b6115cc565b3480156106ec57600080fd5b506102d860085481565b34801561070257600080fd5b5061034361071136600461233e565b611735565b34801561072257600080fd5b5061034361073136600461233e565b611817565b34801561074257600080fd5b506102d8620f424081565b34801561075957600080fd5b506102d861076836600461233e565b61187f565b34801561077957600080fd5b506102d87f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5581565b3480156107ad57600080fd5b506103436107bc366004612425565b611896565b3480156107cd57600080fd5b506102d86107dc36600461281c565b60036020526000908152604090205481565b3480156107fa57600080fd5b506102d860045481565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f00000000000000000000000000000000000000000000000000000000148061085a575061085a826118bb565b92915050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561088a81611952565b6001600160a01b038316600090815260036020526040812054908190036108b15750505050565b6001600160a01b0384166000818152600360205260408120556108d590848361195f565b604080516001600160a01b038087168252851660208201529081018290527f244e51bc38c1452fa8aaf487bcb4bca36c2baa3a5fbdb776b1eabd8dc6d277cd9060600160405180910390a1505b505050565b60008281526020819052604090206001015461094281611952565b61094c8383611a82565b50505050565b6001600160a01b0381163314610994576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109228282611ab7565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc46109c881611952565b8251602084012060006109da85611559565b9050600260008381526005602052604090205460ff166004811115610a0157610a01612357565b14610a38576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600660209081526040918290208251808401909352546bffffffffffffffffffffffff811683526c0100000000000000000000000090046001600160a01b03169082018190523314610abb576040517f4af43a9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516107089042036bffffffffffffffffffffffff1611610b08576040517f1992d0bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600560205260409020805460ff1916600317905561010082015115610b645761010082015160808301516001600160a01b031660009081526003602052604081208054909190610b5e908490612868565b90915550505b608082015160c0830151610b826001600160a01b038316888361195f565b604080516001600160a01b03848116825260208201849052891691339188917f582211c35a2139ac3bbaac74663c6a1f56c6cbb658b41fe11fd45a82074ac67891015b60405180910390a45050505050505050565b46816000015163ffffffff1603610c1a576040517f7029fdf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60a08101511580610c2d575060c0810151155b15610c64576040517fe38820c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60608101516001600160a01b03161580610c89575060808101516001600160a01b0316155b15610cc0576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ccc61070842612868565b8161010001511015610d0a576040517f04b7fcc800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610d1f3083606001518460a00151611ae4565b90506000806002541115610d4c57620f424060025483610d3f919061287b565b610d499190612892565b90505b610d5681836128cd565b915060006040518061018001604052804663ffffffff168152602001856000015163ffffffff16815260200185602001516001600160a01b0316815260200185604001516001600160a01b0316815260200185606001516001600160a01b0316815260200185608001516001600160a01b031681526020018481526020018560c0015181526020018381526020018560e0015115158152602001856101000151815260200160086000815480929190610e0e906128e0565b909155509052604051610e249190602001612736565b604080518083037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0018152828252805160208083019190912060008181526005835293909320805460ff191660011790558701518751606089015160808a015160c08b015160e08c015195985095966001600160a01b039094169587957f120ea0364f36cdac7983bcfdd55270ca09d7f9b314a2ebc425a3b01ab1d6403a95610ed6958b959094909390928e9261293c565b60405180910390a35050505050565b805160208201206000610ef783611559565b3360009081527fd2043bf65931af3dbecf60d0db8f40e4160406d7beb00522f4200cf4944a1eb8602052604090205490915060ff1615610f74578061014001514211610f6f576040517fe15ff9ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610fc0565b62093a80816101400151610f889190612868565b4211610fc0576040517fe15ff9ea00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600160008381526005602052604090205460ff166004811115610fe557610fe5612357565b1461101c576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260056020526040808220805460ff19166004179055820151608083015161010084015160c0850151929391926110579190612868565b905061106d6001600160a01b038316848361195f565b604080516001600160a01b0384811682526020820184905285169187917fb4c55c0c9bc613519b920e88748090150b890a875d307f21bea7d4fb2e8bc958910160405180910390a3505050505050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc46110e781611952565b82516020840120600160008281526005602052604090205460ff16600481111561111357611113612357565b1461114a576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008181526005602090815260408083208054600260ff19909116179055805180820182526bffffffffffffffffffffffff4281168252338285018181528787526006865295849020925195516001600160a01b03166c0100000000000000000000000002959091169490941790555185815283917f4ac8af8a2cd87193d64dfc7a3b8d9923b714ec528b18725d080aa1299be0c5e4910160405180910390a350505050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc461121a81611952565b81516020830120600061122c84611559565b90504663ffffffff16816020015163ffffffff1614611277576040517f7029fdf900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8061014001514211156112b6576040517f559895a300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008281526007602052604090205460ff16156112ff576040517fbef7bb7d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600760205260409020805460ff19166001179055606081015160a082015160e083015160045461012085015161134857506000611342848484611ae4565b506113b9565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b0384160161138c5761134284846113878486612868565b611ae4565b611397848484611ae4565b506113b78473eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee83611ae4565b505b845160808087015160a08089015160c0808b015160e08c01516040805163ffffffff90991689526001600160a01b0396871660208a0152938616938801939093526060870152938501528301849052861691339189917ff8ae392d784b1ea5e8881bfa586d81abf07ef4f1e2fc75f7fe51c90f05199a5c9101610bc5565b600082815260016020526040812061144f9083611cb3565b9392505050565b6000600260008481526005602052604090205460ff16600481111561147d5761147d612357565b146114b4576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000838152600660209081526040918290208251808401909352546bffffffffffffffffffffffff811683526001600160a01b036c01000000000000000000000000909104811691830182905284161461153a576040517f4af43a9000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516107089042036bffffffffffffffffffffffff1611949350505050565b604080516101808101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e082018190526101008201819052610120820181905261014082018190526101608201528251909161085a91840181019084016129ed565b7f043c983c49d46f0e102151eaf8085d4a2e6571d5df2d47b013f39bddfd4a639d6115f681611952565b600260008381526005602052604090205460ff16600481111561161b5761161b612357565b14611652576040517f4145817200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600660209081526040918290208251808401909352546bffffffffffffffffffffffff8082168085526c010000000000000000000000009092046001600160a01b031693909201929092526107089142031611156116e1576040517f3e908aac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000828152600560209081526040808320805460ff19166001179055600690915280822082905551339184917f0695cf1d39b3055dcd0fe02d8b47eaf0d5a13e1996de925de59d0ef9b7f7fad49190a35050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561175f81611952565b6127108211156117d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f6e657746656552617465203e206d61780000000000000000000000000000000060448201526064015b60405180910390fd5b600280549083905560408051828152602081018590527f14914da2bf76024616fbe1859783fcd4dbddcb179b1f3a854949fbf920dcb95791015b60405180910390a1505050565b7f7935bd0ae54bc31f548c14dba4d37c5c64b3f8ca900cb468fb8abd54d5894f5561184181611952565b600480549083905560408051828152602081018590527f5cf09b12f3f56b4c564d51b25b40360af6d795198adb61ae0806a36c294323fa910161180a565b600081815260016020526040812061085a90611cbf565b6000828152602081905260409020600101546118b181611952565b61094c8383611ab7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061085a57507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000083161461085a565b61195c8133611cc9565b50565b306001600160a01b0383160361197457505050565b8060000361198157505050565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b03841601611a6e576000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146119fe576040519150601f19603f3d011682016040523d82523d6000602084013e611a03565b606091505b505090508061094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f455448207472616e73666572206661696c65640000000000000000000000000060448201526064016117c7565b6109226001600160a01b0384168383611d39565b600080611a8f8484611dad565b9050801561144f576000848152600160205260409020611aaf9084611e57565b509392505050565b600080611ac48484611e6c565b9050801561144f576000848152600160205260409020611aaf9084611eef565b60006001600160a01b03831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14611c4d57611b1c836001600160a01b0316611f04565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528416906370a0823190602401602060405180830381865afa158015611b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9f9190612ab9565b9050611bb66001600160a01b038416338685611faa565b6040517f70a082310000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528291908516906370a0823190602401602060405180830381865afa158015611c18573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c3c9190612ab9565b611c4691906128cd565b905061144f565b348214611c86576040517f81de0bf300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b0384163014611caa57611caa6001600160a01b038416858461195f565b50349392505050565b600061144f8383611fe3565b600061085a825490565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16611d35576040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526001600160a01b0382166004820152602481018390526044016117c7565b5050565b6040516001600160a01b0383811660248301526044820183905261092291859182169063a9059cbb906064015b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505061200d565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16611e4f576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055611e073390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161085a565b50600061085a565b600061144f836001600160a01b038416612089565b6000828152602081815260408083206001600160a01b038516845290915281205460ff1615611e4f576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161085a565b600061144f836001600160a01b0384166120d0565b7fffffffffffffffffffffffff11111111111111111111111111111111111111126001600160a01b03821601611f66576040517f7f523fe800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806001600160a01b03163b60000361195c576040517f7f523fe800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b03848116602483015283811660448301526064820183905261094c9186918216906323b872dd90608401611d66565b6000826000018281548110611ffa57611ffa612ad2565b9060005260206000200154905092915050565b60006120226001600160a01b038416836121c3565b905080516000141580156120475750808060200190518101906120459190612b01565b155b15610922576040517f5274afe70000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024016117c7565b6000818152600183016020526040812054611e4f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561085a565b600081815260018301602052604081205480156121b95760006120f46001836128cd565b8554909150600090612108906001906128cd565b905080821461216d57600086600001828154811061212857612128612ad2565b906000526020600020015490508087600001848154811061214b5761214b612ad2565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061217e5761217e612b1e565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061085a565b600091505061085a565b606061144f8383600084600080856001600160a01b031684866040516121e99190612b4d565b60006040518083038185875af1925050503d8060008114612226576040519150601f19603f3d011682016040523d82523d6000602084013e61222b565b606091505b509150915061223b868383612245565b9695505050505050565b60608261225a57612255826122ba565b61144f565b815115801561227157506001600160a01b0384163b155b156122b3576040517f9996b3150000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024016117c7565b508061144f565b8051156122ca5780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006020828403121561230e57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461144f57600080fd5b60006020828403121561235057600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208101600583106123c1577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b91905290565b6001600160a01b038116811461195c57600080fd5b80356123e7816123c7565b919050565b600080604083850312156123ff57600080fd5b823561240a816123c7565b9150602083013561241a816123c7565b809150509250929050565b6000806040838503121561243857600080fd5b82359150602083013561241a816123c7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610120810167ffffffffffffffff8111828210171561249d5761249d61244a565b60405290565b604051610180810167ffffffffffffffff8111828210171561249d5761249d61244a565b600082601f8301126124d857600080fd5b813567ffffffffffffffff808211156124f3576124f361244a565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156125395761253961244a565b8160405283815286602085880101111561255257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561258557600080fd5b823567ffffffffffffffff81111561259c57600080fd5b6125a8858286016124c7565b925050602083013561241a816123c7565b63ffffffff8116811461195c57600080fd5b80356123e7816125b9565b801515811461195c57600080fd5b80356123e7816125d6565b6000610120828403121561260257600080fd5b61260a612479565b612613836125cb565b8152612621602084016123dc565b6020820152612632604084016123dc565b6040820152612643606084016123dc565b6060820152612654608084016123dc565b608082015260a083013560a082015260c083013560c082015261267960e084016125e4565b60e0820152610100928301359281019290925250919050565b6000602082840312156126a457600080fd5b813567ffffffffffffffff8111156126bb57600080fd5b6126c7848285016124c7565b949350505050565b600080604083850312156126e257600080fd5b823567ffffffffffffffff8111156126f957600080fd5b612705858286016124c7565b95602094909401359450505050565b6000806040838503121561272757600080fd5b50508035926020909101359150565b815163ffffffff1681526101808101602083015161275c602084018263ffffffff169052565b50604083015161277760408401826001600160a01b03169052565b50606083015161279260608401826001600160a01b03169052565b5060808301516127ad60808401826001600160a01b03169052565b5060a08301516127c860a08401826001600160a01b03169052565b5060c083015160c083015260e083015160e0830152610100808401518184015250610120808401516127fd8285018215159052565b5050610140838101519083015261016092830151929091019190915290565b60006020828403121561282e57600080fd5b813561144f816123c7565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8082018082111561085a5761085a612839565b808202811582820484141761085a5761085a612839565b6000826128c8577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b8181038181111561085a5761085a612839565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361291157612911612839565b5060010190565b60005b8381101561293357818101518382015260200161291b565b50506000910152565b60e08152600088518060e084015261010061295d8282860160208e01612918565b63ffffffff9990991660208401526001600160a01b039788166040840152959096166060820152608081019390935260a0830191909152151560c0820152601f9091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0160190910192915050565b80516123e7816125b9565b80516123e7816123c7565b80516123e7816125d6565b60006101808284031215612a0057600080fd5b612a086124a3565b612a11836129cc565b8152612a1f602084016129cc565b6020820152612a30604084016129d7565b6040820152612a41606084016129d7565b6060820152612a52608084016129d7565b6080820152612a6360a084016129d7565b60a082015260c083015160c082015260e083015160e0820152610100808401518183015250610120612a968185016129e2565b908201526101408381015190820152610160928301519281019290925250919050565b600060208284031215612acb57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600060208284031215612b1357600080fd5b815161144f816125d6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008251612b5f818460208701612918565b919091019291505056fea2646970667358221220e9dd17881b30b52cd3cbfc5932ec6ff3c3a01111638264cfdff6ef34d478bd7764736f6c63430008140033","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"58196:11304:0:-:0;;;59371:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;59405:6;57187:38;46359:4;59405:6;57187:10;:38::i;:::-;-1:-1:-1;;59437:12:0::1;59423:26;::::0;-1:-1:-1;58196:11304:0;;55672:257;55758:4;;55789:31;55806:4;55812:7;55789:16;:31::i;:::-;55774:46;;55834:7;55830:69;;;55857:18;;;;:12;:18;;;;;:31;;55880:7;55857:22;:31::i;:::-;;55830:69;55915:7;-1:-1:-1;55672:257:0;;;;;:::o;50306:316::-;50383:4;47081:12;;;;;;;;;;;-1:-1:-1;;;;;47081:29:0;;;;;;;;;;;;50399:217;;50442:6;:12;;;;;;;;;;;-1:-1:-1;;;;;50442:29:0;;;;;;;;;:36;;-1:-1:-1;;50442:36:0;50474:4;50442:36;;;50524:12;22402:10;;22323:96;50524:12;-1:-1:-1;;;;;50497:40:0;50515:7;-1:-1:-1;;;;;50497:40:0;50509:4;50497:40;;;;;;;;;;-1:-1:-1;50558:4:0;50551:11;;50399:217;-1:-1:-1;50600:5:0;50593:12;;31847:150;31917:4;31940:50;31945:3;-1:-1:-1;;;;;31965:23:0;;25835:4;27891:21;;;:14;;;:21;;;;;;25851:321;;-1:-1:-1;25893:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;26075:18;;26051:21;;;:14;;;:21;;;;;;:42;;;;26107:11;;14:290:1;84:6;137:2;125:9;116:7;112:23;108:32;105:52;;;153:1;150;143:12;105:52;179:16;;-1:-1:-1;;;;;224:31:1;;214:42;;204:70;;270:1;267;260:12;14:290;58196:11304:0;;;;;;;;;;;;","srcMapRuntime":"58196:11304:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;54332:212;;;;;;;;;;-1:-1:-1;54332:212:0;;;;;:::i;:::-;;:::i;:::-;;;612:14:1;;605:22;587:41;;575:2;560:18;54332:212:0;;;;;;;;56562:60;;;;;;;;;;;;56599:23;56562:60;;;;;785:25:1;;;773:2;758:18;56562:60:0;639:177:1;58923:54:0;;;;;;;;;;-1:-1:-1;58923:54:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;:::i;57534:359::-;;;;;;;;;;-1:-1:-1;57534:359:0;;;;;:::i;:::-;;:::i;:::-;;56744:45;;;;;;;;;;;;56783:6;56744:45;;58521;;;;;;;;;;;;58560:6;58521:45;;47937:120;;;;;;;;;;-1:-1:-1;47937:120:0;;;;;:::i;:::-;48002:7;48028:12;;;;;;;;;;:22;;;;47937:120;48353:136;;;;;;;;;;-1:-1:-1;48353:136:0;;;;;:::i;:::-;;:::i;49455:245::-;;;;;;;;;;-1:-1:-1;49455:245:0;;;;;:::i;:::-;;:::i;66598:1146::-;;;;;;;;;;-1:-1:-1;66598:1146:0;;;;;:::i;:::-;;:::i;61056:2114::-;;;;;;:::i;:::-;;:::i;56906:30::-;;;;;;;;;;;;;;;;56490:66;;;;;;;;;;;;56530:26;56490:66;;68345:1153;;;;;;;;;;-1:-1:-1;68345:1153:0;;;;;:::i;:::-;;:::i;58653:56::-;;;;;;;;;;;;58699:10;58653:56;;59168:44;;;;;;;;;;-1:-1:-1;59168:44:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;64964:567;;;;;;;;;;-1:-1:-1;64964:567:0;;;;;:::i;:::-;;:::i;63208:1718::-;;;;;;:::i;:::-;;:::i;55129:142::-;;;;;;;;;;-1:-1:-1;55129:142:0;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;7391:55:1;;;7373:74;;7361:2;7346:18;55129:142:0;7227:226:1;59042:51:0;;;;;;;;;;-1:-1:-1;59042:51:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;59042:51:0;;;;;;;7660:26:1;7648:39;;;7630:58;;-1:-1:-1;;;;;7724:55:1;;;7719:2;7704:18;;7697:83;7603:18;59042:51:0;7458:328:1;46981:136:0;;;;;;;;;;-1:-1:-1;46981:136:0;;;;;:::i;:::-;47058:4;47081:12;;;;;;;;;;;-1:-1:-1;;;;;47081:29:0;;;;;;;;;;;;;;;46981:136;56420:64;;;;;;;;;;;;56459:25;56420:64;;46314:49;;;;;;;;;;-1:-1:-1;46314:49:0;46359:4;46314:49;;59328:36;;;;;;;;;;;;;;;66187:373;;;;;;;;;;-1:-1:-1;66187:373:0;;;;;:::i;:::-;;:::i;60855:163::-;;;;;;;;;;-1:-1:-1;60855:163:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;67782:525::-;;;;;;;;;;-1:-1:-1;67782:525:0;;;;;:::i;:::-;;:::i;59251:20::-;;;;;;;;;;;;;;;;57238:290;;;;;;;;;;-1:-1:-1;57238:290:0;;;;;:::i;:::-;;:::i;57899:264::-;;;;;;;;;;-1:-1:-1;57899:264:0;;;;;:::i;:::-;;:::i;56701:37::-;;;;;;;;;;;;56735:3;56701:37;;55439:131;;;;;;;;;;-1:-1:-1;55439:131:0;;;;;:::i;:::-;;:::i;56628:66::-;;;;;;;;;;;;56668:26;56628:66;;48769:138;;;;;;;;;;-1:-1:-1;48769:138:0;;;;;:::i;:::-;;:::i;56992:47::-;;;;;;;;;;-1:-1:-1;56992:47:0;;;;;:::i;:::-;;;;;;;;;;;;;;57113:29;;;;;;;;;;;;;;;;54332:212;54417:4;54440:57;;;54455:42;54440:57;;:97;;;54501:36;54525:11;54501:23;:36::i;:::-;54433:104;54332:212;-1:-1:-1;;54332:212:0:o;57534:359::-;56668:26;46591:16;46602:4;46591:10;:16::i;:::-;-1:-1:-1;;;;;57658:19:0;::::1;57638:17;57658:19:::0;;;:12:::1;:19;::::0;;;;;;57691:14;;;57687:27:::1;;57707:7;57534:359:::0;;;:::o;57687:27::-:1;-1:-1:-1::0;;;;;57755:19:0;::::1;57777:1;57755:19:::0;;;:12:::1;:19;::::0;;;;:23;57788:45:::1;::::0;57812:9;57823;57788:23:::1;:45::i;:::-;57848:38;::::0;;-1:-1:-1;;;;;9986:15:1;;;9968:34;;10038:15;;10033:2;10018:18;;10011:43;10070:18;;;10063:34;;;57848:38:0::1;::::0;9895:2:1;9880:18;57848:38:0::1;;;;;;;57628:265;46617:1;57534:359:::0;;;:::o;48353:136::-;48002:7;48028:12;;;;;;;;;;:22;;;46591:16;46602:4;46591:10;:16::i;:::-;48457:25:::1;48468:4;48474:7;48457:10;:25::i;:::-;;48353:136:::0;;;:::o;49455:245::-;-1:-1:-1;;;;;49548:34:0;;22402:10;49548:34;49544:102;;49605:30;;;;;;;;;;;;;;49544:102;49656:37;49668:4;49674:18;49656:11;:37::i;66598:1146::-;56459:25;46591:16;46602:4;46591:10;:16::i;:::-;66713:18;;::::1;::::0;::::1;::::0;66689:21:::1;66780:29;66723:7:::0;66780:20:::1;:29::i;:::-;66741:68:::0;-1:-1:-1;66927:27:0::1;66894:29;::::0;;;:14:::1;:29;::::0;;;;;::::1;;:60;::::0;::::1;;;;;;:::i;:::-;;66890:90;;66963:17;;;;;;;;;;;;;;66890:90;66991:24;67018:27:::0;;;:12:::1;:27;::::0;;;;;;;;66991:54;;;;::::1;::::0;;;;::::1;::::0;::::1;::::0;;;;::::1;-1:-1:-1::0;;;;;66991:54:0::1;::::0;;::::1;::::0;;;67076:10:::1;67059:27;67055:57;;67095:17;;;;;;;;;;;;;;67055:57;66117:15:::0;;58415:10:::1;::::0;66098:15;66091:41;66083:49;;67126:35:::1;67122:72;;67170:24;;;;;;;;;;;;;;67122:72;67205:29;::::0;;;:14:::1;:29;::::0;;;;:60;;-1:-1:-1;;67205:60:0::1;67237:28;67205:60;::::0;;67340:27:::1;::::0;::::1;::::0;:31;67336:105:::1;;67414:27;::::0;::::1;::::0;67386:23:::1;::::0;::::1;::::0;-1:-1:-1;;;;;67373:37:0::1;;::::0;;;:12:::1;:37;::::0;;;;:68;;:37;;;:68:::1;::::0;67414:27;;67373:68:::1;:::i;:::-;::::0;;;-1:-1:-1;;67336:105:0::1;67536:23;::::0;::::1;::::0;67586:24:::1;::::0;::::1;::::0;67620:35:::1;-1:-1:-1::0;;;;;67620:23:0;::::1;67644:2:::0;67586:24;67620:23:::1;:35::i;:::-;67671:66;::::0;;-1:-1:-1;;;;;10619:55:1;;;10601:74;;10706:2;10691:18;;10684:34;;;67671:66:0;::::1;::::0;67707:10:::1;::::0;67692:13;;67671:66:::1;::::0;10574:18:1;67671:66:0::1;;;;;;;;66679:1065;;;;;66598:1146:::0;;;:::o;61056:2114::-;61183:13;61162:6;:17;;;:34;;;61158:63;;61205:16;;;;;;;;;;;;;;61158:63;61235:19;;;;:24;;:50;;-1:-1:-1;61263:17:0;;;;:22;61235:50;61231:80;;;61294:17;;;;;;;;;;;;;;61231:80;61325:18;;;;-1:-1:-1;;;;;61325:32:0;;;:66;;-1:-1:-1;61361:16:0;;;;-1:-1:-1;;;;;61361:30:0;;61325:66;61321:92;;;61400:13;;;;;;;;;;;;;;61321:92;61445:37;58699:10;61445:15;:37;:::i;:::-;61427:6;:15;;;:55;61423:86;;;61491:18;;;;;;;;;;;;;;61423:86;61644:20;61667:66;61686:4;61693:6;:18;;;61713:6;:19;;;61667:10;:66::i;:::-;61644:89;;61801:23;61856:1;61838:15;;:19;61834:85;;;56735:3;61893:15;;61878:12;:30;;;;:::i;:::-;61877:42;;;;:::i;:::-;61859:60;;61834:85;61929:31;61945:15;61929:31;;:::i;:::-;;;62073:20;62120:618;;;;;;;;62178:13;62120:618;;;;;;62223:6;:17;;;62120:618;;;;;;62272:6;:13;;;-1:-1:-1;;;;;62120:618:0;;;;;62318:6;:9;;;-1:-1:-1;;;;;62120:618:0;;;;;62358:6;:18;;;-1:-1:-1;;;;;62120:618:0;;;;;62405:6;:16;;;-1:-1:-1;;;;;62120:618:0;;;;;62453:12;62120:618;;;;62495:6;:17;;;62120:618;;;;62547:15;62120:618;;;;62594:6;:19;;;62120:618;;;;;;62641:6;:15;;;62120:618;;;;62681:5;;:7;;;;;;;;;:::i;:::-;;;;-1:-1:-1;62120:618:0;;62096:652;;;;;;;;:::i;:::-;;;;;;;;;;;;;;62782:18;;62096:652;62782:18;;;;;;;62758:21;62810:29;;;:14;:29;;;;;;:54;;-1:-1:-1;;62810:54:0;62842:22;62810:54;;;62936:13;;;62984:17;;63015:18;;;;63047:16;;;;63103:17;;;;63134:19;;;;62096:652;;-1:-1:-1;62782:18:0;;-1:-1:-1;;;;;62880:283:0;;;;62782:18;;62880:283;;;;62096:652;;62984:17;;63015:18;;63047:16;;63077:12;;62880:283;:::i;:::-;;;;;;;;61117:2053;;;;61056:2114;:::o;68345:1153::-;68426:18;;;;;;68402:21;68493:29;68436:7;68493:20;:29::i;:::-;68560:10;47058:4;47081:29;;;:12;;:29;:12;:29;;;68454:68;;-1:-1:-1;47081:29:0;;68533:382;;;68668:11;:20;;;68649:15;:39;68645:73;;68697:21;;;;;;;;;;;;;;68645:73;68533:382;;;58560:6;68839:11;:20;;;:35;;;;:::i;:::-;68820:15;:54;68816:88;;68883:21;;;;;;;;;;;;;;68816:88;69024:22;68991:29;;;;:14;:29;;;;;;;;:55;;;;;;;;:::i;:::-;;68987:85;;69055:17;;;;;;;;;;;;;;68987:85;69082:29;;;;:14;:29;;;;;;:53;;-1:-1:-1;;69082:53:0;69114:21;69082:53;;;69221:24;;;69271:23;;;;69348:27;;;;69321:24;;;;69221;;69271:23;;69321:54;;69348:27;69321:54;:::i;:::-;69304:71;-1:-1:-1;69385:35:0;-1:-1:-1;;;;;69385:23:0;;69409:2;69304:71;69385:23;:35::i;:::-;69436:55;;;-1:-1:-1;;;;;10619:55:1;;;10601:74;;10706:2;10691:18;;10684:34;;;69436:55:0;;;69458:13;;69436:55;;10574:18:1;69436:55:0;;;;;;;68392:1106;;;;;68345:1153;:::o;64964:567::-;56459:25;46591:16;46602:4;46591:10;:16::i;:::-;65087:18;;::::1;::::0;::::1;::::0;65208:22:::1;65175:29;::::0;;;:14:::1;:29;::::0;;;;;::::1;;:55;::::0;::::1;;;;;;:::i;:::-;;65171:85;;65239:17;;;;;;;;;;;;;;65171:85;65266:29;::::0;;;:14:::1;:29;::::0;;;;;;;:59;;65298:27:::1;-1:-1:-1::0;;65266:59:0;;::::1;;::::0;;65365:70;;;;::::1;::::0;;::::1;65396:15;65365:70:::0;::::1;::::0;;65423:10:::1;65365:70:::0;;::::1;::::0;;;65335:27;;;:12:::1;:27:::0;;;;;;:100;;;;-1:-1:-1;;;;;65335:100:0::1;::::0;::::1;::::0;;;::::1;::::0;;;::::1;::::0;;65466:58;785:25:1;;;65266:29:0;;65466:58:::1;::::0;758:18:1;65466:58:0::1;;;;;;;65053:478;64964:567:::0;;;:::o;63208:1718::-;56459:25;46591:16;46602:4;46591:10;:16::i;:::-;63319:18;;::::1;::::0;::::1;::::0;63295:21:::1;63386:29;63329:7:::0;63386:20:::1;:29::i;:::-;63347:68;;63463:13;63429:48;;:11;:23;;;:48;;;63425:77;;63486:16;;;;;;;;;;;;;;63425:77;63598:11;:20;;;63580:15;:38;63576:69;;;63627:18;;;;;;;;;;;;;;63576:69;63706:27;::::0;;;:12:::1;:27;::::0;;;;;::::1;;63702:60;;;63742:20;;;;;;;;;;;;;;63702:60;63772:27;::::0;;;:12:::1;:27;::::0;;;;:34;;-1:-1:-1;;63772:34:0::1;63802:4;63772:34;::::0;;63919:25:::1;::::0;::::1;::::0;63970:21:::1;::::0;::::1;::::0;64018:22:::1;::::0;::::1;::::0;64068:14:::1;::::0;64097:24:::1;::::0;::::1;::::0;64092:517:::1;;-1:-1:-1::0;64175:1:0::1;64190:29;64201:2:::0;64205:5;64212:6;64190:10:::1;:29::i;:::-;;64092:517;;;64240:38:::0;-1:-1:-1;;;;;64240:38:0;::::1;::::0;64236:373:::1;;64360:38;64371:2:::0;64375:5;64382:15:::1;64391:6:::0;64382;:15:::1;:::i;:::-;64360:10;:38::i;64236:373::-;64502:29;64513:2;64517:5;64524:6;64502:10;:29::i;:::-;;64545:53;64556:2;51321:42;64591:6;64545:10;:53::i;:::-;;64236:373;64718:25:::0;;64757:23:::1;::::0;;::::1;::::0;64794:21:::1;::::0;;::::1;::::0;64829:24:::1;::::0;;::::1;::::0;64867:22:::1;::::0;::::1;::::0;64624:295:::1;::::0;;13103:10:1;13091:23;;;13073:42;;-1:-1:-1;;;;;13212:15:1;;;13207:2;13192:18;;13185:43;13264:15;;;13244:18;;;13237:43;;;;13311:2;13296:18;;13289:34;13339:19;;;13332:35;13383:19;;13376:35;;;64624:295:0;::::1;::::0;64678:10:::1;::::0;64651:13;;64624:295:::1;::::0;13045:19:1;64624:295:0::1;12788:629:1::0;55129:142:0;55210:7;55236:18;;;:12;:18;;;;;:28;;55258:5;55236:21;:28::i;:::-;55229:35;55129:142;-1:-1:-1;;;55129:142:0:o;66187:373::-;66268:4;66321:27;66288:29;;;;:14;:29;;;;;;;;:60;;;;;;;;:::i;:::-;;66284:90;;66357:17;;;;;;;;;;;;;;66284:90;66384:24;66411:27;;;:12;:27;;;;;;;;;66384:54;;;;;;;;;;;;;;-1:-1:-1;;;;;66384:54:0;;;;;;;;;;;;66452:24;;;66448:54;;66485:17;;;;;;;;;;;;;;66448:54;66117:15;;58415:10;;66098:15;66091:41;66083:49;;66519:34;;66187:373;-1:-1:-1;;;;66187:373:0:o;60855:163::-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;60971:40:0;;-1:-1:-1;;60971:40:0;;;;;;;;;;:::i;67782:525::-;56599:23;46591:16;46602:4;46591:10;:16::i;:::-;67899:27:::1;67866:29;::::0;;;:14:::1;:29;::::0;;;;;::::1;;:60;::::0;::::1;;;;;;:::i;:::-;;67862:90;;67935:17;;;;;;;;;;;;;;67862:90;67977:27;::::0;;;:12:::1;:27;::::0;;;;;;;;67966:39;;;;::::1;::::0;;;;::::1;::::0;;::::1;::::0;;;;;;::::1;-1:-1:-1::0;;;;;67966:39:0::1;::::0;;;::::1;::::0;;;;58415:10:::1;::::0;66098:15;66091:41;66083:49;67966:56:::1;67962:90;;;68031:21;;;;;;;;;;;;;;67962:90;68140:29;::::0;;;:14:::1;:29;::::0;;;;;;;:54;;-1:-1:-1;;68140:54:0::1;68172:22;68140:54;::::0;;68211:12:::1;:27:::0;;;;;;68204:34;;;68254:46;68289:10:::1;::::0;68140:29;;68254:46:::1;::::0;68140:29;68254:46:::1;67782:525:::0;;:::o;57238:290::-;56668:26;46591:16;46602:4;46591:10;:16::i;:::-;56783:6:::1;57337:10;:26;;57329:55;;;::::0;::::1;::::0;;15233:2:1;57329:55:0::1;::::0;::::1;15215:21:1::0;15272:2;15252:18;;;15245:30;15311:18;15291;;;15284:46;15347:18;;57329:55:0::1;;;;;;;;;57415:15;::::0;;57440:28;;;;57483:38:::1;::::0;;15550:25:1;;;15606:2;15591:18;;15584:34;;;57483:38:0::1;::::0;15523:18:1;57483:38:0::1;;;;;;;;57319:209;57238:290:::0;;:::o;57899:264::-;56668:26;46591:16;46602:4;46591:10;:16::i;:::-;58024:14:::1;::::0;;58048:34;;;;58097:59:::1;::::0;;15550:25:1;;;15606:2;15591:18;;15584:34;;;58097:59:0::1;::::0;15523:18:1;58097:59:0::1;15376:248:1::0;55439:131:0;55510:7;55536:18;;;:12;:18;;;;;:27;;:25;:27::i;48769:138::-;48002:7;48028:12;;;;;;;;;;:22;;;46591:16;46602:4;46591:10;:16::i;:::-;48874:26:::1;48886:4;48892:7;48874:11;:26::i;46692:202::-:0;46777:4;46800:47;;;46815:32;46800:47;;:87;;-1:-1:-1;38607:25:0;38592:40;;;;46851:36;38493:146;47326:103;47392:30;47403:4;22402:10;47392;:30::i;:::-;47326:103;:::o;51604:653::-;51779:4;-1:-1:-1;;;;;51765:19:0;;;51761:32;;51604:653;;;:::o;51761:32::-;51865:5;51874:1;51865:10;51861:23;;51604:653;;;:::o;51861:23::-;51897:20;-1:-1:-1;;;;;51897:20:0;;;51893:358;;52077:12;52094:2;-1:-1:-1;;;;;52094:7:0;52109:5;52094:25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;52076:43;;;52141:7;52133:39;;;;;;;16041:2:1;52133:39:0;;;16023:21:1;16080:2;16060:18;;;16053:30;16119:21;16099:18;;;16092:49;16158:18;;52133:39:0;15839:343:1;51893:358:0;52203:37;-1:-1:-1;;;;;52203:26:0;;52230:2;52234:5;52203:26;:37::i;55672:257::-;55758:4;55774:12;55789:31;55806:4;55812:7;55789:16;:31::i;:::-;55774:46;;55834:7;55830:69;;;55857:18;;;;:12;:18;;;;;:31;;55880:7;55857:22;:31::i;:::-;;55915:7;55672:257;-1:-1:-1;;;55672:257:0:o;56032:262::-;56119:4;56135:12;56150:32;56168:4;56174:7;56150:17;:32::i;:::-;56135:47;;56196:7;56192:72;;;56219:18;;;;:12;:18;;;;;:34;;56245:7;56219:25;:34::i;59640:1177::-;59728:20;-1:-1:-1;;;;;59764:38:0;;51321:42;59764:38;59760:1051;;59818:24;:5;-1:-1:-1;;;;;59818:22:0;;:24::i;:::-;59923:34;;;;;-1:-1:-1;;;;;7391:55:1;;;59923:34:0;;;7373:74:1;59923:23:0;;;;;7346:18:1;;59923:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;59908:49;-1:-1:-1;60103:61:0;-1:-1:-1;;;;;60103:30:0;;60134:10;60146:9;60157:6;60103:30;:61::i;:::-;60300:34;;;;;-1:-1:-1;;;;;7391:55:1;;;60300:34:0;;;7373:74:1;60337:12:0;;60300:23;;;;;;7346:18:1;;60300:34:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;:49;;;;:::i;:::-;60285:64;;59760:1051;;;60471:9;60461:6;:19;60457:51;;60489:19;;;;;;;;;;;;;;60457:51;-1:-1:-1;;;;;60589:26:0;;60610:4;60589:26;60585:74;;60617:42;-1:-1:-1;;;;;60617:23:0;;60641:9;60652:6;60617:23;:42::i;:::-;-1:-1:-1;60791:9:0;59640:1177;;;;;:::o;33105:156::-;33179:7;33229:22;33233:3;33245:5;33229:3;:22::i;32648:115::-;32711:7;32737:19;32745:3;28087:18;;28005:107;47559:197;47058:4;47081:12;;;;;;;;;;;-1:-1:-1;;;;;47081:29:0;;;;;;;;;;;;47642:108;;47692:47;;;;;-1:-1:-1;;;;;10619:55:1;;47692:47:0;;;10601:74:1;10691:18;;;10684:34;;;10574:18;;47692:47:0;10427:297:1;47642:108:0;47559:197;;:::o;39809:160::-;39918:43;;-1:-1:-1;;;;;10619:55:1;;;39918:43:0;;;10601:74:1;10691:18;;;10684:34;;;39891:71:0;;39911:5;;39933:14;;;;;10574:18:1;;39918:43:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;39891:19;:71::i;50306:316::-;50383:4;47081:12;;;;;;;;;;;-1:-1:-1;;;;;47081:29:0;;;;;;;;;;;;50399:217;;50442:6;:12;;;;;;;;;;;-1:-1:-1;;;;;50442:29:0;;;;;;;;;:36;;-1:-1:-1;;50442:36:0;50474:4;50442:36;;;50524:12;22402:10;;22323:96;50524:12;-1:-1:-1;;;;;50497:40:0;50515:7;-1:-1:-1;;;;;50497:40:0;50509:4;50497:40;;;;;;;;;;-1:-1:-1;50558:4:0;50551:11;;50399:217;-1:-1:-1;50600:5:0;50593:12;;31847:150;31917:4;31940:50;31945:3;-1:-1:-1;;;;;31965:23:0;;31940:4;:50::i;50857:317::-;50935:4;47081:12;;;;;;;;;;;-1:-1:-1;;;;;47081:29:0;;;;;;;;;;;;50951:217;;;51025:5;50993:12;;;;;;;;;;;-1:-1:-1;;;;;50993:29:0;;;;;;;;;;:37;;-1:-1:-1;;50993:37:0;;;51049:40;22402:10;;50993:12;;51049:40;;51025:5;51049:40;-1:-1:-1;51110:4:0;51103:11;;32165:156;32238:4;32261:53;32269:3;-1:-1:-1;;;;;32289:23:0;;32261:7;:53::i;53421:344::-;53588:38;-1:-1:-1;;;;;53588:38:0;;;53584:69;;53635:18;;;;;;;;;;;;;;53584:69;53709:5;-1:-1:-1;;;;;53709:17:0;;53730:1;53709:22;53705:53;;53740:18;;;;;;;;;;;;;;40208:188;40335:53;;-1:-1:-1;;;;;9986:15:1;;;40335:53:0;;;9968:34:1;10038:15;;;10018:18;;;10011:43;10070:18;;;10063:34;;;40308:81:0;;40328:5;;40350:18;;;;;9880::1;;40335:53:0;9705:398:1;28454:118:0;28521:7;28547:3;:11;;28559:5;28547:18;;;;;;;;:::i;:::-;;;;;;;;;28540:25;;28454:118;;;;:::o;42565:629::-;42984:23;43010:33;-1:-1:-1;;;;;43010:27:0;;43038:4;43010:27;:33::i;:::-;42984:59;;43057:10;:17;43078:1;43057:22;;:57;;;;;43095:10;43084:30;;;;;;;;;;;;:::i;:::-;43083:31;43057:57;43053:135;;;43137:40;;;;;-1:-1:-1;;;;;7391:55:1;;43137:40:0;;;7373:74:1;7346:18;;43137:40:0;7227:226:1;25772:406:0;25835:4;27891:21;;;:14;;;:21;;;;;;25851:321;;-1:-1:-1;25893:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;26075:18;;26051:21;;;:14;;;:21;;;;;;:42;;;;26107:11;;26346:1368;26412:4;26541:21;;;:14;;;:21;;;;;;26577:13;;26573:1135;;26944:18;26965:12;26976:1;26965:8;:12;:::i;:::-;27011:18;;26944:33;;-1:-1:-1;26991:17:0;;27011:22;;27032:1;;27011:22;:::i;:::-;26991:42;;27066:9;27052:10;:23;27048:378;;27095:17;27115:3;:11;;27127:9;27115:22;;;;;;;;:::i;:::-;;;;;;;;;27095:42;;27262:9;27236:3;:11;;27248:10;27236:23;;;;;;;;:::i;:::-;;;;;;;;;;;;:35;;;;27375:25;;;:14;;;:25;;;;;:36;;;27048:378;27504:17;;:3;;:17;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;27607:3;:14;;:21;27622:5;27607:21;;;;;;;;;;;27600:28;;;27650:4;27643:11;;;;;;;26573:1135;27692:5;27685:12;;;;;18108:151;18183:12;18214:38;18236:6;18244:4;18250:1;18183:12;18824;18838:23;18865:6;-1:-1:-1;;;;;18865:11:0;18884:5;18891:4;18865:31;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;18823:73;;;;18913:55;18940:6;18948:7;18957:10;18913:26;:55::i;:::-;18906:62;18583:392;-1:-1:-1;;;;;;18583:392:0:o;20028:582::-;20172:12;20201:7;20196:408;;20224:19;20232:10;20224:7;:19::i;:::-;20196:408;;;20448:17;;:22;:49;;;;-1:-1:-1;;;;;;20474:18:0;;;:23;20448:49;20444:119;;;20524:24;;;;;-1:-1:-1;;;;;7391:55:1;;20524:24:0;;;7373:74:1;7346:18;;20524:24:0;7227:226:1;20444:119:0;-1:-1:-1;20583:10:0;20576:17;;21146:516;21277:17;;:21;21273:383;;21505:10;21499:17;21561:15;21548:10;21544:2;21540:19;21533:44;21273:383;21628:17;;;;;;;;;;;;;;14:332:1;72:6;125:2;113:9;104:7;100:23;96:32;93:52;;;141:1;138;131:12;93:52;180:9;167:23;230:66;223:5;219:78;212:5;209:89;199:117;;312:1;309;302:12;821:180;880:6;933:2;921:9;912:7;908:23;904:32;901:52;;;949:1;946;939:12;901:52;-1:-1:-1;972:23:1;;821:180;-1:-1:-1;821:180:1:o;1006:184::-;1058:77;1055:1;1048:88;1155:4;1152:1;1145:15;1179:4;1176:1;1169:15;1195:402;1344:2;1329:18;;1377:1;1366:13;;1356:201;;1413:77;1410:1;1403:88;1514:4;1511:1;1504:15;1542:4;1539:1;1532:15;1356:201;1566:25;;;1195:402;:::o;1602:154::-;-1:-1:-1;;;;;1681:5:1;1677:54;1670:5;1667:65;1657:93;;1746:1;1743;1736:12;1761:134;1829:20;;1858:31;1829:20;1858:31;:::i;:::-;1761:134;;;:::o;1900:388::-;1968:6;1976;2029:2;2017:9;2008:7;2004:23;2000:32;1997:52;;;2045:1;2042;2035:12;1997:52;2084:9;2071:23;2103:31;2128:5;2103:31;:::i;:::-;2153:5;-1:-1:-1;2210:2:1;2195:18;;2182:32;2223:33;2182:32;2223:33;:::i;:::-;2275:7;2265:17;;;1900:388;;;;;:::o;2475:315::-;2543:6;2551;2604:2;2592:9;2583:7;2579:23;2575:32;2572:52;;;2620:1;2617;2610:12;2572:52;2656:9;2643:23;2633:33;;2716:2;2705:9;2701:18;2688:32;2729:31;2754:5;2729:31;:::i;2795:184::-;2847:77;2844:1;2837:88;2944:4;2941:1;2934:15;2968:4;2965:1;2958:15;2984:252;3056:2;3050:9;3098:3;3086:16;;3132:18;3117:34;;3153:22;;;3114:62;3111:88;;;3179:18;;:::i;:::-;3215:2;3208:22;2984:252;:::o;3241:247::-;3308:2;3302:9;3350:3;3338:16;;3384:18;3369:34;;3405:22;;;3366:62;3363:88;;;3431:18;;:::i;3493:777::-;3535:5;3588:3;3581:4;3573:6;3569:17;3565:27;3555:55;;3606:1;3603;3596:12;3555:55;3642:6;3629:20;3668:18;3705:2;3701;3698:10;3695:36;;;3711:18;;:::i;:::-;3845:2;3839:9;3907:4;3899:13;;3750:66;3895:22;;;3919:2;3891:31;3887:40;3875:53;;;3943:18;;;3963:22;;;3940:46;3937:72;;;3989:18;;:::i;:::-;4029:10;4025:2;4018:22;4064:2;4056:6;4049:18;4110:3;4103:4;4098:2;4090:6;4086:15;4082:26;4079:35;4076:55;;;4127:1;4124;4117:12;4076:55;4191:2;4184:4;4176:6;4172:17;4165:4;4157:6;4153:17;4140:54;4238:1;4231:4;4226:2;4218:6;4214:15;4210:26;4203:37;4258:6;4249:15;;;;;;3493:777;;;;:::o;4275:455::-;4352:6;4360;4413:2;4401:9;4392:7;4388:23;4384:32;4381:52;;;4429:1;4426;4419:12;4381:52;4469:9;4456:23;4502:18;4494:6;4491:30;4488:50;;;4534:1;4531;4524:12;4488:50;4557:49;4598:7;4589:6;4578:9;4574:22;4557:49;:::i;:::-;4547:59;;;4656:2;4645:9;4641:18;4628:32;4669:31;4694:5;4669:31;:::i;4735:121::-;4820:10;4813:5;4809:22;4802:5;4799:33;4789:61;;4846:1;4843;4836:12;4861:132;4928:20;;4957:30;4928:20;4957:30;:::i;4998:118::-;5084:5;5077:13;5070:21;5063:5;5060:32;5050:60;;5106:1;5103;5096:12;5121:128;5186:20;;5215:28;5186:20;5215:28;:::i;5254:865::-;5342:6;5395:3;5383:9;5374:7;5370:23;5366:33;5363:53;;;5412:1;5409;5402:12;5363:53;5438:22;;:::i;:::-;5483:28;5501:9;5483:28;:::i;:::-;5476:5;5469:43;5544:38;5578:2;5567:9;5563:18;5544:38;:::i;:::-;5539:2;5532:5;5528:14;5521:62;5615:38;5649:2;5638:9;5634:18;5615:38;:::i;:::-;5610:2;5603:5;5599:14;5592:62;5686:38;5720:2;5709:9;5705:18;5686:38;:::i;:::-;5681:2;5674:5;5670:14;5663:62;5758:39;5792:3;5781:9;5777:19;5758:39;:::i;:::-;5752:3;5745:5;5741:15;5734:64;5859:3;5848:9;5844:19;5831:33;5825:3;5818:5;5814:15;5807:58;5926:3;5915:9;5911:19;5898:33;5892:3;5885:5;5881:15;5874:58;5965:36;5996:3;5985:9;5981:19;5965:36;:::i;:::-;5959:3;5948:15;;5941:61;6021:3;6069:18;;;6056:32;6040:14;;;6033:56;;;;-1:-1:-1;5952:5:1;5254:865;-1:-1:-1;5254:865:1:o;6124:320::-;6192:6;6245:2;6233:9;6224:7;6220:23;6216:32;6213:52;;;6261:1;6258;6251:12;6213:52;6301:9;6288:23;6334:18;6326:6;6323:30;6320:50;;;6366:1;6363;6356:12;6320:50;6389:49;6430:7;6421:6;6410:9;6406:22;6389:49;:::i;:::-;6379:59;6124:320;-1:-1:-1;;;;6124:320:1:o;6449:388::-;6526:6;6534;6587:2;6575:9;6566:7;6562:23;6558:32;6555:52;;;6603:1;6600;6593:12;6555:52;6643:9;6630:23;6676:18;6668:6;6665:30;6662:50;;;6708:1;6705;6698:12;6662:50;6731:49;6772:7;6763:6;6752:9;6748:22;6731:49;:::i;:::-;6721:59;6827:2;6812:18;;;;6799:32;;-1:-1:-1;;;;6449:388:1:o;6842:248::-;6910:6;6918;6971:2;6959:9;6950:7;6946:23;6942:32;6939:52;;;6987:1;6984;6977:12;6939:52;-1:-1:-1;;7010:23:1;;;7080:2;7065:18;;;7052:32;;-1:-1:-1;6842:248:1:o;7890:1373::-;8121:13;;7867:10;7856:22;7844:35;;8090:3;8075:19;;8193:4;8185:6;8181:17;8175:24;8208:53;8255:4;8244:9;8240:20;8226:12;7867:10;7856:22;7844:35;;7791:94;8208:53;;8310:4;8302:6;8298:17;8292:24;8325:56;8375:4;8364:9;8360:20;8344:14;-1:-1:-1;;;;;7161:54:1;7149:67;;7095:127;8325:56;;8430:4;8422:6;8418:17;8412:24;8445:56;8495:4;8484:9;8480:20;8464:14;-1:-1:-1;;;;;7161:54:1;7149:67;;7095:127;8445:56;;8550:4;8542:6;8538:17;8532:24;8565:56;8615:4;8604:9;8600:20;8584:14;-1:-1:-1;;;;;7161:54:1;7149:67;;7095:127;8565:56;;8670:4;8662:6;8658:17;8652:24;8685:56;8735:4;8724:9;8720:20;8704:14;-1:-1:-1;;;;;7161:54:1;7149:67;;7095:127;8685:56;;8797:4;8789:6;8785:17;8779:24;8772:4;8761:9;8757:20;8750:54;8860:4;8852:6;8848:17;8842:24;8835:4;8824:9;8820:20;8813:54;8886:6;8946:2;8938:6;8934:15;8928:22;8923:2;8912:9;8908:18;8901:50;;8970:6;9025:2;9017:6;9013:15;9007:22;9038:51;9085:2;9074:9;9070:18;9054:14;421:13;414:21;402:34;;351:91;9038:51;-1:-1:-1;;9108:6:1;9156:15;;;9150:22;9130:18;;;9123:50;9192:6;9240:15;;;9234:22;9214:18;;;;9207:50;;;;7890:1373;:::o;9453:247::-;9512:6;9565:2;9553:9;9544:7;9540:23;9536:32;9533:52;;;9581:1;9578;9571:12;9533:52;9620:9;9607:23;9639:31;9664:5;9639:31;:::i;10108:184::-;10160:77;10157:1;10150:88;10257:4;10254:1;10247:15;10281:4;10278:1;10271:15;10297:125;10362:9;;;10383:10;;;10380:36;;;10396:18;;:::i;10729:168::-;10802:9;;;10833;;10850:15;;;10844:22;;10830:37;10820:71;;10871:18;;:::i;10902:274::-;10942:1;10968;10958:189;;11003:77;11000:1;10993:88;11104:4;11101:1;11094:15;11132:4;11129:1;11122:15;10958:189;-1:-1:-1;11161:9:1;;10902:274::o;11181:128::-;11248:9;;;11269:11;;;11266:37;;;11283:18;;:::i;11314:195::-;11353:3;11384:66;11377:5;11374:77;11371:103;;11454:18;;:::i;:::-;-1:-1:-1;11501:1:1;11490:13;;11314:195::o;11514:250::-;11599:1;11609:113;11623:6;11620:1;11617:13;11609:113;;;11699:11;;;11693:18;11680:11;;;11673:39;11645:2;11638:10;11609:113;;;-1:-1:-1;;11756:1:1;11738:16;;11731:27;11514:250::o;11769:1014::-;12076:3;12065:9;12058:22;12039:4;12109:6;12103:13;12153:6;12147:3;12136:9;12132:19;12125:35;12179:3;12191:81;12265:6;12260:2;12249:9;12245:18;12238:4;12230:6;12226:17;12191:81;:::i;:::-;12452:10;12440:23;;;;12433:4;12418:20;;12411:53;-1:-1:-1;;;;;12561:15:1;;;12556:2;12541:18;;12534:43;12613:15;;;;12608:2;12593:18;;12586:43;12660:3;12645:19;;12638:35;;;;12704:3;12689:19;;12682:35;;;;12761:14;12754:22;12748:3;12733:19;;12726:51;12324:2;12312:15;;;-1:-1:-1;12308:88:1;12293:104;12289:113;;;;;-1:-1:-1;;11769:1014:1:o;13422:136::-;13500:13;;13522:30;13500:13;13522:30;:::i;13563:138::-;13642:13;;13664:31;13642:13;13664:31;:::i;13706:132::-;13782:13;;13804:28;13782:13;13804:28;:::i;13843:1183::-;13946:6;13999:3;13987:9;13978:7;13974:23;13970:33;13967:53;;;14016:1;14013;14006:12;13967:53;14042:17;;:::i;:::-;14082:39;14111:9;14082:39;:::i;:::-;14075:5;14068:54;14154:48;14198:2;14187:9;14183:18;14154:48;:::i;:::-;14149:2;14142:5;14138:14;14131:72;14235:49;14280:2;14269:9;14265:18;14235:49;:::i;:::-;14230:2;14223:5;14219:14;14212:73;14317:49;14362:2;14351:9;14347:18;14317:49;:::i;:::-;14312:2;14305:5;14301:14;14294:73;14400:50;14445:3;14434:9;14430:19;14400:50;:::i;:::-;14394:3;14387:5;14383:15;14376:75;14484:50;14529:3;14518:9;14514:19;14484:50;:::i;:::-;14478:3;14471:5;14467:15;14460:75;14589:3;14578:9;14574:19;14568:26;14562:3;14555:5;14551:15;14544:51;14649:3;14638:9;14634:19;14628:26;14622:3;14615:5;14611:15;14604:51;14674:3;14730:2;14719:9;14715:18;14709:25;14704:2;14697:5;14693:14;14686:49;;14754:3;14789:46;14831:2;14820:9;14816:18;14789:46;:::i;:::-;14773:14;;;14766:70;14855:3;14896:18;;;14890:25;14874:14;;;14867:49;14935:3;14976:18;;;14970:25;14954:14;;;14947:49;;;;-1:-1:-1;14777:5:1;13843:1183;-1:-1:-1;13843:1183:1:o;16187:184::-;16257:6;16310:2;16298:9;16289:7;16285:23;16281:32;16278:52;;;16326:1;16323;16316:12;16278:52;-1:-1:-1;16349:16:1;;16187:184;-1:-1:-1;16187:184:1:o;16678:::-;16730:77;16727:1;16720:88;16827:4;16824:1;16817:15;16851:4;16848:1;16841:15;16867:245;16934:6;16987:2;16975:9;16966:7;16962:23;16958:32;16955:52;;;17003:1;17000;16993:12;16955:52;17035:9;17029:16;17054:28;17076:5;17054:28;:::i;17117:184::-;17169:77;17166:1;17159:88;17266:4;17263:1;17256:15;17290:4;17287:1;17280:15;17306:287;17435:3;17473:6;17467:13;17489:66;17548:6;17543:3;17536:4;17528:6;17524:17;17489:66;:::i;:::-;17571:16;;;;;17306:287;-1:-1:-1;;17306:287:1:o","abiDefinition":[{"inputs":[{"internalType":"address","name":"_owner","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":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"AddressInsufficientBalance","type":"error"},{"inputs":[],"name":"AmountIncorrect","type":"error"},{"inputs":[],"name":"ChainIncorrect","type":"error"},{"inputs":[],"name":"DeadlineExceeded","type":"error"},{"inputs":[],"name":"DeadlineNotExceeded","type":"error"},{"inputs":[],"name":"DeadlineTooShort","type":"error"},{"inputs":[],"name":"DisputePeriodNotPassed","type":"error"},{"inputs":[],"name":"DisputePeriodPassed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"MsgValueIncorrect","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"},{"inputs":[],"name":"SenderIncorrect","type":"error"},{"inputs":[],"name":"StatusIncorrect","type":"error"},{"inputs":[],"name":"TokenNotContract","type":"error"},{"inputs":[],"name":"TransactionRelayed","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BridgeDepositClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BridgeDepositRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"}],"name":"BridgeProofDisputed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":false,"internalType":"bytes32","name":"transactionHash","type":"bytes32"}],"name":"BridgeProofProvided","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint32","name":"originChainId","type":"uint32"},{"indexed":false,"internalType":"address","name":"originToken","type":"address"},{"indexed":false,"internalType":"address","name":"destToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"originAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"chainGasAmount","type":"uint256"}],"name":"BridgeRelayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"bytes","name":"request","type":"bytes"},{"indexed":false,"internalType":"uint32","name":"destChainId","type":"uint32"},{"indexed":false,"internalType":"address","name":"originToken","type":"address"},{"indexed":false,"internalType":"address","name":"destToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"originAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destAmount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"sendChainGas","type":"bool"}],"name":"BridgeRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldChainGasAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newChainGasAmount","type":"uint256"}],"name":"ChainGasAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"FeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesSwept","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"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DISPUTE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_BPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_RATE_MAX","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GOVERNOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GUARD_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_DEADLINE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REFUNDER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REFUND_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RELAYER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstChainId","type":"uint32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"originToken","type":"address"},{"internalType":"address","name":"destToken","type":"address"},{"internalType":"uint256","name":"originAmount","type":"uint256"},{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"bool","name":"sendChainGas","type":"bool"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct IFastBridge.BridgeParams","name":"params","type":"tuple"}],"name":"bridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"bridgeProofs","outputs":[{"internalType":"uint96","name":"timestamp","type":"uint96"},{"internalType":"address","name":"relayer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"bridgeRelays","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"bridgeStatuses","outputs":[{"internalType":"enum FastBridge.BridgeStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"internalType":"address","name":"relayer","type":"address"}],"name":"canClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainGasAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"},{"internalType":"address","name":"to","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deployBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"}],"name":"dispute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"}],"name":"getBridgeTransaction","outputs":[{"components":[{"internalType":"uint32","name":"originChainId","type":"uint32"},{"internalType":"uint32","name":"destChainId","type":"uint32"},{"internalType":"address","name":"originSender","type":"address"},{"internalType":"address","name":"destRecipient","type":"address"},{"internalType":"address","name":"originToken","type":"address"},{"internalType":"address","name":"destToken","type":"address"},{"internalType":"uint256","name":"originAmount","type":"uint256"},{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"uint256","name":"originFeeAmount","type":"uint256"},{"internalType":"bool","name":"sendChainGas","type":"bool"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct IFastBridge.BridgeTransaction","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolFeeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"protocolFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"},{"internalType":"bytes32","name":"destTxHash","type":"bytes32"}],"name":"prove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"}],"name":"relay","outputs":[],"stateMutability":"payable","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":"newChainGasAmount","type":"uint256"}],"name":"setChainGasAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"setProtocolFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepProtocolFees","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{"DISPUTE_PERIOD()":{"notice":"Dispute period for relayed transactions"},"MIN_DEADLINE_PERIOD()":{"notice":"Minimum deadline period to relay a requested bridge transaction"},"REFUND_DELAY()":{"notice":"Delay for a transaction after which it could be permisionlessly refunded"},"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))":{"notice":"Initiates bridge on origin chain to be relayed by off-chain relayer"},"bridgeProofs(bytes32)":{"notice":"Proof of relayed bridge tx on origin chain"},"bridgeRelays(bytes32)":{"notice":"Whether bridge has been relayed on destination chain"},"bridgeStatuses(bytes32)":{"notice":"Status of the bridge tx on origin chain"},"canClaim(bytes32,address)":{"notice":"Checks if the dispute period has passed so bridge deposit can be claimed"},"chainGasAmount()":{"notice":"Chain gas amount to forward as rebate if requested"},"claim(bytes,address)":{"notice":"Completes bridge transaction on origin chain by claiming originally deposited capital"},"dispute(bytes32)":{"notice":"Disputes an outstanding proof in case relayer provided dest chain tx is invalid"},"getBridgeTransaction(bytes)":{"notice":"Decodes bridge request into a bridge transaction"},"protocolFeeRate()":{"notice":"Protocol fee rate taken on origin amount deposited in origin chain"},"protocolFees(address)":{"notice":"Protocol fee amounts accumulated"},"prove(bytes,bytes32)":{"notice":"Provides proof on origin side that relayer provided funds on destination side of bridge transaction"},"refund(bytes)":{"notice":"Refunds an outstanding bridge transaction in case optimistic bridging failed"},"relay(bytes)":{"notice":"Relays destination side of bridge transaction by off-chain relayer"}},"version":1},"developerDoc":{"errors":{"AccessControlBadConfirmation()":[{"details":"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."}],"AccessControlUnauthorizedAccount(address,bytes32)":[{"details":"The `account` is missing a role."}],"AddressEmptyCode(address)":[{"details":"There's no code at `target` (it is not a contract)."}],"AddressInsufficientBalance(address)":[{"details":"The ETH balance of the account is not enough to perform the operation."}],"FailedInnerCall()":[{"details":"A call to an address target failed. The target may have reverted."}],"SafeERC20FailedOperation(address)":[{"details":"An operation with an ERC20 token failed."}]},"events":{"RoleAdminChanged(bytes32,bytes32,bytes32)":{"details":"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."},"RoleGranted(bytes32,address,address)":{"details":"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."},"RoleRevoked(bytes32,address,address)":{"details":"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"}},"kind":"dev","methods":{"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))":{"params":{"params":"The parameters required to bridge"}},"canClaim(bytes32,address)":{"params":{"relayer":"The address of the relayer attempting to claim","transactionId":"The transaction id associated with the encoded bridge transaction to check"}},"claim(bytes,address)":{"params":{"request":"The encoded bridge transaction to claim on origin chain","to":"The recipient address of the funds"}},"dispute(bytes32)":{"params":{"transactionId":"The transaction id associated with the encoded bridge transaction to dispute"}},"getBridgeTransaction(bytes)":{"params":{"request":"The bridge request to decode"}},"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}."},"getRoleMember(bytes32,uint256)":{"details":"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information."},"getRoleMemberCount(bytes32)":{"details":"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"prove(bytes,bytes32)":{"params":{"destTxHash":"The destination tx hash proving bridge transaction was relayed","request":"The encoded bridge transaction to prove on origin chain"}},"refund(bytes)":{"params":{"request":"The encoded bridge transaction to refund"}},"relay(bytes)":{"params":{"request":"The encoded bridge transaction to relay on destination chain"}},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event."},"supportsInterface(bytes4)":{"details":"See {IERC165-supportsInterface}."}},"stateVariables":{"nonce":{"details":"to prevent replays"}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_owner\",\"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\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AddressInsufficientBalance\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AmountIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ChainIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineNotExceeded\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DeadlineTooShort\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodNotPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DisputePeriodPassed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MsgValueIncorrect\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SenderIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"StatusIncorrect\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TokenNotContract\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TransactionRelayed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositRefunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"BridgeProofDisputed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"}],\"name\":\"BridgeProofProvided\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainGasAmount\",\"type\":\"uint256\"}],\"name\":\"BridgeRelayed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"}],\"name\":\"BridgeRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldChainGasAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"ChainGasAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"FeeRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesSwept\",\"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\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DISPUTE_PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_BPS\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"FEE_RATE_MAX\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GOVERNOR_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"GUARD_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_DEADLINE_PERIOD\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFUNDER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REFUND_DELAY\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RELAYER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct IFastBridge.BridgeParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"bridge\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"bridgeProofs\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"timestamp\",\"type\":\"uint96\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"bridgeRelays\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"bridgeStatuses\",\"outputs\":[{\"internalType\":\"enum FastBridge.BridgeStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"canClaim\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"chainGasAmount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"deployBlock\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"dispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"getBridgeTransaction\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"originSender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"originFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IFastBridge.BridgeTransaction\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":\"nonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFeeRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"destTxHash\",\"type\":\"bytes32\"}],\"name\":\"prove\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"refund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"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\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"setChainGasAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeeRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepProtocolFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}],\"AddressEmptyCode(address)\":[{\"details\":\"There's no code at `target` (it is not a contract).\"}],\"AddressInsufficientBalance(address)\":[{\"details\":\"The ETH balance of the account is not enough to perform the operation.\"}],\"FailedInnerCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))\":{\"params\":{\"params\":\"The parameters required to bridge\"}},\"canClaim(bytes32,address)\":{\"params\":{\"relayer\":\"The address of the relayer attempting to claim\",\"transactionId\":\"The transaction id associated with the encoded bridge transaction to check\"}},\"claim(bytes,address)\":{\"params\":{\"request\":\"The encoded bridge transaction to claim on origin chain\",\"to\":\"The recipient address of the funds\"}},\"dispute(bytes32)\":{\"params\":{\"transactionId\":\"The transaction id associated with the encoded bridge transaction to dispute\"}},\"getBridgeTransaction(bytes)\":{\"params\":{\"request\":\"The bridge request to decode\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"prove(bytes,bytes32)\":{\"params\":{\"destTxHash\":\"The destination tx hash proving bridge transaction was relayed\",\"request\":\"The encoded bridge transaction to prove on origin chain\"}},\"refund(bytes)\":{\"params\":{\"request\":\"The encoded bridge transaction to refund\"}},\"relay(bytes)\":{\"params\":{\"request\":\"The encoded bridge transaction to relay on destination chain\"}},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"}},\"stateVariables\":{\"nonce\":{\"details\":\"to prevent replays\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"DISPUTE_PERIOD()\":{\"notice\":\"Dispute period for relayed transactions\"},\"MIN_DEADLINE_PERIOD()\":{\"notice\":\"Minimum deadline period to relay a requested bridge transaction\"},\"REFUND_DELAY()\":{\"notice\":\"Delay for a transaction after which it could be permisionlessly refunded\"},\"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))\":{\"notice\":\"Initiates bridge on origin chain to be relayed by off-chain relayer\"},\"bridgeProofs(bytes32)\":{\"notice\":\"Proof of relayed bridge tx on origin chain\"},\"bridgeRelays(bytes32)\":{\"notice\":\"Whether bridge has been relayed on destination chain\"},\"bridgeStatuses(bytes32)\":{\"notice\":\"Status of the bridge tx on origin chain\"},\"canClaim(bytes32,address)\":{\"notice\":\"Checks if the dispute period has passed so bridge deposit can be claimed\"},\"chainGasAmount()\":{\"notice\":\"Chain gas amount to forward as rebate if requested\"},\"claim(bytes,address)\":{\"notice\":\"Completes bridge transaction on origin chain by claiming originally deposited capital\"},\"dispute(bytes32)\":{\"notice\":\"Disputes an outstanding proof in case relayer provided dest chain tx is invalid\"},\"getBridgeTransaction(bytes)\":{\"notice\":\"Decodes bridge request into a bridge transaction\"},\"protocolFeeRate()\":{\"notice\":\"Protocol fee rate taken on origin amount deposited in origin chain\"},\"protocolFees(address)\":{\"notice\":\"Protocol fee amounts accumulated\"},\"prove(bytes,bytes32)\":{\"notice\":\"Provides proof on origin side that relayer provided funds on destination side of bridge transaction\"},\"refund(bytes)\":{\"notice\":\"Refunds an outstanding bridge transaction in case optimistic bridging failed\"},\"relay(bytes)\":{\"notice\":\"Relays destination side of bridge transaction by off-chain relayer\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"FastBridge\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"DEFAULT_ADMIN_ROLE()":"a217fddf","DISPUTE_PERIOD()":"a5bbe22b","FEE_BPS()":"bf333f2c","FEE_RATE_MAX()":"0f5f6ed7","GOVERNOR_ROLE()":"ccc57490","GUARD_ROLE()":"03ed0ee5","MIN_DEADLINE_PERIOD()":"820688d5","REFUNDER_ROLE()":"5960ccf2","REFUND_DELAY()":"190da595","RELAYER_ROLE()":"926d7d7f","bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))":"45851694","bridgeProofs(bytes32)":"91ad5039","bridgeRelays(bytes32)":"8379a24f","bridgeStatuses(bytes32)":"051287bc","canClaim(bytes32,address)":"aa9641ab","chainGasAmount()":"e00a83e0","claim(bytes,address)":"41fcb612","deployBlock()":"a3ec191a","dispute(bytes32)":"add98c70","getBridgeTransaction(bytes)":"ac11fb1a","getRoleAdmin(bytes32)":"248a9ca3","getRoleMember(bytes32,uint256)":"9010d07c","getRoleMemberCount(bytes32)":"ca15c873","grantRole(bytes32,address)":"2f2ff15d","hasRole(bytes32,address)":"91d14854","nonce()":"affed0e0","protocolFeeRate()":"58f85880","protocolFees(address)":"dcf844a7","prove(bytes,bytes32)":"886d36ff","refund(bytes)":"5eb7d946","relay(bytes)":"8f0d6f17","renounceRole(bytes32,address)":"36568abe","revokeRole(bytes32,address)":"d547741f","setChainGasAmount(uint256)":"b250fe6b","setProtocolFeeRate(uint256)":"b13aa2d6","supportsInterface(bytes4)":"01ffc9a7","sweepProtocolFees(address,address)":"06f333f2"}},"solidity/FastBridge.sol:IAccessControl":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"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"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","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":[{"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"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"External interface of AccessControl declared to support ERC165 detection.","errors":{"AccessControlBadConfirmation()":[{"details":"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."}],"AccessControlUnauthorizedAccount(address,bytes32)":[{"details":"The `account` is missing a role."}]},"events":{"RoleAdminChanged(bytes32,bytes32,bytes32)":{"details":"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."},"RoleGranted(bytes32,address,address)":{"details":"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."},"RoleRevoked(bytes32,address,address)":{"details":"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"}},"kind":"dev","methods":{"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"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\":[{\"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\"}],\"devdoc\":{\"details\":\"External interface of AccessControl declared to support ERC165 detection.\",\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IAccessControl\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"getRoleAdmin(bytes32)":"248a9ca3","grantRole(bytes32,address)":"2f2ff15d","hasRole(bytes32,address)":"91d14854","renounceRole(bytes32,address)":"36568abe","revokeRole(bytes32,address)":"d547741f"}},"solidity/FastBridge.sol:IAccessControlEnumerable":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"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"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"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"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"External interface of AccessControlEnumerable declared to support ERC165 detection.","errors":{"AccessControlBadConfirmation()":[{"details":"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}."}],"AccessControlUnauthorizedAccount(address,bytes32)":[{"details":"The `account` is missing a role."}]},"events":{"RoleAdminChanged(bytes32,bytes32,bytes32)":{"details":"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this."},"RoleGranted(bytes32,address,address)":{"details":"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}."},"RoleRevoked(bytes32,address,address)":{"details":"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)"}},"kind":"dev","methods":{"getRoleAdmin(bytes32)":{"details":"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}."},"getRoleMember(bytes32,uint256)":{"details":"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information."},"getRoleMemberCount(bytes32)":{"details":"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role."},"grantRole(bytes32,address)":{"details":"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role."},"hasRole(bytes32,address)":{"details":"Returns `true` if `account` has been granted `role`."},"renounceRole(bytes32,address)":{"details":"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`."},"revokeRole(bytes32,address)":{"details":"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"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\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getRoleMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleMemberCount\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"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\":[{\"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\"}],\"devdoc\":{\"details\":\"External interface of AccessControlEnumerable declared to support ERC165 detection.\",\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {AccessControl-_setRoleAdmin}.\"},\"getRoleMember(bytes32,uint256)\":{\"details\":\"Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.\"},\"getRoleMemberCount(bytes32)\":{\"details\":\"Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IAccessControlEnumerable\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"getRoleAdmin(bytes32)":"248a9ca3","getRoleMember(bytes32,uint256)":"9010d07c","getRoleMemberCount(bytes32)":"ca15c873","grantRole(bytes32,address)":"2f2ff15d","hasRole(bytes32,address)":"91d14854","renounceRole(bytes32,address)":"36568abe","revokeRole(bytes32,address)":"d547741f"}},"solidity/FastBridge.sol:IAdmin":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldChainGasAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newChainGasAmount","type":"uint256"}],"name":"ChainGasAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldFeeRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"FeeRateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeesSwept","type":"event"},{"inputs":[{"internalType":"uint256","name":"newChainGasAmount","type":"uint256"}],"name":"setChainGasAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeeRate","type":"uint256"}],"name":"setProtocolFeeRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"sweepProtocolFees","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldChainGasAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"ChainGasAmountUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldFeeRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"FeeRateUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"FeesSwept\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newChainGasAmount\",\"type\":\"uint256\"}],\"name\":\"setChainGasAmount\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFeeRate\",\"type\":\"uint256\"}],\"name\":\"setProtocolFeeRate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"sweepProtocolFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IAdmin\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"setChainGasAmount(uint256)":"b250fe6b","setProtocolFeeRate(uint256)":"b13aa2d6","sweepProtocolFees(address,address)":"06f333f2"}},"solidity/FastBridge.sol:IERC165":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.","kind":"dev","methods":{"supportsInterface(bytes4)":{"details":"Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC165 standard, as defined in the https://eips.ethereum.org/EIPS/eip-165[EIP]. Implementers can declare support of contract interfaces, which can then be queried by others ({ERC165Checker}). For an implementation, see {ERC165}.\",\"kind\":\"dev\",\"methods\":{\"supportsInterface(bytes4)\":{\"details\":\"Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created. This function call must use less than 30 000 gas.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IERC165\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"supportsInterface(bytes4)":"01ffc9a7"}},"solidity/FastBridge.sol:IERC20":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Interface of the ERC20 standard as defined in the EIP.","events":{"Approval(address,address,uint256)":{"details":"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."},"Transfer(address,address,uint256)":{"details":"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."}},"kind":"dev","methods":{"allowance(address,address)":{"details":"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called."},"approve(address,uint256)":{"details":"Sets a `value` amount of tokens as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event."},"balanceOf(address)":{"details":"Returns the value of tokens owned by `account`."},"totalSupply()":{"details":"Returns the value of tokens in existence."},"transfer(address,uint256)":{"details":"Moves a `value` amount of tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."},"transferFrom(address,address,uint256)":{"details":"Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. `value` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Approval\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"}],\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP.\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"Returns the remaining number of tokens that `spender` will be allowed to spend on behalf of `owner` through {transferFrom}. This is zero by default. This value changes when {approve} or {transferFrom} are called.\"},\"approve(address,uint256)\":{\"details\":\"Sets a `value` amount of tokens as the allowance of `spender` over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an {Approval} event.\"},\"balanceOf(address)\":{\"details\":\"Returns the value of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the value of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves a `value` amount of tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism. `value` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IERC20\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"allowance(address,address)":"dd62ed3e","approve(address,uint256)":"095ea7b3","balanceOf(address)":"70a08231","totalSupply()":"18160ddd","transfer(address,uint256)":"a9059cbb","transferFrom(address,address,uint256)":"23b872dd"}},"solidity/FastBridge.sol:IERC20Permit":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all. ==== Security Considerations There are two important considerations concerning the use of `permit`. The first is that a valid permit signature expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be considered as an intention to spend the allowance in any specific way. The second is that because permits have built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be generally recommended is: ```solidity function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} doThing(..., value); } function doThing(..., uint256 value) public { token.safeTransferFrom(msg.sender, address(this), value); ... } ``` Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also {SafeERC20-safeTransferFrom}). Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so contracts should have entry points that don't rely on permit.","kind":"dev","methods":{"DOMAIN_SEPARATOR()":{"details":"Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}."},"nonces(address)":{"details":"Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times."},"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)":{"details":"Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above."}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"permit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't need to send a transaction, and thus is not required to hold Ether at all. ==== Security Considerations There are two important considerations concerning the use of `permit`. The first is that a valid permit signature expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be considered as an intention to spend the allowance in any specific way. The second is that because permits have built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be generally recommended is: ```solidity function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {} doThing(..., value); } function doThing(..., uint256 value) public { token.safeTransferFrom(msg.sender, address(this), value); ... } ``` Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also {SafeERC20-safeTransferFrom}). Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so contracts should have entry points that don't rely on permit.\",\"kind\":\"dev\",\"methods\":{\"DOMAIN_SEPARATOR()\":{\"details\":\"Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\"},\"nonces(address)\":{\"details\":\"Returns the current nonce for `owner`. This value must be included whenever a signature is generated for {permit}. Every successful call to {permit} increases ``owner``'s nonce by one. This prevents a signature from being used multiple times.\"},\"permit(address,address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Sets `value` as the allowance of `spender` over ``owner``'s tokens, given ``owner``'s signed approval. IMPORTANT: The same issues {IERC20-approve} has related to transaction ordering also apply here. Emits an {Approval} event. Requirements: - `spender` cannot be the zero address. - `deadline` must be a timestamp in the future. - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` over the EIP712-formatted function arguments. - the signature must use ``owner``'s current nonce (see {nonces}). For more information on the signature format, see the https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP section]. CAUTION: See Security Considerations above.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IERC20Permit\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"DOMAIN_SEPARATOR()":"3644e515","nonces(address)":"7ecebe00","permit(address,address,uint256,uint256,uint8,bytes32,bytes32)":"d505accf"}},"solidity/FastBridge.sol:IFastBridge":{"code":"0x","runtime-code":"0x","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"","srcMapRuntime":"","abiDefinition":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BridgeDepositClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BridgeDepositRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"}],"name":"BridgeProofDisputed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":false,"internalType":"bytes32","name":"transactionHash","type":"bytes32"}],"name":"BridgeProofProvided","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"relayer","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint32","name":"originChainId","type":"uint32"},{"indexed":false,"internalType":"address","name":"originToken","type":"address"},{"indexed":false,"internalType":"address","name":"destToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"originAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"chainGasAmount","type":"uint256"}],"name":"BridgeRelayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"bytes","name":"request","type":"bytes"},{"indexed":false,"internalType":"uint32","name":"destChainId","type":"uint32"},{"indexed":false,"internalType":"address","name":"originToken","type":"address"},{"indexed":false,"internalType":"address","name":"destToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"originAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"destAmount","type":"uint256"},{"indexed":false,"internalType":"bool","name":"sendChainGas","type":"bool"}],"name":"BridgeRequested","type":"event"},{"inputs":[{"components":[{"internalType":"uint32","name":"dstChainId","type":"uint32"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"originToken","type":"address"},{"internalType":"address","name":"destToken","type":"address"},{"internalType":"uint256","name":"originAmount","type":"uint256"},{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"bool","name":"sendChainGas","type":"bool"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"internalType":"struct IFastBridge.BridgeParams","name":"params","type":"tuple"}],"name":"bridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"},{"internalType":"address","name":"relayer","type":"address"}],"name":"canClaim","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"},{"internalType":"address","name":"to","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"transactionId","type":"bytes32"}],"name":"dispute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"}],"name":"getBridgeTransaction","outputs":[{"components":[{"internalType":"uint32","name":"originChainId","type":"uint32"},{"internalType":"uint32","name":"destChainId","type":"uint32"},{"internalType":"address","name":"originSender","type":"address"},{"internalType":"address","name":"destRecipient","type":"address"},{"internalType":"address","name":"originToken","type":"address"},{"internalType":"address","name":"destToken","type":"address"},{"internalType":"uint256","name":"originAmount","type":"uint256"},{"internalType":"uint256","name":"destAmount","type":"uint256"},{"internalType":"uint256","name":"originFeeAmount","type":"uint256"},{"internalType":"bool","name":"sendChainGas","type":"bool"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct IFastBridge.BridgeTransaction","name":"","type":"tuple"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"},{"internalType":"bytes32","name":"destTxHash","type":"bytes32"}],"name":"prove","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"}],"name":"refund","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"request","type":"bytes"}],"name":"relay","outputs":[],"stateMutability":"payable","type":"function"}],"userDoc":{"kind":"user","methods":{"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))":{"notice":"Initiates bridge on origin chain to be relayed by off-chain relayer"},"canClaim(bytes32,address)":{"notice":"Checks if the dispute period has passed so bridge deposit can be claimed"},"claim(bytes,address)":{"notice":"Completes bridge transaction on origin chain by claiming originally deposited capital"},"dispute(bytes32)":{"notice":"Disputes an outstanding proof in case relayer provided dest chain tx is invalid"},"getBridgeTransaction(bytes)":{"notice":"Decodes bridge request into a bridge transaction"},"prove(bytes,bytes32)":{"notice":"Provides proof on origin side that relayer provided funds on destination side of bridge transaction"},"refund(bytes)":{"notice":"Refunds an outstanding bridge transaction in case optimistic bridging failed"},"relay(bytes)":{"notice":"Relays destination side of bridge transaction by off-chain relayer"}},"version":1},"developerDoc":{"kind":"dev","methods":{"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))":{"params":{"params":"The parameters required to bridge"}},"canClaim(bytes32,address)":{"params":{"relayer":"The address of the relayer attempting to claim","transactionId":"The transaction id associated with the encoded bridge transaction to check"}},"claim(bytes,address)":{"params":{"request":"The encoded bridge transaction to claim on origin chain","to":"The recipient address of the funds"}},"dispute(bytes32)":{"params":{"transactionId":"The transaction id associated with the encoded bridge transaction to dispute"}},"getBridgeTransaction(bytes)":{"params":{"request":"The bridge request to decode"}},"prove(bytes,bytes32)":{"params":{"destTxHash":"The destination tx hash proving bridge transaction was relayed","request":"The encoded bridge transaction to prove on origin chain"}},"refund(bytes)":{"params":{"request":"The encoded bridge transaction to refund"}},"relay(bytes)":{"params":{"request":"The encoded bridge transaction to relay on destination chain"}}},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"BridgeDepositRefunded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"BridgeProofDisputed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"transactionHash\",\"type\":\"bytes32\"}],\"name\":\"BridgeProofProvided\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"chainGasAmount\",\"type\":\"uint256\"}],\"name\":\"BridgeRelayed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"}],\"name\":\"BridgeRequested\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"dstChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"}],\"internalType\":\"struct IFastBridge.BridgeParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"bridge\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"relayer\",\"type\":\"address\"}],\"name\":\"canClaim\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"claim\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"transactionId\",\"type\":\"bytes32\"}],\"name\":\"dispute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"getBridgeTransaction\",\"outputs\":[{\"components\":[{\"internalType\":\"uint32\",\"name\":\"originChainId\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"destChainId\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"originSender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destRecipient\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"originToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"destToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"originAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"originFeeAmount\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"sendChainGas\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"internalType\":\"struct IFastBridge.BridgeTransaction\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"destTxHash\",\"type\":\"bytes32\"}],\"name\":\"prove\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"refund\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"request\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))\":{\"params\":{\"params\":\"The parameters required to bridge\"}},\"canClaim(bytes32,address)\":{\"params\":{\"relayer\":\"The address of the relayer attempting to claim\",\"transactionId\":\"The transaction id associated with the encoded bridge transaction to check\"}},\"claim(bytes,address)\":{\"params\":{\"request\":\"The encoded bridge transaction to claim on origin chain\",\"to\":\"The recipient address of the funds\"}},\"dispute(bytes32)\":{\"params\":{\"transactionId\":\"The transaction id associated with the encoded bridge transaction to dispute\"}},\"getBridgeTransaction(bytes)\":{\"params\":{\"request\":\"The bridge request to decode\"}},\"prove(bytes,bytes32)\":{\"params\":{\"destTxHash\":\"The destination tx hash proving bridge transaction was relayed\",\"request\":\"The encoded bridge transaction to prove on origin chain\"}},\"refund(bytes)\":{\"params\":{\"request\":\"The encoded bridge transaction to refund\"}},\"relay(bytes)\":{\"params\":{\"request\":\"The encoded bridge transaction to relay on destination chain\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))\":{\"notice\":\"Initiates bridge on origin chain to be relayed by off-chain relayer\"},\"canClaim(bytes32,address)\":{\"notice\":\"Checks if the dispute period has passed so bridge deposit can be claimed\"},\"claim(bytes,address)\":{\"notice\":\"Completes bridge transaction on origin chain by claiming originally deposited capital\"},\"dispute(bytes32)\":{\"notice\":\"Disputes an outstanding proof in case relayer provided dest chain tx is invalid\"},\"getBridgeTransaction(bytes)\":{\"notice\":\"Decodes bridge request into a bridge transaction\"},\"prove(bytes,bytes32)\":{\"notice\":\"Provides proof on origin side that relayer provided funds on destination side of bridge transaction\"},\"refund(bytes)\":{\"notice\":\"Refunds an outstanding bridge transaction in case optimistic bridging failed\"},\"relay(bytes)\":{\"notice\":\"Relays destination side of bridge transaction by off-chain relayer\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"IFastBridge\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{"bridge((uint32,address,address,address,address,uint256,uint256,bool,uint256))":"45851694","canClaim(bytes32,address)":"aa9641ab","claim(bytes,address)":"41fcb612","dispute(bytes32)":"add98c70","getBridgeTransaction(bytes)":"ac11fb1a","prove(bytes,bytes32)":"886d36ff","refund(bytes)":"5eb7d946","relay(bytes)":"8f0d6f17"}},"solidity/FastBridge.sol:SafeERC20":{"code":"0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220666e86cec9574f32fc5a03b62558b15e14d370d438ddcd50d491395202b88bd664736f6c63430008140033","runtime-code":"0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220666e86cec9574f32fc5a03b62558b15e14d370d438ddcd50d491395202b88bd664736f6c63430008140033","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"39257:5018:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;39257:5018:0;;;;;;;;;;;;;;;;;","srcMapRuntime":"39257:5018:0:-:0;;;;;;;;","abiDefinition":[{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"currentAllowance","type":"uint256"},{"internalType":"uint256","name":"requestedDecrease","type":"uint256"}],"name":"SafeERC20FailedDecreaseAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"SafeERC20FailedOperation","type":"error"}],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"details":"Wrappers around ERC20 operations that throw on failure (when the token contract returns false). Tokens that return no value (and instead revert or throw on failure) are also supported, non-reverting calls are assumed to be successful. To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, which allows you to call the safe operations as `token.safeTransfer(...)`, etc.","errors":{"SafeERC20FailedDecreaseAllowance(address,uint256,uint256)":[{"details":"Indicates a failed `decreaseAllowance` request."}],"SafeERC20FailedOperation(address)":[{"details":"An operation with an ERC20 token failed."}]},"kind":"dev","methods":{},"title":"SafeERC20","version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentAllowance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"requestedDecrease\",\"type\":\"uint256\"}],\"name\":\"SafeERC20FailedDecreaseAllowance\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"}],\"name\":\"SafeERC20FailedOperation\",\"type\":\"error\"}],\"devdoc\":{\"details\":\"Wrappers around ERC20 operations that throw on failure (when the token contract returns false). Tokens that return no value (and instead revert or throw on failure) are also supported, non-reverting calls are assumed to be successful. To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\",\"errors\":{\"SafeERC20FailedDecreaseAllowance(address,uint256,uint256)\":[{\"details\":\"Indicates a failed `decreaseAllowance` request.\"}],\"SafeERC20FailedOperation(address)\":[{\"details\":\"An operation with an ERC20 token failed.\"}]},\"kind\":\"dev\",\"methods\":{},\"title\":\"SafeERC20\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"SafeERC20\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{}},"solidity/FastBridge.sol:UniversalTokenLib":{"code":"0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e4e2d25d1ecf953d0c56b6c7466118f3a795674cafbd14e67cc1d0633ea190a764736f6c63430008140033","runtime-code":"0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220e4e2d25d1ecf953d0c56b6c7466118f3a795674cafbd14e67cc1d0633ea190a764736f6c63430008140033","info":{"source":"// SPDX-License-Identifier: MIT\npragma solidity =0.8.20 ^0.8.0 ^0.8.20;\n\n// contracts/interfaces/IAdmin.sol\n\ninterface IAdmin {\n // ============ Events ============\n\n event FeeRateUpdated(uint256 oldFeeRate, uint256 newFeeRate);\n event FeesSwept(address token, address recipient, uint256 amount);\n\n event ChainGasAmountUpdated(uint256 oldChainGasAmount, uint256 newChainGasAmount);\n\n // ============ Methods ============\n\n function setProtocolFeeRate(uint256 newFeeRate) external;\n\n function sweepProtocolFees(address token, address recipient) external;\n\n function setChainGasAmount(uint256 newChainGasAmount) external;\n}\n\n// contracts/interfaces/IFastBridge.sol\n\ninterface IFastBridge {\n struct BridgeTransaction {\n uint32 originChainId;\n uint32 destChainId;\n address originSender; // user (origin)\n address destRecipient; // user (dest)\n address originToken;\n address destToken;\n uint256 originAmount; // amount in on origin bridge less originFeeAmount\n uint256 destAmount;\n uint256 originFeeAmount;\n bool sendChainGas;\n uint256 deadline; // user specified deadline for destination relay\n uint256 nonce;\n }\n\n struct BridgeProof {\n uint96 timestamp;\n address relayer;\n }\n\n // ============ Events ============\n\n event BridgeRequested(\n bytes32 indexed transactionId,\n address indexed sender,\n bytes request,\n uint32 destChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n bool sendChainGas\n );\n event BridgeRelayed(\n bytes32 indexed transactionId,\n address indexed relayer,\n address indexed to,\n uint32 originChainId,\n address originToken,\n address destToken,\n uint256 originAmount,\n uint256 destAmount,\n uint256 chainGasAmount\n );\n event BridgeProofProvided(bytes32 indexed transactionId, address indexed relayer, bytes32 transactionHash);\n event BridgeProofDisputed(bytes32 indexed transactionId, address indexed relayer);\n event BridgeDepositClaimed(\n bytes32 indexed transactionId, address indexed relayer, address indexed to, address token, uint256 amount\n );\n event BridgeDepositRefunded(bytes32 indexed transactionId, address indexed to, address token, uint256 amount);\n\n // ============ Methods ============\n\n struct BridgeParams {\n uint32 dstChainId;\n address sender;\n address to;\n address originToken;\n address destToken;\n uint256 originAmount; // should include protocol fee (if any)\n uint256 destAmount; // should include relayer fee\n bool sendChainGas;\n uint256 deadline;\n }\n\n /// @notice Initiates bridge on origin chain to be relayed by off-chain relayer\n /// @param params The parameters required to bridge\n function bridge(BridgeParams memory params) external payable;\n\n /// @notice Relays destination side of bridge transaction by off-chain relayer\n /// @param request The encoded bridge transaction to relay on destination chain\n function relay(bytes memory request) external payable;\n\n /// @notice Provides proof on origin side that relayer provided funds on destination side of bridge transaction\n /// @param request The encoded bridge transaction to prove on origin chain\n /// @param destTxHash The destination tx hash proving bridge transaction was relayed\n function prove(bytes memory request, bytes32 destTxHash) external;\n\n /// @notice Completes bridge transaction on origin chain by claiming originally deposited capital\n /// @param request The encoded bridge transaction to claim on origin chain\n /// @param to The recipient address of the funds\n function claim(bytes memory request, address to) external;\n\n /// @notice Disputes an outstanding proof in case relayer provided dest chain tx is invalid\n /// @param transactionId The transaction id associated with the encoded bridge transaction to dispute\n function dispute(bytes32 transactionId) external;\n\n /// @notice Refunds an outstanding bridge transaction in case optimistic bridging failed\n /// @param request The encoded bridge transaction to refund\n function refund(bytes memory request) external;\n\n // ============ Views ============\n\n /// @notice Decodes bridge request into a bridge transaction\n /// @param request The bridge request to decode\n function getBridgeTransaction(bytes memory request) external pure returns (BridgeTransaction memory);\n\n /// @notice Checks if the dispute period has passed so bridge deposit can be claimed\n /// @param transactionId The transaction id associated with the encoded bridge transaction to check\n /// @param relayer The address of the relayer attempting to claim\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool);\n}\n\n// contracts/libs/Errors.sol\n\nerror DeadlineExceeded();\nerror DeadlineNotExceeded();\nerror DeadlineTooShort();\nerror InsufficientOutputAmount();\n\nerror MsgValueIncorrect();\nerror PoolNotFound();\nerror TokenAddressMismatch();\nerror TokenNotContract();\nerror TokenNotETH();\nerror TokensIdentical();\n\nerror ChainIncorrect();\nerror AmountIncorrect();\nerror ZeroAddress();\n\nerror DisputePeriodNotPassed();\nerror DisputePeriodPassed();\nerror SenderIncorrect();\nerror StatusIncorrect();\nerror TransactionIdIncorrect();\nerror TransactionRelayed();\n\n// node_modules/@openzeppelin/contracts/access/IAccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the value of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the value of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves a `value` amount of tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 value) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets a `value` amount of tokens as the allowance of `spender` over the\n * caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 value) external returns (bool);\n\n /**\n * @dev Moves a `value` amount of tokens from `from` to `to` using the\n * allowance mechanism. `value` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 value) external returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n *\n * ==== Security Considerations\n *\n * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature\n * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be\n * considered as an intention to spend the allowance in any specific way. The second is that because permits have\n * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should\n * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be\n * generally recommended is:\n *\n * ```solidity\n * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {\n * try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}\n * doThing(..., value);\n * }\n *\n * function doThing(..., uint256 value) public {\n * token.safeTransferFrom(msg.sender, address(this), value);\n * ...\n * }\n * ```\n *\n * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of\n * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also\n * {SafeERC20-safeTransferFrom}).\n *\n * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so\n * contracts should have entry points that don't rely on permit.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n *\n * CAUTION: See Security Considerations above.\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n\n// node_modules/@openzeppelin/contracts/utils/Address.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error AddressInsufficientBalance(address account);\n\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedInnerCall();\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance \u003c amount) {\n revert AddressInsufficientBalance(address(this));\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert FailedInnerCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {FailedInnerCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance \u003c value) {\n revert AddressInsufficientBalance(address(this));\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an\n * unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 \u0026\u0026 target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {FailedInnerCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length \u003e 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert FailedInnerCall();\n }\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/Context.sol\n\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n\n// node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position is the index of the value in the `values` array plus 1.\n // Position 0 is used to mean a value is not in the set.\n mapping(bytes32 value =\u003e uint256) _positions;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._positions[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We cache the value's position to prevent multiple reads from the same storage slot\n uint256 position = set._positions[value];\n\n if (position != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 valueIndex = position - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (valueIndex != lastIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the lastValue to the index where the value to delete is\n set._values[valueIndex] = lastValue;\n // Update the tracked position of the lastValue (that was just moved)\n set._positions[lastValue] = position;\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the tracked position for the deleted slot\n delete set._positions[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._positions[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/IAccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/IAccessControlEnumerable.sol)\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n\n// node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n\n// node_modules/@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev An operation with an ERC20 token failed.\n */\n error SafeERC20FailedOperation(address token);\n\n /**\n * @dev Indicates a failed `decreaseAllowance` request.\n */\n error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));\n }\n\n /**\n * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n forceApprove(token, spender, oldAllowance + value);\n }\n\n /**\n * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no\n * value, non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {\n unchecked {\n uint256 currentAllowance = token.allowance(address(this), spender);\n if (currentAllowance \u003c requestedDecrease) {\n revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);\n }\n forceApprove(token, spender, currentAllowance - requestedDecrease);\n }\n }\n\n /**\n * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data);\n if (returndata.length != 0 \u0026\u0026 !abi.decode(returndata, (bool))) {\n revert SafeERC20FailedOperation(address(token));\n }\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return success \u0026\u0026 (returndata.length == 0 || abi.decode(returndata, (bool))) \u0026\u0026 address(token).code.length \u003e 0;\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/AccessControl.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account =\u003e bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role =\u003e RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n\n// contracts/libs/UniversalToken.sol\n\nlibrary UniversalTokenLib {\n using SafeERC20 for IERC20;\n\n address internal constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\n\n /// @notice Transfers tokens to the given account. Reverts if transfer is not successful.\n /// @dev This might trigger fallback, if ETH is transferred to the contract.\n /// Make sure this can not lead to reentrancy attacks.\n function universalTransfer(address token, address to, uint256 value) internal {\n // Don't do anything, if need to send tokens to this address\n if (to == address(this)) return;\n // Don't do anything, if trying to send zero value\n if (value == 0) return;\n if (token == ETH_ADDRESS) {\n /// @dev Note: this can potentially lead to executing code in `to`.\n // solhint-disable-next-line avoid-low-level-calls\n (bool success,) = to.call{value: value}(\"\");\n require(success, \"ETH transfer failed\");\n } else {\n IERC20(token).safeTransfer(to, value);\n }\n }\n\n /// @notice Issues an infinite allowance to the spender, if the current allowance is insufficient\n /// to spend the given amount.\n function universalApproveInfinity(address token, address spender, uint256 amountToSpend) internal {\n // ETH Chad doesn't require your approval\n if (token == ETH_ADDRESS) return;\n // No-op if allowance is already sufficient\n uint256 allowance = IERC20(token).allowance(address(this), spender);\n if (allowance \u003e= amountToSpend) return;\n // Otherwise, reset approval to 0 and set to max allowance\n if (allowance \u003e 0) IERC20(token).safeDecreaseAllowance(spender, allowance);\n IERC20(token).safeIncreaseAllowance(spender, type(uint256).max);\n }\n\n /// @notice Returns the balance of the given token (or native ETH) for the given account.\n function universalBalanceOf(address token, address account) internal view returns (uint256) {\n if (token == ETH_ADDRESS) {\n return account.balance;\n } else {\n return IERC20(token).balanceOf(account);\n }\n }\n\n /// @dev Checks that token is a contract and not ETH_ADDRESS.\n function assertIsContract(address token) internal view {\n // Check that ETH_ADDRESS was not used (in case this is a predeploy on any of the chains)\n if (token == UniversalTokenLib.ETH_ADDRESS) revert TokenNotContract();\n // Check that token is not an EOA\n if (token.code.length == 0) revert TokenNotContract();\n }\n}\n\n// node_modules/@openzeppelin/contracts/access/extensions/AccessControlEnumerable.sol\n\n// OpenZeppelin Contracts (last updated v5.0.0) (access/extensions/AccessControlEnumerable.sol)\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 role =\u003e EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {AccessControl-_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool granted = super._grantRole(role, account);\n if (granted) {\n _roleMembers[role].add(account);\n }\n return granted;\n }\n\n /**\n * @dev Overload {AccessControl-_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override returns (bool) {\n bool revoked = super._revokeRole(role, account);\n if (revoked) {\n _roleMembers[role].remove(account);\n }\n return revoked;\n }\n}\n\n// contracts/Admin.sol\n\ncontract Admin is IAdmin, AccessControlEnumerable {\n using UniversalTokenLib for address;\n\n bytes32 public constant RELAYER_ROLE = keccak256(\"RELAYER_ROLE\");\n bytes32 public constant REFUNDER_ROLE = keccak256(\"REFUNDER_ROLE\");\n bytes32 public constant GUARD_ROLE = keccak256(\"GUARD_ROLE\");\n bytes32 public constant GOVERNOR_ROLE = keccak256(\"GOVERNOR_ROLE\");\n\n uint256 public constant FEE_BPS = 1e6;\n uint256 public constant FEE_RATE_MAX = 0.01e6; // max 1% on origin amount\n\n /// @notice Protocol fee rate taken on origin amount deposited in origin chain\n uint256 public protocolFeeRate;\n\n /// @notice Protocol fee amounts accumulated\n mapping(address =\u003e uint256) public protocolFees;\n\n /// @notice Chain gas amount to forward as rebate if requested\n uint256 public chainGasAmount;\n\n constructor(address _owner) {\n _grantRole(DEFAULT_ADMIN_ROLE, _owner);\n }\n\n function setProtocolFeeRate(uint256 newFeeRate) external onlyRole(GOVERNOR_ROLE) {\n require(newFeeRate \u003c= FEE_RATE_MAX, \"newFeeRate \u003e max\");\n uint256 oldFeeRate = protocolFeeRate;\n protocolFeeRate = newFeeRate;\n emit FeeRateUpdated(oldFeeRate, newFeeRate);\n }\n\n function sweepProtocolFees(address token, address recipient) external onlyRole(GOVERNOR_ROLE) {\n uint256 feeAmount = protocolFees[token];\n if (feeAmount == 0) return; // skip if no accumulated fees\n\n protocolFees[token] = 0;\n token.universalTransfer(recipient, feeAmount);\n emit FeesSwept(token, recipient, feeAmount);\n }\n\n function setChainGasAmount(uint256 newChainGasAmount) external onlyRole(GOVERNOR_ROLE) {\n uint256 oldChainGasAmount = chainGasAmount;\n chainGasAmount = newChainGasAmount;\n emit ChainGasAmountUpdated(oldChainGasAmount, newChainGasAmount);\n }\n}\n\n// contracts/FastBridge.sol\n\ncontract FastBridge is IFastBridge, Admin {\n using SafeERC20 for IERC20;\n using UniversalTokenLib for address;\n\n /// @notice Dispute period for relayed transactions\n uint256 public constant DISPUTE_PERIOD = 30 minutes;\n\n /// @notice Delay for a transaction after which it could be permisionlessly refunded\n uint256 public constant REFUND_DELAY = 7 days;\n\n /// @notice Minimum deadline period to relay a requested bridge transaction\n uint256 public constant MIN_DEADLINE_PERIOD = 30 minutes;\n\n enum BridgeStatus {\n NULL, // doesn't exist yet\n REQUESTED,\n RELAYER_PROVED,\n RELAYER_CLAIMED,\n REFUNDED\n }\n\n /// @notice Status of the bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeStatus) public bridgeStatuses;\n /// @notice Proof of relayed bridge tx on origin chain\n mapping(bytes32 =\u003e BridgeProof) public bridgeProofs;\n /// @notice Whether bridge has been relayed on destination chain\n mapping(bytes32 =\u003e bool) public bridgeRelays;\n\n /// @dev to prevent replays\n uint256 public nonce;\n // @dev the block the contract was deployed at\n uint256 public immutable deployBlock;\n\n constructor(address _owner) Admin(_owner) {\n deployBlock = block.number;\n }\n\n /// @notice Pulls a requested token from the user to the requested recipient.\n /// @dev Be careful of re-entrancy issues when msg.value \u003e 0 and recipient != address(this)\n function _pullToken(address recipient, address token, uint256 amount) internal returns (uint256 amountPulled) {\n if (token != UniversalTokenLib.ETH_ADDRESS) {\n token.assertIsContract();\n // Record token balance before transfer\n amountPulled = IERC20(token).balanceOf(recipient);\n // Token needs to be pulled only if msg.value is zero\n // This way user can specify WETH as the origin asset\n IERC20(token).safeTransferFrom(msg.sender, recipient, amount);\n // Use the difference between the recorded balance and the current balance as the amountPulled\n amountPulled = IERC20(token).balanceOf(recipient) - amountPulled;\n } else {\n // Otherwise, we need to check that ETH amount matches msg.value\n if (amount != msg.value) revert MsgValueIncorrect();\n // Transfer value to recipient if not this address\n if (recipient != address(this)) token.universalTransfer(recipient, amount);\n // We will forward msg.value in the external call later, if recipient is not this contract\n amountPulled = msg.value;\n }\n }\n\n /// @inheritdoc IFastBridge\n function getBridgeTransaction(bytes memory request) public pure returns (BridgeTransaction memory) {\n return abi.decode(request, (BridgeTransaction));\n }\n\n /// @inheritdoc IFastBridge\n function bridge(BridgeParams memory params) external payable {\n // check bridge params\n if (params.dstChainId == block.chainid) revert ChainIncorrect();\n if (params.originAmount == 0 || params.destAmount == 0) revert AmountIncorrect();\n if (params.originToken == address(0) || params.destToken == address(0)) revert ZeroAddress();\n if (params.deadline \u003c block.timestamp + MIN_DEADLINE_PERIOD) revert DeadlineTooShort();\n\n // transfer tokens to bridge contract\n // @dev use returned originAmount in request in case of transfer fees\n uint256 originAmount = _pullToken(address(this), params.originToken, params.originAmount);\n\n // track amount of origin token owed to protocol\n uint256 originFeeAmount;\n if (protocolFeeRate \u003e 0) originFeeAmount = (originAmount * protocolFeeRate) / FEE_BPS;\n originAmount -= originFeeAmount; // remove from amount used in request as not relevant for relayers\n\n // set status to requested\n bytes memory request = abi.encode(\n BridgeTransaction({\n originChainId: uint32(block.chainid),\n destChainId: params.dstChainId,\n originSender: params.sender,\n destRecipient: params.to,\n originToken: params.originToken,\n destToken: params.destToken,\n originAmount: originAmount,\n destAmount: params.destAmount,\n originFeeAmount: originFeeAmount,\n sendChainGas: params.sendChainGas,\n deadline: params.deadline,\n nonce: nonce++ // increment nonce on every bridge\n })\n );\n bytes32 transactionId = keccak256(request);\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n\n emit BridgeRequested(\n transactionId,\n params.sender,\n request,\n params.dstChainId,\n params.originToken,\n params.destToken,\n originAmount,\n params.destAmount,\n params.sendChainGas\n );\n }\n\n /// @inheritdoc IFastBridge\n function relay(bytes memory request) external payable onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n if (transaction.destChainId != uint32(block.chainid)) revert ChainIncorrect();\n\n // check haven't exceeded deadline for relay to happen\n if (block.timestamp \u003e transaction.deadline) revert DeadlineExceeded();\n\n // mark bridge transaction as relayed\n if (bridgeRelays[transactionId]) revert TransactionRelayed();\n bridgeRelays[transactionId] = true;\n\n // transfer tokens to recipient on destination chain and gas rebate if requested\n address to = transaction.destRecipient;\n address token = transaction.destToken;\n uint256 amount = transaction.destAmount;\n\n uint256 rebate = chainGasAmount;\n if (!transaction.sendChainGas) {\n // forward erc20\n rebate = 0;\n _pullToken(to, token, amount);\n } else if (token == UniversalTokenLib.ETH_ADDRESS) {\n // lump in gas rebate into amount in native gas token\n _pullToken(to, token, amount + rebate);\n } else {\n // forward erc20 then forward gas rebate in native gas token\n _pullToken(to, token, amount);\n _pullToken(to, UniversalTokenLib.ETH_ADDRESS, rebate);\n }\n\n emit BridgeRelayed(\n transactionId,\n msg.sender,\n to,\n transaction.originChainId,\n transaction.originToken,\n transaction.destToken,\n transaction.originAmount,\n transaction.destAmount,\n rebate\n );\n }\n\n /// @inheritdoc IFastBridge\n function prove(bytes memory request, bytes32 destTxHash) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n // update bridge tx status given proof provided\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_PROVED;\n bridgeProofs[transactionId] = BridgeProof({timestamp: uint96(block.timestamp), relayer: msg.sender}); // overflow ok\n\n emit BridgeProofProvided(transactionId, msg.sender, destTxHash);\n }\n\n /// @notice Calculates time since proof submitted\n /// @dev proof.timestamp stores casted uint96(block.timestamp) block timestamps for gas optimization\n /// _timeSince(proof) can accomodate rollover case when block.timestamp \u003e type(uint96).max but\n /// proof.timestamp \u003c type(uint96).max via unchecked statement\n /// @param proof The bridge proof\n /// @return delta Time delta since proof submitted\n function _timeSince(BridgeProof memory proof) internal view returns (uint256 delta) {\n unchecked {\n delta = uint96(block.timestamp) - proof.timestamp;\n }\n }\n\n /// @inheritdoc IFastBridge\n function canClaim(bytes32 transactionId, address relayer) external view returns (bool) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != relayer) revert SenderIncorrect();\n return _timeSince(proof) \u003e DISPUTE_PERIOD;\n }\n\n /// @inheritdoc IFastBridge\n function claim(bytes memory request, address to) external onlyRole(RELAYER_ROLE) {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n // update bridge tx status if able to claim origin collateral\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n\n BridgeProof memory proof = bridgeProofs[transactionId];\n if (proof.relayer != msg.sender) revert SenderIncorrect();\n if (_timeSince(proof) \u003c= DISPUTE_PERIOD) revert DisputePeriodNotPassed();\n\n bridgeStatuses[transactionId] = BridgeStatus.RELAYER_CLAIMED;\n\n // update protocol fees if origin fee amount exists\n if (transaction.originFeeAmount \u003e 0) protocolFees[transaction.originToken] += transaction.originFeeAmount;\n\n // transfer origin collateral less fee to specified address\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositClaimed(transactionId, msg.sender, to, token, amount);\n }\n\n /// @inheritdoc IFastBridge\n function dispute(bytes32 transactionId) external onlyRole(GUARD_ROLE) {\n if (bridgeStatuses[transactionId] != BridgeStatus.RELAYER_PROVED) revert StatusIncorrect();\n if (_timeSince(bridgeProofs[transactionId]) \u003e DISPUTE_PERIOD) revert DisputePeriodPassed();\n\n // @dev relayer gets slashed effectively if dest relay has gone thru\n bridgeStatuses[transactionId] = BridgeStatus.REQUESTED;\n delete bridgeProofs[transactionId];\n\n emit BridgeProofDisputed(transactionId, msg.sender);\n }\n\n /// @inheritdoc IFastBridge\n function refund(bytes memory request) external {\n bytes32 transactionId = keccak256(request);\n BridgeTransaction memory transaction = getBridgeTransaction(request);\n\n if (hasRole(REFUNDER_ROLE, msg.sender)) {\n // Refunder can refund if deadline has passed\n if (block.timestamp \u003c= transaction.deadline) revert DeadlineNotExceeded();\n } else {\n // Permissionless refund is allowed after REFUND_DELAY\n if (block.timestamp \u003c= transaction.deadline + REFUND_DELAY) revert DeadlineNotExceeded();\n }\n\n // set status to refunded if still in requested state\n if (bridgeStatuses[transactionId] != BridgeStatus.REQUESTED) revert StatusIncorrect();\n bridgeStatuses[transactionId] = BridgeStatus.REFUNDED;\n\n // transfer origin collateral back to original sender\n address to = transaction.originSender;\n address token = transaction.originToken;\n uint256 amount = transaction.originAmount + transaction.originFeeAmount;\n token.universalTransfer(to, amount);\n\n emit BridgeDepositRefunded(transactionId, to, token, amount);\n }\n}\n","language":"Solidity","languageVersion":"0.8.20","compilerVersion":"0.8.20","compilerOptions":"--combined-json bin,bin-runtime,srcmap,srcmap-runtime,abi,userdoc,devdoc,metadata,hashes --optimize --optimize-runs 10000 --allow-paths ., ./, ../ --evm-version=istanbul","srcMap":"51216:2551:0:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;51216:2551:0;;;;;;;;;;;;;;;;;","srcMapRuntime":"51216:2551:0:-:0;;;;;;;;","abiDefinition":[],"userDoc":{"kind":"user","methods":{},"version":1},"developerDoc":{"kind":"dev","methods":{},"version":1},"metadata":"{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"solidity/FastBridge.sol\":\"UniversalTokenLib\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"solidity/FastBridge.sol\":{\"keccak256\":\"0xae743277f3eb2d2ec8189b107f86be1274c339a5e25efd78e2513a1adfb904cf\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://2adf46956fa5eb58f2073d4a611632ccc208ba24ea99e0a0e224cdce7b79b135\",\"dweb:/ipfs/QmU3RGCG6sstiJ4HUPg5RP7gNds74eBn7YMSCqQfRG8Cpb\"]}},\"version\":1}"},"hashes":{}}} \ No newline at end of file diff --git a/services/rfq/contracts/fastbridge/fastbridge.metadata.go b/services/rfq/contracts/fastbridge/fastbridge.metadata.go deleted file mode 100644 index 3f1f36e8ab..0000000000 --- a/services/rfq/contracts/fastbridge/fastbridge.metadata.go +++ /dev/null @@ -1,25 +0,0 @@ -// Code generated by synapse abigen DO NOT EDIT. -package fastbridge - -import ( - _ "embed" - "encoding/json" - "github.com/ethereum/go-ethereum/common/compiler" -) - -// rawContracts are the json we use to derive the processed contracts -// -//go:embed fastbridge.contractinfo.json -var rawContracts []byte - -// Contracts are unmarshalled on start -var Contracts map[string]*compiler.Contract - -func init() { - // load contract metadata - var err error - err = json.Unmarshal(rawContracts, &Contracts) - if err != nil { - panic(err) - } -} diff --git a/services/rfq/contracts/fastbridgemulti/fastbridgemulti.abigen.go b/services/rfq/contracts/fastbridge/fastbridgemulti.abigen.go similarity index 100% rename from services/rfq/contracts/fastbridgemulti/fastbridgemulti.abigen.go rename to services/rfq/contracts/fastbridge/fastbridgemulti.abigen.go diff --git a/services/rfq/contracts/fastbridgemulti/fastbridgemulti.contractinfo.json b/services/rfq/contracts/fastbridge/fastbridgemulti.contractinfo.json similarity index 100% rename from services/rfq/contracts/fastbridgemulti/fastbridgemulti.contractinfo.json rename to services/rfq/contracts/fastbridge/fastbridgemulti.contractinfo.json diff --git a/services/rfq/contracts/fastbridgemulti/fastbridgemulti.metadata.go b/services/rfq/contracts/fastbridge/fastbridgemulti.metadata.go similarity index 100% rename from services/rfq/contracts/fastbridgemulti/fastbridgemulti.metadata.go rename to services/rfq/contracts/fastbridge/fastbridgemulti.metadata.go diff --git a/services/rfq/contracts/fastbridge/generate.go b/services/rfq/contracts/fastbridge/generate.go index 51f3115058..30b1b3e1d3 100644 --- a/services/rfq/contracts/fastbridge/generate.go +++ b/services/rfq/contracts/fastbridge/generate.go @@ -1,3 +1,3 @@ -package fastbridge +package fastbridgemulti -//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../packages/contracts-rfq/flattened/FastBridge.sol --pkg fastbridge --sol-version 0.8.20 --filename fastbridge --evm-version istanbul +//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../packages/contracts-rfq/flattened/FastBridge.sol --pkg fastbridgemulti --sol-version 0.8.20 --filename fastbridgemulti --evm-version istanbul diff --git a/services/rfq/contracts/fastbridge/helper.go b/services/rfq/contracts/fastbridge/helper.go index 4b00f3e9c8..7513a724b8 100644 --- a/services/rfq/contracts/fastbridge/helper.go +++ b/services/rfq/contracts/fastbridge/helper.go @@ -1,4 +1,4 @@ -package fastbridge +package fastbridgemulti import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" diff --git a/services/rfq/contracts/fastbridge/parser.go b/services/rfq/contracts/fastbridge/parser.go index 29faa55352..afb317b697 100644 --- a/services/rfq/contracts/fastbridge/parser.go +++ b/services/rfq/contracts/fastbridge/parser.go @@ -1,7 +1,8 @@ -package fastbridge +package fastbridgemulti import ( "fmt" + "github.com/ethereum/go-ethereum/common" ethTypes "github.com/ethereum/go-ethereum/core/types" ) diff --git a/services/rfq/contracts/fastbridge/status.go b/services/rfq/contracts/fastbridge/status.go index 1a8b9605fc..e5f21af332 100644 --- a/services/rfq/contracts/fastbridge/status.go +++ b/services/rfq/contracts/fastbridge/status.go @@ -1,4 +1,4 @@ -package fastbridge +package fastbridgemulti // BridgeStatus is an enum for the on-chain status of a request // diff --git a/services/rfq/contracts/fastbridge/status_test.go b/services/rfq/contracts/fastbridge/status_test.go index 3028e6d245..0473d5a58f 100644 --- a/services/rfq/contracts/fastbridge/status_test.go +++ b/services/rfq/contracts/fastbridge/status_test.go @@ -1,15 +1,16 @@ -package fastbridge_test +package fastbridgemulti_test import ( + "math/big" + "testing" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/stretchr/testify/suite" "github.com/synapsecns/sanguine/core/testsuite" "github.com/synapsecns/sanguine/ethergo/backends" "github.com/synapsecns/sanguine/ethergo/backends/simulated" - "github.com/synapsecns/sanguine/services/rfq/contracts/fastbridge" + "github.com/synapsecns/sanguine/services/rfq/contracts/fastbridgemulti" "github.com/synapsecns/sanguine/services/rfq/testutil" - "math/big" - "testing" ) // FastBridgeSuite tests the basic test suite. @@ -40,7 +41,7 @@ func (s *FastBridgeSuite) SetupTest() { // TestStatusEnum makes sure. func (s *FastBridgeSuite) TestStatusEnum() { _, fb := s.manager.GetMockFastBridge(s.GetTestContext(), s.backend) - for _, status := range fastbridge.GetAllBridgeStatuses() { + for _, status := range fastbridgemulti.GetAllBridgeStatuses() { solstatus, err := fb.GetEnumKeyByValue(&bind.CallOpts{Context: s.GetTestContext()}, status.Int()) s.Require().NoError(err, "error getting enum key by value") s.Require().Equal(solstatus, status.String(), "status %s does not match. BridgeStatus enums out of sync.", status) diff --git a/services/rfq/contracts/fastbridgemulti/bridgestatus_string.go b/services/rfq/contracts/fastbridgemulti/bridgestatus_string.go deleted file mode 100644 index f9ddbd0998..0000000000 --- a/services/rfq/contracts/fastbridgemulti/bridgestatus_string.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by "stringer -type=BridgeStatus -linecomment"; DO NOT EDIT. - -package fastbridgemulti - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[NULL-0] - _ = x[REQUESTED-1] - _ = x[RelayerProved-2] - _ = x[RelayerClaimed-3] - _ = x[REFUNDED-4] -} - -const _BridgeStatus_name = "NULLREQUESTEDRELAYER_PROVEDRELAYER_CLAIMEDREFUNDED" - -var _BridgeStatus_index = [...]uint8{0, 4, 13, 27, 42, 50} - -func (i BridgeStatus) String() string { - if i >= BridgeStatus(len(_BridgeStatus_index)-1) { - return "BridgeStatus(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _BridgeStatus_name[_BridgeStatus_index[i]:_BridgeStatus_index[i+1]] -} diff --git a/services/rfq/contracts/fastbridgemulti/events.go b/services/rfq/contracts/fastbridgemulti/events.go deleted file mode 100644 index 6a2d840493..0000000000 --- a/services/rfq/contracts/fastbridgemulti/events.go +++ /dev/null @@ -1,82 +0,0 @@ -package fastbridgemulti - -import ( - "bytes" - "strings" - - "github.com/ethereum/go-ethereum/accounts/abi" - "github.com/ethereum/go-ethereum/common" -) - -// TODO: consider not exporting to avoid accidental mutation. -var ( - // BridgeRequestedTopic is the event topic for a bridge request. - BridgeRequestedTopic common.Hash - // BridgeRelayedTopic is the topic emitted by a bridge relay. - BridgeRelayedTopic common.Hash - // BridgeProofProvidedTopic is the topic emitted by a bridge relay. - BridgeProofProvidedTopic common.Hash - // BridgeDepositClaimedTopic is the topic emitted by a bridge relay. - BridgeDepositClaimedTopic common.Hash - // BridgeProofDisputedTopic is the topic emitted by a bridge dispute. - BridgeProofDisputedTopic common.Hash -) - -// static checks to make sure topics actually exist. -func init() { - var err error - - parsedABI, err := abi.JSON(strings.NewReader(FastBridgeMetaData.ABI)) - if err != nil { - panic(err) - } - - BridgeRequestedTopic = parsedABI.Events["BridgeRequested"].ID - BridgeRelayedTopic = parsedABI.Events["BridgeRelayed"].ID - BridgeProofProvidedTopic = parsedABI.Events["BridgeProofProvided"].ID - BridgeDepositClaimedTopic = parsedABI.Events["BridgeDepositClaimed"].ID - BridgeProofDisputedTopic = parsedABI.Events["BridgeProofDisputed"].ID - - _, err = parsedABI.EventByID(BridgeRequestedTopic) - if err != nil { - panic(err) - } - - _, err = parsedABI.EventByID(BridgeRelayedTopic) - if err != nil { - panic(err) - } - - _, err = parsedABI.EventByID(BridgeProofProvidedTopic) - if err != nil { - panic(err) - } - - _, err = parsedABI.EventByID(BridgeProofDisputedTopic) - if err != nil { - panic(err) - } -} - -// topicMap maps events to topics. -// this is returned as a function to assert immutability. -func topicMap() map[EventType]common.Hash { - return map[EventType]common.Hash{ - BridgeRequestedEvent: BridgeRequestedTopic, - BridgeRelayedEvent: BridgeRelayedTopic, - BridgeProofProvidedEvent: BridgeProofProvidedTopic, - BridgeDepositClaimedEvent: BridgeDepositClaimedTopic, - BridgeDisputeEvent: BridgeProofDisputedTopic, - } -} - -// eventTypeFromTopic gets the event type from the topic -// returns nil if the topic is not found. -func eventTypeFromTopic(ogTopic common.Hash) *EventType { - for eventType, topic := range topicMap() { - if bytes.Equal(ogTopic.Bytes(), topic.Bytes()) { - return &eventType - } - } - return nil -} diff --git a/services/rfq/contracts/fastbridgemulti/eventtype_string.go b/services/rfq/contracts/fastbridgemulti/eventtype_string.go deleted file mode 100644 index e3462b77c7..0000000000 --- a/services/rfq/contracts/fastbridgemulti/eventtype_string.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by "stringer -type=EventType"; DO NOT EDIT. - -package fastbridgemulti - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[BridgeRequestedEvent-1] - _ = x[BridgeRelayedEvent-2] - _ = x[BridgeProofProvidedEvent-3] - _ = x[BridgeDepositClaimedEvent-4] - _ = x[BridgeDisputeEvent-5] -} - -const _EventType_name = "BridgeRequestedEventBridgeRelayedEventBridgeProofProvidedEventBridgeDepositClaimedEventBridgeDisputeEvent" - -var _EventType_index = [...]uint8{0, 20, 38, 62, 87, 105} - -func (i EventType) String() string { - i -= 1 - if i >= EventType(len(_EventType_index)-1) { - return "EventType(" + strconv.FormatInt(int64(i+1), 10) + ")" - } - return _EventType_name[_EventType_index[i]:_EventType_index[i+1]] -} diff --git a/services/rfq/contracts/fastbridgemulti/export_test.go b/services/rfq/contracts/fastbridgemulti/export_test.go deleted file mode 100644 index 4162525149..0000000000 --- a/services/rfq/contracts/fastbridgemulti/export_test.go +++ /dev/null @@ -1,6 +0,0 @@ -package fastbridgemulti - -// GetAllBridgeStatuses exports all bridge statuses for testing. -func GetAllBridgeStatuses() []BridgeStatus { - return allBridgeStatuses -} diff --git a/services/rfq/contracts/fastbridgemulti/generate.go b/services/rfq/contracts/fastbridgemulti/generate.go deleted file mode 100644 index 30b1b3e1d3..0000000000 --- a/services/rfq/contracts/fastbridgemulti/generate.go +++ /dev/null @@ -1,3 +0,0 @@ -package fastbridgemulti - -//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../packages/contracts-rfq/flattened/FastBridge.sol --pkg fastbridgemulti --sol-version 0.8.20 --filename fastbridgemulti --evm-version istanbul diff --git a/services/rfq/contracts/fastbridgemulti/helper.go b/services/rfq/contracts/fastbridgemulti/helper.go deleted file mode 100644 index 7513a724b8..0000000000 --- a/services/rfq/contracts/fastbridgemulti/helper.go +++ /dev/null @@ -1,35 +0,0 @@ -package fastbridgemulti - -import ( - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/vm" -) - -// FastBridgeRef is a bound fast bridge contract that returns the address of the contract. -// -//nolint:golint -type FastBridgeRef struct { - *FastBridge - address common.Address -} - -// Address gets the ocntract address. -func (f *FastBridgeRef) Address() common.Address { - return f.address -} - -// NewFastBridgeRef creates a new fast bridge contract witha ref. -func NewFastBridgeRef(address common.Address, backend bind.ContractBackend) (*FastBridgeRef, error) { - fastBridge, err := NewFastBridge(address, backend) - if err != nil { - return nil, err - } - - return &FastBridgeRef{ - FastBridge: fastBridge, - address: address, - }, nil -} - -var _ vm.ContractRef = &FastBridgeRef{} diff --git a/services/rfq/contracts/fastbridgemulti/parser.go b/services/rfq/contracts/fastbridgemulti/parser.go deleted file mode 100644 index afb317b697..0000000000 --- a/services/rfq/contracts/fastbridgemulti/parser.go +++ /dev/null @@ -1,98 +0,0 @@ -package fastbridgemulti - -import ( - "fmt" - - "github.com/ethereum/go-ethereum/common" - ethTypes "github.com/ethereum/go-ethereum/core/types" -) - -// EventType is the type of the bridge watcher -// -//go:generate go run golang.org/x/tools/cmd/stringer -type=EventType -type EventType uint - -const ( - // BridgeRequestedEvent is the event type for the BridgeRequested event. - BridgeRequestedEvent EventType = iota + 1 - // BridgeRelayedEvent is the event type for the BridgeRelayed event. - BridgeRelayedEvent - // BridgeProofProvidedEvent is the event type for the BridgeProofProvided event. - BridgeProofProvidedEvent - // BridgeDepositClaimedEvent is the event type for the BridgeDepositClaimed event. - BridgeDepositClaimedEvent - // BridgeDisputeEvent is the event type for the BridgeDispute event. - BridgeDisputeEvent -) - -// Parser parses events from the fastbridge contracat. -type Parser interface { - // ParseEvent parses the event from the log. - ParseEvent(log ethTypes.Log) (_ EventType, event interface{}, ok bool) -} -type parserImpl struct { - filterer *FastBridgeFilterer -} - -// NewParser creates a new parser for the fastbridge contract. -func NewParser(fastBridgeAddress common.Address) (Parser, error) { - parser, err := NewFastBridgeFilterer(fastBridgeAddress, nil) - if err != nil { - return nil, fmt.Errorf("could not create %T: %w", FastBridgeFilterer{}, err) - } - - return &parserImpl{filterer: parser}, nil -} - -// nolint: cyclop -func (p parserImpl) ParseEvent(log ethTypes.Log) (_ EventType, event interface{}, ok bool) { - // return an unknown event to avoid cases where user failed to check the event type - // make it high enough to make it obvious (we start iotas at +1, see uber style guide for details) - noOpEvent := EventType(len(topicMap()) + 2) - - if len(log.Topics) == 0 { - return noOpEvent, nil, false - } - nillableEventType := eventTypeFromTopic(log.Topics[0]) - if nillableEventType == nil { - return noOpEvent, nil, false - } - - eventType := *nillableEventType - - switch eventType { - case BridgeRequestedEvent: - requested, err := p.filterer.ParseBridgeRequested(log) - if err != nil { - return noOpEvent, nil, false - } - return eventType, requested, true - case BridgeRelayedEvent: - requested, err := p.filterer.ParseBridgeRelayed(log) - if err != nil { - return noOpEvent, nil, false - } - return eventType, requested, true - case BridgeProofProvidedEvent: - proven, err := p.filterer.ParseBridgeProofProvided(log) - if err != nil { - return noOpEvent, nil, false - } - return eventType, proven, true - case BridgeDepositClaimedEvent: - claimed, err := p.filterer.ParseBridgeDepositClaimed(log) - if err != nil { - return noOpEvent, nil, false - } - return eventType, claimed, true - case BridgeDisputeEvent: - disputed, err := p.filterer.ParseBridgeProofDisputed(log) - if err != nil { - return noOpEvent, nil, false - } - return eventType, disputed, true - - } - - return eventType, nil, true -} diff --git a/services/rfq/contracts/fastbridgemulti/status.go b/services/rfq/contracts/fastbridgemulti/status.go deleted file mode 100644 index e5f21af332..0000000000 --- a/services/rfq/contracts/fastbridgemulti/status.go +++ /dev/null @@ -1,39 +0,0 @@ -package fastbridgemulti - -// BridgeStatus is an enum for the on-chain status of a request -// -//go:generate go run golang.org/x/tools/cmd/stringer -type=BridgeStatus -linecomment -type BridgeStatus uint8 - -// DO NOT USE IOTA! These are meant to reflect on chain statuses. -const ( - // NULL is the default value for a bridge status. - NULL BridgeStatus = 0 // NULL - // REQUESTED is the status for a request that has been made. - REQUESTED BridgeStatus = 1 // REQUESTED - // RelayerProved is the status for a request that has been proved by a relayer. - RelayerProved BridgeStatus = 2 // RELAYER_PROVED - // RelayerClaimed is the status for a request that has been claimed by a relayer. - RelayerClaimed BridgeStatus = 3 // RELAYER_CLAIMED - // REFUNDED is the status for a request that has been refunded. - REFUNDED BridgeStatus = 4 // REFUNDED -) - -// Int returns the int value of the bridge status. -func (b BridgeStatus) Int() uint8 { - return uint8(b) -} - -// set all contact types. -func init() { - for i := 0; i < len(_BridgeStatus_index)-1; i++ { - contractType := BridgeStatus(i) - allBridgeStatuses = append(allBridgeStatuses, contractType) - // assert type is correct - } -} - -// allBridgeStatuses is a list of all bridge statuses Since we use stringer and this is a testing library, instead -// // of manually copying all these out we pull the names out of stringer. In order to make sure stringer is updated, we panic on -// // any method called where the index is higher than the stringer array length. -var allBridgeStatuses []BridgeStatus diff --git a/services/rfq/contracts/fastbridgemulti/status_test.go b/services/rfq/contracts/fastbridgemulti/status_test.go deleted file mode 100644 index 0473d5a58f..0000000000 --- a/services/rfq/contracts/fastbridgemulti/status_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package fastbridgemulti_test - -import ( - "math/big" - "testing" - - "github.com/ethereum/go-ethereum/accounts/abi/bind" - "github.com/stretchr/testify/suite" - "github.com/synapsecns/sanguine/core/testsuite" - "github.com/synapsecns/sanguine/ethergo/backends" - "github.com/synapsecns/sanguine/ethergo/backends/simulated" - "github.com/synapsecns/sanguine/services/rfq/contracts/fastbridgemulti" - "github.com/synapsecns/sanguine/services/rfq/testutil" -) - -// FastBridgeSuite tests the basic test suite. -type FastBridgeSuite struct { - *testsuite.TestSuite - backend backends.SimulatedTestBackend - manager *testutil.DeployManager -} - -// NewFastBridgeSuite creates a new FastBridge suite. -func NewFastBridgeSuite(tb testing.TB) *FastBridgeSuite { - tb.Helper() - return &FastBridgeSuite{ - TestSuite: testsuite.NewTestSuite(tb), - } -} - -func TestFastBridgeSuite(t *testing.T) { - suite.Run(t, NewFastBridgeSuite(t)) -} - -func (s *FastBridgeSuite) SetupTest() { - s.TestSuite.SetupTest() - s.backend = simulated.NewSimulatedBackendWithChainID(s.GetTestContext(), s.T(), big.NewInt(1)) - s.manager = testutil.NewDeployManager(s.T()) -} - -// TestStatusEnum makes sure. -func (s *FastBridgeSuite) TestStatusEnum() { - _, fb := s.manager.GetMockFastBridge(s.GetTestContext(), s.backend) - for _, status := range fastbridgemulti.GetAllBridgeStatuses() { - solstatus, err := fb.GetEnumKeyByValue(&bind.CallOpts{Context: s.GetTestContext()}, status.Int()) - s.Require().NoError(err, "error getting enum key by value") - s.Require().Equal(solstatus, status.String(), "status %s does not match. BridgeStatus enums out of sync.", status) - } -}