0 txs
1 call
constructor
constructor(address _swapRouter, address _weth, address _usdc, address _feeRecipient)
functions
ADMIN_ROLE
viewfunction ADMIN_ROLE() view returns (bytes32)
DEFAULT_ADMIN_ROLE
viewfunction DEFAULT_ADMIN_ROLE() view returns (bytes32)
feePercentage
viewfunction feePercentage() view returns (uint256)
feeRecipient
viewfunction feeRecipient() view returns (address)
getRoleAdmin
viewfunction getRoleAdmin(bytes32 role) view returns (bytes32)
getTokenBalance
viewfunction getTokenBalance(address token) view returns (uint256)
hasAdminRole
viewfunction hasAdminRole(address account) view returns (bool)
hasRole
viewfunction hasRole(bytes32 role, address account) view returns (bool)
owner
viewfunction owner() view returns (address)
paused
viewfunction paused() view returns (bool)
supportsInterface
viewfunction supportsInterface(bytes4 interfaceId) view returns (bool)
swapRouter
viewfunction swapRouter() view returns (address)
usdc
viewfunction usdc() view returns (address)
weth
viewfunction weth() view returns (address)
grantAdminRole
nonpayablefunction grantAdminRole(address account)
grantRole
nonpayablefunction grantRole(bytes32 role, address account)
pause
nonpayablefunction pause()
renounceOwnership
nonpayablefunction renounceOwnership()
renounceRole
nonpayablefunction renounceRole(bytes32 role, address callerConfirmation)
revokeAdminRole
nonpayablefunction revokeAdminRole(address account)
revokeRole
nonpayablefunction revokeRole(bytes32 role, address account)
setFeePercentage
nonpayablefunction setFeePercentage(uint256 _feePercentage)
setFeeRecipient
nonpayablefunction setFeeRecipient(address _feeRecipient)
swapToUSDC
nonpayablefunction swapToUSDC(address tokenIn, uint24 poolFee, uint256 amountOutMin, uint256 deadline, address destination)
transferOwnership
nonpayablefunction transferOwnership(address newOwner)
unpause
nonpayablefunction unpause()
withdrawERC20
nonpayablefunction withdrawERC20(address token)
withdrawETH
nonpayablefunction withdrawETH()
withdrawUSDC
nonpayablefunction withdrawUSDC()
events
AdminRoleGranted
event AdminRoleGranted(address indexed owner, address indexed account)
AdminRoleRevoked
event AdminRoleRevoked(address indexed owner, address indexed account)
ContractPauseStatusChanged
event ContractPauseStatusChanged(address indexed owner, bool status)
FeeRecipientChanged
event FeeRecipientChanged(address indexed owner, address indexed newFeeRecipient)
FeeTransferred
event FeeTransferred(address indexed recipient, uint256 amount)
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Paused
event Paused(address account)
RoleAdminChanged
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole)
RoleGranted
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender)
RoleRevoked
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender)
Swapped
event Swapped(address indexed tokenIn, uint256 amountIn, uint256 amountOut, address indexed destination, uint256 fee)
TokenApproved
event TokenApproved(address indexed caller, address indexed token, uint256 amount)
Unpaused
event Unpaused(address account)
WithdrawnERC20
event WithdrawnERC20(address indexed owner, address indexed token, uint256 amount)
WithdrawnETH
event WithdrawnETH(address indexed owner, uint256 amount)
WithdrawnUSDC
event WithdrawnUSDC(address indexed owner, uint256 amount)
errors
AccessControlBadConfirmation
error AccessControlBadConfirmation()
AccessControlUnauthorizedAccount
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole)
AddressEmptyCode
error AddressEmptyCode(address target)
AddressInsufficientBalance
error AddressInsufficientBalance(address account)
CannotSwapUSDC
error CannotSwapUSDC()
CannotWithdrawUSDC
error CannotWithdrawUSDC()
DeadlineReached
error DeadlineReached()
EnforcedPause
error EnforcedPause()
ExpectedPause
error ExpectedPause()
FailedInnerCall
error FailedInnerCall()
FeePercentageTooHigh
error FeePercentageTooHigh()
InsufficientTokenBalance
error InsufficientTokenBalance(address token)
NotAdmin
error NotAdmin()
NoUSDCAvailable
error NoUSDCAvailable()
OwnableInvalidOwner
error OwnableInvalidOwner(address owner)
OwnableUnauthorizedAccount
error OwnableUnauthorizedAccount(address account)
ReentrancyGuardReentrantCall
error ReentrancyGuardReentrantCall()
SafeERC20FailedOperation
error SafeERC20FailedOperation(address token)
ZeroAddressDestination
error ZeroAddressDestination()
ZeroAddressFeeRecipient
error ZeroAddressFeeRecipient()
ZeroAddressSwapRouter
error ZeroAddressSwapRouter()
ZeroAddressToken
error ZeroAddressToken()
ZeroAddressUSDC
error ZeroAddressUSDC()
ZeroAddressWETH
error ZeroAddressWETH()
creation bytecode
0x60e060405260646004553480156200001657600080fd5b5060405162001e6738038062001e6783398101604081905262000039916200029c565b33806200006057604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b6200006b8162000198565b5060016002556003805460ff191690556001600160a01b038416620000a357604051630703633560e21b815260040160405180910390fd5b6001600160a01b038316620000cb576040516308d4461960e41b815260040160405180910390fd5b6001600160a01b038216620000f35760405163477b759d60e01b815260040160405180910390fd5b6001600160a01b0381166200011b5760405163300c968960e01b815260040160405180910390fd5b6001600160a01b0380851660805283811660a05282811660c0526003805491831661010002610100600160a81b031990921691909117905562000160600033620001e8565b506200018d7fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c2177533620001e8565b5050505050620002f9565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008281526001602090815260408083206001600160a01b038516845290915281205460ff16620002755760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a450600162000279565b5060005b92915050565b80516001600160a01b03811681146200029757600080fd5b919050565b60008060008060808587031215620002b357600080fd5b620002be856200027f565b9350620002ce602086016200027f565b9250620002de604086016200027f565b9150620002ee606086016200027f565b905092959194509250565b60805160a05160c051611af1620003766000396000818161027a015281816108e101528181610b4b01528181610cae01528181610d3001528181610e1601528181610ec401526111880152600081816102d00152818161098901526109fd01526000818161042d01528181610acc0152610bf80152611af16000f3fe6080604052600436106101865760003560e01c806391d14854116100d7578063c634b78e11610085578063c634b78e1461046f578063cf5a9f651461048f578063d547741f146104af578063d8fc063d146104cf578063e086e5ec146104e4578063e74b981b146104f9578063f2fde38b14610519578063f4f3b2001461053957600080fd5b806391d14854146103905780639a19c7b0146103b0578063a001ecdd146103d0578063a217fddf146103e6578063ae06c1b7146103fb578063c31c9c071461041b578063c395fcb31461044f57600080fd5b80633fc8cef3116101345780633fc8cef3146102be57806346904840146102f25780635c975abb14610317578063715018a61461032f57806375b238fc146103445780638456cb59146103665780638da5cb5b1461037b57600080fd5b806301ffc9a714610192578063248a9ca3146101c75780632f2ff15d1461020657806336568abe146102285780633aecd0e3146102485780633e413bee146102685780633f4ba83a146102a957600080fd5b3661018d57005b600080fd5b34801561019e57600080fd5b506101b26101ad36600461189b565b610559565b60405190151581526020015b60405180910390f35b3480156101d357600080fd5b506101f86101e23660046118c5565b6000908152600160208190526040909120015490565b6040519081526020016101be565b34801561021257600080fd5b506102266102213660046118fa565b610590565b005b34801561023457600080fd5b506102266102433660046118fa565b6105bc565b34801561025457600080fd5b506101f8610263366004611926565b6105f4565b34801561027457600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516101be9190611941565b3480156102b557600080fd5b50610226610678565b3480156102ca57600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102fe57600080fd5b5060035461029c9061010090046001600160a01b031681565b34801561032357600080fd5b5060035460ff166101b2565b34801561033b57600080fd5b506102266106d7565b34801561035057600080fd5b506101f8600080516020611a9c83398151915281565b34801561037257600080fd5b506102266106eb565b34801561038757600080fd5b5061029c610740565b34801561039c57600080fd5b506101b26103ab3660046118fa565b61074f565b3480156103bc57600080fd5b506102266103cb366004611926565b61077a565b3480156103dc57600080fd5b506101f860045481565b3480156103f257600080fd5b506101f8600081565b34801561040757600080fd5b506102266104163660046118c5565b6107e5565b34801561042757600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561045b57600080fd5b506101b261046a366004611926565b610815565b34801561047b57600080fd5b5061022661048a366004611926565b61082f565b34801561049b57600080fd5b506102266104aa366004611955565b61089a565b3480156104bb57600080fd5b506102266104ca3660046118fa565b610dbe565b3480156104db57600080fd5b50610226610de4565b3480156104f057600080fd5b50610226610f40565b34801561050557600080fd5b50610226610514366004611926565b611074565b34801561052557600080fd5b50610226610534366004611926565b611109565b34801561054557600080fd5b50610226610554366004611926565b611147565b60006001600160e01b03198216637965db0b60e01b148061058a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600082815260016020819052604090912001546105ac816112e8565b6105b683836112f2565b50505050565b6001600160a01b03811633146105e55760405163334bd91960e11b815260040160405180910390fd5b6105ef828261136b565b505050565b60006001600160a01b03821661060b575047919050565b6040516370a0823160e01b81526001600160a01b038316906370a0823190610637903090600401611941565b602060405180830381865afa158015610654573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058a91906119b6565b6106806113d8565b61068861140a565b610690610740565b6001600160a01b03167ffc9f69fa923e2ed91dc43cda77e34c0024f10c50437aeca03e2d8242a4e65d0a60006040516106cd911515815260200190565b60405180910390a2565b6106df6113d8565b6106e96000611456565b565b6106f36113d8565b6106fb6114a6565b610703610740565b6001600160a01b03167ffc9f69fa923e2ed91dc43cda77e34c0024f10c50437aeca03e2d8242a4e65d0a60016040516106cd911515815260200190565b6000546001600160a01b031690565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6107826113d8565b61079a600080516020611a9c8339815191528261136b565b50806001600160a01b03166107ad610740565b6001600160a01b03167fb5387c0a34442a3ba95aef2cf3a2d83c558151f5ec38e84bd6bddb0755b5f1ac60405160405180910390a350565b6107ed6113d8565b6103e881111561081057604051635841c1b960e01b815260040160405180910390fd5b600455565b600061058a600080516020611a9c8339815191528361074f565b6108376113d8565b61084f600080516020611a9c833981519152826112f2565b50806001600160a01b0316610862610740565b6001600160a01b03167f2570ac42fd8b322dc453ada624dc2ed0e9bdd67f16f201a25bbd30468f2aa18760405160405180910390a350565b6108a26114e3565b6108aa61150b565b6108c2600080516020611a9c8339815191523361074f565b6108df57604051637bfa4b9f60e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b03160361093157604051630e1c514360e11b815260040160405180910390fd5b814211156109525760405163b08ce5b360e01b815260040160405180910390fd5b6001600160a01b038116610979576040516313f6248760e01b815260040160405180910390fd5b6001600160a01b038516610a1f577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0476040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109e257600080fd5b505af11580156109f6573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000094505b6040516370a0823160e01b81526000906001600160a01b038716906370a0823190610a4e903090600401611941565b602060405180830381865afa158015610a6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8f91906119b6565b905080600003610abd5785604051633217d57d60e11b8152600401610ab49190611941565b60405180910390fd5b610af16001600160a01b0387167f00000000000000000000000000000000000000000000000000000000000000008361152f565b6040518181526001600160a01b0387169033907fc532e6b60637d86dd3fe55f7548ed169de9c79cfdef610593bea3569f079bc659060200160405180910390a360408051610100810182526001600160a01b0388811682527f000000000000000000000000000000000000000000000000000000000000000081166020830190815262ffffff8981168486019081523060608601908152608086018a815260a0870189815260c088018d8152600060e08a018181529a5163414bf38960e01b81528a518a166004820152975189166024890152945190951660448701529151861660648601525160848501525160a4840152905160c48301529351821660e48201529192917f00000000000000000000000000000000000000000000000000000000000000009091169063414bf38990610104016020604051808303816000875af1158015610c44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6891906119b6565b9050600061271060045483610c7d91906119e5565b610c8791906119fc565b90506000610c958284611a1e565b90508115610d2357600354610cdc906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811691610100900416846115f3565b6003546040518381526101009091046001600160a01b0316907f34e8a84e537ed93d93ddf39a78816dcbc74df8397c635838b8cc973d4fa943f89060200160405180910390a25b610d576001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001687836115f3565b60408051868152602081018590529081018390526001600160a01b0380881691908c16907f695d138b85dd3c5db002248080b82bc98c9976a7b99f050314f7b0614030a1e99060600160405180910390a35050505050610db76001600255565b5050505050565b60008281526001602081905260409091200154610dda816112e8565b6105b6838361136b565b610dec6113d8565b610df46114e3565b610dfc61150b565b6040516370a0823160e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190610e4b903090600401611941565b602060405180830381865afa158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c91906119b6565b905080600003610eaf5760405163b1dc2bbb60e01b815260040160405180910390fd5b610eeb610eba610740565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690836115f3565b610ef3610740565b6001600160a01b03167f9064b460fd73b0517caa24227d99918304810044cab6170024069608dc4ca0e682604051610f2d91815260200190565b60405180910390a2506106e96001600255565b610f486113d8565b610f506114e3565b610f5861150b565b476000819003610f7e576000604051633217d57d60e11b8152600401610ab49190611941565b6000610f88610740565b6001600160a01b03168260405160006040518083038185875af1925050503d8060008114610fd2576040519150601f19603f3d011682016040523d82523d6000602084013e610fd7565b606091505b505090508061101e5760405162461bcd60e51b8152602060048201526013602482015272115512081d1c985b9cd9995c8819985a5b1959606a1b6044820152606401610ab4565b611026610740565b6001600160a01b03167f5817fe91d2748c33f168d8a78037fc073adaf6ec8e3613a758d44a2cfae4563d8360405161106091815260200190565b60405180910390a250506106e96001600255565b61107c6113d8565b6001600160a01b0381166110a35760405163300c968960e01b815260040160405180910390fd5b60038054610100600160a81b0319166101006001600160a01b038416908102919091179091556110d1610740565b6001600160a01b03167f0bc21fe5c3ab742ff1d15b5c4477ffbacf1167e618228078fa625edebe7f331d60405160405180910390a350565b6111116113d8565b6001600160a01b03811661113b576000604051631e4fbdf760e01b8152600401610ab49190611941565b61114481611456565b50565b61114f6113d8565b6111576114e3565b61115f61150b565b6001600160a01b038116611186576040516314f28f2b60e01b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b0316036111d85760405163540c1c6160e11b815260040160405180910390fd5b6040516370a0823160e01b81526000906001600160a01b038316906370a0823190611207903090600401611941565b602060405180830381865afa158015611224573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124891906119b6565b90508060000361126d5781604051633217d57d60e11b8152600401610ab49190611941565b611289611278610740565b6001600160a01b03841690836115f3565b816001600160a01b031661129b610740565b6001600160a01b03167f31e3f58fbb760a4c31ae5c6416229fca813390b5fa0de533ee4cef14b2b344db836040516112d591815260200190565b60405180910390a3506111446001600255565b6111448133611619565b60006112fe838361074f565b6113635760008381526001602081815260408084206001600160a01b0387168086529252808420805460ff19169093179092559051339286917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a450600161058a565b50600061058a565b6000611377838361074f565b156113635760008381526001602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161058a565b336113e1610740565b6001600160a01b0316146106e9573360405163118cdaa760e01b8152600401610ab49190611941565b611412611648565b6003805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405161144c9190611941565b60405180910390a1565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6114ae61150b565b6003805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861143f3390565b600280540361150557604051633ee5aeb560e01b815260040160405180910390fd5b60028055565b60035460ff16156106e95760405163d93c066560e01b815260040160405180910390fd5b6000836001600160a01b031663095ea7b38484604051602401611553929190611a31565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050905061158c848261166b565b6105b6576115e984856001600160a01b031663095ea7b38660006040516024016115b7929190611a31565b604051602081830303815290604052915060e01b6020820180516001600160e01b038381831617835250505050611713565b6105b68482611713565b6105ef83846001600160a01b031663a9059cbb85856040516024016115b7929190611a31565b611623828261074f565b61164457808260405163e2517d3f60e01b8152600401610ab4929190611a31565b5050565b60035460ff166106e957604051638dfc202b60e01b815260040160405180910390fd5b6000806000846001600160a01b0316846040516116889190611a4a565b6000604051808303816000865af19150503d80600081146116c5576040519150601f19603f3d011682016040523d82523d6000602084013e6116ca565b606091505b50915091508180156116f45750805115806116f45750808060200190518101906116f49190611a79565b801561170a57506000856001600160a01b03163b115b95945050505050565b60006117286001600160a01b0384168361176d565b9050805160001415801561174d57508080602001905181019061174b9190611a79565b155b156105ef5782604051635274afe760e01b8152600401610ab49190611941565b606061177b83836000611782565b9392505050565b6060814710156117a7573060405163cd78605960e01b8152600401610ab49190611941565b600080856001600160a01b031684866040516117c39190611a4a565b60006040518083038185875af1925050503d8060008114611800576040519150601f19603f3d011682016040523d82523d6000602084013e611805565b606091505b509150915061181586838361181f565b9695505050505050565b6060826118345761182f82611872565b61177b565b815115801561184b57506001600160a01b0384163b155b1561186b5783604051639996b31560e01b8152600401610ab49190611941565b508061177b565b8051156118825780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6000602082840312156118ad57600080fd5b81356001600160e01b03198116811461177b57600080fd5b6000602082840312156118d757600080fd5b5035919050565b80356001600160a01b03811681146118f557600080fd5b919050565b6000806040838503121561190d57600080fd5b8235915061191d602084016118de565b90509250929050565b60006020828403121561193857600080fd5b61177b826118de565b6001600160a01b0391909116815260200190565b600080600080600060a0868803121561196d57600080fd5b611976866118de565b9450602086013562ffffff8116811461198e57600080fd5b935060408601359250606086013591506119aa608087016118de565b90509295509295909350565b6000602082840312156119c857600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761058a5761058a6119cf565b600082611a1957634e487b7160e01b600052601260045260246000fd5b500490565b8181038181111561058a5761058a6119cf565b6001600160a01b03929092168252602082015260400190565b6000825160005b81811015611a6b5760208186018101518583015201611a51565b506000920191825250919050565b600060208284031215611a8b57600080fd5b8151801515811461177b57600080fdfea49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220266876e1e94d5b892c29f58d3a3659aa5134fe2ff5adae7181c0fc9a7233ec5e64736f6c63430008180033000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000009ea4b8b271608e0b9046bdec835c316764516a4c