38.9k txs
130.8k calls
constructor
No constructor.
functions
bridge
viewfunction bridge(address) view returns (bool)
internalCaller
viewfunction internalCaller(address) view returns (bool)
owner
viewfunction owner() view returns (address)
paused
viewfunction paused() view returns (bool)
pendingOwner
viewfunction pendingOwner() view returns (address)
swapFeeAddress
viewfunction swapFeeAddress() view returns (address)
acceptOwnership
nonpayablefunction acceptOwnership()
estimateSwapGas
payablefunction estimateSwapGas(bytes) payable returns (uint256 amountOut, uint256 gasUsed)
multicall
nonpayablefunction multicall(bytes[] data) returns (bytes[] results)
pause
nonpayablefunction pause()
renounceOwnership
nonpayablefunction renounceOwnership()
swapWithMagpieSignature
payablefunction swapWithMagpieSignature(bytes) payable returns (uint256 amountOut)
swapWithoutSignature
payablefunction swapWithoutSignature(bytes) payable returns (uint256 amountOut)
swapWithUserSignature
payablefunction swapWithUserSignature(bytes) payable returns (uint256 amountOut)
transferOwnership
nonpayablefunction transferOwnership(address newOwner)
unpause
nonpayablefunction unpause()
updateBridge
nonpayablefunction updateBridge(address caller, bool value)
updateInternalCaller
nonpayablefunction updateInternalCaller(address caller, bool value)
updateSwapFeeAddress
nonpayablefunction updateSwapFeeAddress(address value)
events
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
OwnershipTransferStarted
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner)
Paused
event Paused(address account)
Swap
event Swap(address indexed fromAddress, address indexed toAddress, address fromAssetAddress, address toAssetAddress, uint256 amountIn, uint256 amountOut)
Unpaused
event Unpaused(address account)
UpdateBridge
event UpdateBridge(address indexed sender, address caller, bool value)
UpdateInternalCaller
event UpdateInternalCaller(address indexed sender, address caller, bool value)
errors
ApprovalFailed
error ApprovalFailed()
FailedUnwrap
error FailedUnwrap()
FailedWrap
error FailedWrap()
InsufficientAmountOut
error InsufficientAmountOut()
InvalidAmountIn
error InvalidAmountIn()
InvalidCall
error InvalidCall()
InvalidCaller
error InvalidCaller()
InvalidCommand
error InvalidCommand()
InvalidNativeAmount
error InvalidNativeAmount()
InvalidOutput
error InvalidOutput()
InvalidSignature
error InvalidSignature()
TransferFailed
error TransferFailed()
TransferFromFailed
error TransferFromFailed()
UniswapV3InvalidAmount
error UniswapV3InvalidAmount()
creation bytecode
0x60806040523480156200001157600080fd5b506200001d3362000030565b6001805460ff60a01b191690556200009e565b600180546001600160a01b03191690556200004b816200004e565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b61258780620000ae6000396000f3fe6080604052600436106101185760003560e01c806373fc4457116100a05780638da5cb5b116100645780638da5cb5b14610382578063ac9650d8146103a0578063b8f38c74146103cd578063e30c3978146103ed578063f2fde38b1461040b5761011f565b806373fc4457146102fd57806377a1c5311461031057806379ba50971461033057806383bf2321146103455780638456cb591461036d5761011f565b8063519a98e0116100e7578063519a98e01461023957806353ca57da1461025957806357f46a1a146102995780635c975abb146102c9578063715018a6146102e85761011f565b8063158f6894146101b35780631ec4aec8146101d957806325e651ed146102115780633f4ba83a146102245761011f565b3661011f57005b34801561012b57600080fd5b5060043560243560843560601c3660a4811461015a5760405163574b16a760e11b815260040160405180910390fd5b6000841315801561016c575060008313155b1561018a57604051637ed0826d60e11b815260040160405180910390fd5b6000808513610199578361019b565b845b90506101b16001600160a01b038416338361042b565b005b6101c66101c1366004612233565b61050a565b6040519081526020015b60405180910390f35b3480156101e557600080fd5b506004546101f9906001600160a01b031681565b6040516001600160a01b0390911681526020016101d0565b6101c661021f366004612233565b61056d565b34801561023057600080fd5b506101b1610644565b34801561024557600080fd5b506101b16102543660046122c1565b61065e565b34801561026557600080fd5b506102896102743660046122fd565b60036020526000908152604090205460ff1681565b60405190151581526020016101d0565b3480156102a557600080fd5b506102896102b43660046122fd565b60026020526000908152604090205460ff1681565b3480156102d557600080fd5b50600154600160a01b900460ff16610289565b3480156102f457600080fd5b506101b16106cc565b6101c661030b366004612233565b6106de565b34801561031c57600080fd5b506101b161032b3660046122c1565b610702565b34801561033c57600080fd5b506101b1610768565b610358610353366004612233565b6107e7565b604080519283526020830191909152016101d0565b34801561037957600080fd5b506101b1610870565b34801561038e57600080fd5b506000546001600160a01b03166101f9565b3480156103ac57600080fd5b506103c06103bb366004612318565b610888565b6040516101d091906123cb565b3480156103d957600080fd5b506101b16103e83660046122fd565b61097b565b3480156103f957600080fd5b506001546001600160a01b03166101f9565b34801561041757600080fd5b506101b16104263660046122fd565b6109a5565b6001600160a01b0383166104b3576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610486576040519150601f19603f3d011682016040523d82523d6000602084013e61048b565b606091505b50509050806104ad576040516312171d8360e31b815260040160405180910390fd5b50505050565b600060405190506044810160405263a9059cbb60e01b81528260048201528160248201526104e8846000836044600080610a16565b6104ad576040516312171d8360e31b815260040160405180910390fd5b505050565b3360009081526003602052604081205460ff1661053a576040516348f5c3ed60e01b815260040160405180910390fd5b6000610544610a83565b905060006105558260016000610bf4565b905061056382826000610d04565b5095945050505050565b3360009081526002602052604081205460ff1661059d576040516348f5c3ed60e01b815260040160405180910390fd5b60006105a7610a83565b905034156105c85760405163113a2f4b60e21b815260040160405180910390fd5b60006105d78260006001610bf4565b90508160e00151156105ed576105ed8282610e2f565b61061682828460a0015160001461060f576004546001600160a01b0316610ea4565b6000610ea4565b61056382828461014001518560a001518660c001516106359190612445565b61063f9190612445565b610d04565b61064c610f8a565b610654610fe4565b61065c611034565b565b610666610f8a565b6001600160a01b038216600081815260026020908152604091829020805460ff191685151590811790915582519384529083015233917fa71618a9ed4e81ce27edc2700d38db549c32abb5e4f32ec57f791151030fbc4591015b60405180910390a25050565b6106d4610f8a565b61065c6000611089565b60006106e86110a2565b60006106f2610a83565b905060006105d782600180610bf4565b61070a610f8a565b6001600160a01b038216600081815260036020908152604091829020805460ff191685151590811790915582519384529083015233917f15e602ce63b40cbac22a674a1c5f4ca3d6c942e18d5282f3c773fe6722dfb63a91016106c0565b60015433906001600160a01b031681146107db5760405162461bcd60e51b815260206004820152602960248201527f4f776e61626c6532537465703a2063616c6c6572206973206e6f7420746865206044820152683732bb9037bbb732b960b91b60648201526084015b60405180910390fd5b6107e481611089565b50565b6000806107f26110a2565b60006107fc610a83565b9050600061080c82600180610bf4565b90508160e0015115610822576108228282610e2f565b61084482828460a0015160001461060f576004546001600160a01b0316610ea4565b61086382828461014001518560a001518660c001516106359190612445565b9097909650945050505050565b610878610f8a565b6108806110a2565b61065c6110ef565b6060610892610f8a565b8167ffffffffffffffff8111156108ab576108ab612458565b6040519080825280602002602001820160405280156108de57816020015b60608152602001906001900390816108c95790505b50905060005b828110156109735761094e308585848181106109025761090261246e565b90506020028101906109149190612484565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061113292505050565b8282815181106109605761096061246e565b60209081029190910101526001016108e4565b505b92915050565b610983610f8a565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6109ad610f8a565b600180546001600160a01b0383166001600160a01b031990911681179091556109de6000546001600160a01b031690565b6001600160a01b03167f38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e2270060405160405180910390a350565b6000610a59565b60003d1560018114610a34578015610a4557610a53565b823b15610a4057600191505b610a53565b60206000803e600080511191505b50919050565b81838587898b5af1610a6f573d6000803e3d6000fd5b610a7887610a1d565b979650505050505050565b6040805161016081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101829052610120810182905261014081019190915260853560f01c3560843560f81c1c42811015610b035763931997cf60e01b60005260046000fd5b60483560601c8252605c3560601c602083015260703560601c60408301528060608301525060883560f01c3560873560f81c1c6080820152608b3560f01c35608a3560f81c1c60a0820152608e3560f01c35608d3560f81c1c60c0820152600060d13560f81c118060e08301528060018114610bb55760d23560f81c8061010085015260018103610baf5760d33560601c61012085015260e83560f01c3560e73560f81c1c6101408501525b50505090565b6101153560f81c8061010085015260018103610baf576101163560601c61012085015261012b3560f01c3561012a3560f81c1c61014085015250505090565b60008115610cd75761010084015160008082610c1257610140610c16565b6101805b61ffff16905060405191508082016040528260018114610c58577f783528850c43ab6adcc3a843186a6558aa806707dd0abb3d2909a2a70b7f22a38352610c7c565b7f64d67eff2ff010acba1b1df82fb327ba0dc6d2965ba6b0b472bc14c494c8b4f683525b50610ccd7f86af987965544521ef5b52deabbeb812d3353977e11a2dbe7e0f4905d1e607217f2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de8985858b6002611157565b9350505050610cfd565b8215610ce4575033610cfd565b60405163574b16a760e11b815260040160405180910390fd5b9392505050565b602083015160408401518451608086015160c0870151600094859490939092909185610d396001600160a01b03861685611301565b9750610d458a87611351565b9750905087610d5d6001600160a01b03871686611301565b610d6791906124d2565b975082881015610d8a57604051637294b85560e11b815260040160405180910390fd5b6001600160a01b03861615158015610da25750808214155b15610dc0576040516365719fe160e11b815260040160405180910390fd5b8815610e2157604080516001600160a01b03888116825287811660208301529181018b9052606081018a9052818616918c16907f20efd6d5195b7b50273f01cd79a27989255356f9f13293edc53ee142accfdb759060800160405180910390a35b505050505050935093915050565b60008060008060d13560f81c935060d235925060f23591506101133560f01c356101123560f81c1c9050610e9c85308861014001518960a001518a60c00151610e789190612445565b610e829190612445565b60208a01516001600160a01b0316929190858989896113e7565b505050505050565b60a083015115610f135760208301516001600160a01b0316610eeb57610ee6818460a0015185602001516001600160a01b031661042b9092919063ffffffff16565b610f13565b610f1382828560a0015186602001516001600160a01b031661143c909392919063ffffffff16565b610140830151156105055760208301516001600160a01b0316610f5c5761050583610120015184610140015185602001516001600160a01b031661042b9092919063ffffffff16565b6105058284610120015185610140015186602001516001600160a01b031661143c909392919063ffffffff16565b6000546001600160a01b0316331461065c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107d2565b600154600160a01b900460ff1661065c5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107d2565b61103c610fe4565b6001805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600180546001600160a01b03191690556107e48161149b565b600154600160a01b900460ff161561065c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016107d2565b6110f76110a2565b6001805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861106c3390565b6060610cfd838360405180606001604052806027815260200161252b602791396114eb565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091528183018a9052606082018990524660808301523060a0808401919091528351808403909101815260c090920190925280519101206000906000806000803060208b01523360408b01528a5160608b015260208b015160808b015260408b015160a08b015260608b015160c08b015260808b015160e08b015260a08b01516101008b015260c08b01516101208b015260016101008c015103611239576101208b01516101408b01526101408b01516101608b01525b888a206040519a5060428b0160405261190160f01b8b528560028c01528060228c01525060428a209350609035925060b035915060d03560f81c905087156112ba57600061128985858585611563565b905033965080600052876020526001604060002054146112b457638baa579f60e01b60005260046000fd5b506112f1565b6112c684848484611563565b9550306001600160a01b038716036112f157604051638baa579f60e01b815260040160405180910390fd5b5050505050979650505050505050565b600082801561134957604051604481016040526370a0823160e01b815283600482015260248101602081602484895afa61133f573d6000803e3d6000fd5b5192506109739050565b505031919050565b604080516046803560f090811c80840190945260009384936044803590931c90930192602435909201918061ffff85165b8461ffff168110156113ac5761139d818b8b86868d8d61166b565b91995097509150600901611382565b506113bb61ffff841683612445565b8111156113db576040516398f7360960e01b815260040160405180910390fd5b50505050509250929050565b60405160e4810160405263d505accf60e01b81528760048201528660248201528560448201528460648201528360848201528260a48201528160c482015260008060e48360008d5af150505050505050505050565b60006040519050606481016040526323b872dd60e01b8152836004820152826024820152816044820152611477856000836064600080610a16565b61149457604051631e4e7d0960e21b815260040160405180910390fd5b5050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6060600080856001600160a01b03168560405161150891906124e5565b600060405180830381855af49150503d8060008114611543576040519150601f19603f3d011682016040523d82523d6000602084013e611548565b606091505b50915091506115598683838761183f565b9695505050505050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156115a657604051638baa579f60e01b815260040160405180910390fd5b8160ff16601b141580156115be57508160ff16601c14155b156115dc57604051638baa579f60e01b815260040160405180910390fd5b60408051600081526020810180835287905260ff841691810191909152606081018590526080810184905260019060a0016020604051602081039080840390855afa15801561162f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661166357604051638baa579f60e01b815260040160405180910390fd5b949350505050565b60008080893560f81c8181600a81111561168757611687612501565b0361169e576116978b89896118b8565b965061182d565b600181600a8111156116b2576116b2612501565b036116c6576116c18b89611960565b61182d565b600281600a8111156116da576116da612501565b036116f3576116ec8b898b8d8a611995565b955061182d565b600381600a81111561170757611707612501565b03611716576116c18b896119e5565b600481600a81111561172a5761172a612501565b03611739576116c18b89611a1e565b600581600a81111561174d5761174d612501565b0361175c576116c18b89611a4c565b600681600a81111561177057611770612501565b03611780576116978b8989611a7a565b600781600a81111561179457611794612501565b036117a4576116978b8989611ab4565b600881600a8111156117b8576117b8612501565b036117c8576116978b8989611cd2565b600981600a8111156117dc576117dc612501565b036117e9575a945061182d565b600a81600a8111156117fd576117fd612501565b03611814575a61180d90866124d2565b945061182d565b6040516312f269e560e01b815260040160405180910390fd5b50939992985093965090945050505050565b606083156118ae5782516000036118a7576001600160a01b0385163b6118a75760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d2565b5081611663565b6116638383611f27565b6000606060006118c88686611f51565b60208201519193509150600187013560f01c9060e01c8015611933576323b872dd811461194457600788013560f01c3560601c3081036119135763574b16a760e11b60005260046000fd5b828786516020880187855af161192d573d6000803e3d6000fd5b50611955565b631cd4b64760e21b60005260046000fd5b6305d46a3960e21b60005260046000fd5b50610a788186612445565b600061196c8383611f51565b506020810151604082015160608301519293509091610e9c6001600160a01b03841683836120f4565b6000806119a28787611f51565b50604081015190915080156119d95760208201516119cb6001600160a01b03881687838561143c565b6119d58286612445565b9450505b50919695505050505050565b60006119f18383611f51565b50606081015190915080156104ad5760208201516040830151610e9c6001600160a01b038316828561042b565b6000611a2a8383611f51565b5060208101516040820151919250906114946001600160a01b03831682612196565b6000611a588383611f51565b5060208101516040820151919250906114946001600160a01b038316826121db565b600080611a878585611f51565b5060208101519091506000611aa46001600160a01b038316612227565b8086529050610a78602086612445565b600080611ac18585611f51565b509050611cb0565b60006040516000806000805b600a841015611c9757600384028701600181015160f81c600a811060018114611b0f57600a820391506020820260208b0101519550611b19565b6020820288015195505b5050600281015160f81c600a811060018114611b4657600a820391506020820260208b0101519450611b50565b6020820288015194505b50505160f81c9050808015611bac5760018114611bca5760028114611bd95760038114611be85760048114611bf75760058114611c065760068114611c155760078114611c485760088114611c715760098114611c8057611c8b565b50505050600019016020908102919091018051910160405292915050565b82840160208602870152611c8b565b82840360208602870152611c8b565b82840260208602870152611c8b565b82840460208602870152611c8b565b82840a60208602870152611c8b565b6f7fffffffffffffffffffffffffffffff841115611c3b57607f84901d93841893909303925b8360208602870152611c8b565b6001600160ff1b03841115611c3b5760ff84901d93841893909303928360208602870152611c8b565b82841c60208602870152611c8b565b82841b602086028701525b50600184019350611ad5565b5050505061012081015161014090910160405292915050565b611cbc60208201611ac9565b8352611cc9602084612445565b95945050505050565b600080611cdf8585611f51565b509050611f1b565b60006040516000806000806000805b6006861015611f0157600586028901600181015160f81c6006811060018114611d30576006820391506020820260208d0101519750611d3a565b602082028a015197505b5050600281015160f81c6006811060018114611d67576006820391506020820260208d0101519650611d71565b602082028a015196505b5050600381015160f81c6006811060018114611d9e576006820391506020820260208d0101519550611da8565b602082028a015195505b5050600481015160f81c6006811060018114611dd5576006820391506020820260208d0101519450611ddf565b602082028a015194505b50505160f81c9050808015611e235760018114611e435760028114611e6a5760038114611e865760048114611e9e5760058114611eba5760068114611ed257611ef5565b505050505050600019016020908102919091018051910160405292915050565b84861060018114611e5b5783602089028a0152611e64565b84602089028a01525b50611ef5565b8486148587101760018114611e5b5783602089028a0152611e64565b84861160018114611e5b5783602089028a0152611e64565b8486148587111760018114611e5b5783602089028a0152611e64565b84861460018114611e5b5783602089028a0152611e64565b84861460018114611eea5784602089028a0152611ef3565b83602089028a01525b505b50600186019550611cf6565b5050505060a083015160c090930160405250909392505050565b611cbc60208201611ce7565b815115611f375781518083602001fd5b8060405162461bcd60e51b81526004016107d29190612517565b6040516000600584013560f090811c906003860135901c602084015b828210156120de57813560f81c808015611fca576001811461200f576002811461202b576003811461204a5760048114612071576005811461209557600681146120b357600781146120c757635485b7ef60e11b60005260046000fd5b600384013560f01c60018114611ff557600185013560f01c6001810135813560f81c1c975050612003565b600185013560f01c89015196505b506005840193506120d7565b600184013560f01c3583526004830192506003840193506120d7565b600184013560f01c3560601c83526020830192506003840193506120d7565b600184013560f01c6001810135813560f81c1c8452506020830192506003840193506120d7565b600384013560f01c80600186013560f01c85378084019350506005840193506120d7565b600184013560f01c88015183526020830192506003840193506120d7565b3083526020830192506001840193506120d7565b3383526020830192506001840193505b5050611f6d565b6020850181038552806040525050509250929050565b600060405190506044810160405263095ea7b360e01b8152826004820152816024820152612129846000836044600080610a16565b6104ad5760006024820152612145846000836044600080610a16565b612162576040516340b27c2160e11b815260040160405180910390fd5b816024820152612179846000836044600080610a16565b6104ad576040516340b27c2160e11b815260040160405180910390fd5b6000604051905060048101604052630d0e30db60e41b81526121be8383836004600080610a16565b6105055760405163bdc844ed60e01b815260040160405180910390fd5b6000604051905060248101604052632e1a7d4d60e01b815281600482015261220a836000836024600080610a16565b6105055760405163c617296b60e01b815260040160405180910390fd5b60006109758230611301565b6000806020838503121561224657600080fd5b823567ffffffffffffffff8082111561225e57600080fd5b818501915085601f83011261227257600080fd5b81358181111561228157600080fd5b86602082850101111561229357600080fd5b60209290920196919550909350505050565b80356001600160a01b03811681146122bc57600080fd5b919050565b600080604083850312156122d457600080fd5b6122dd836122a5565b9150602083013580151581146122f257600080fd5b809150509250929050565b60006020828403121561230f57600080fd5b610cfd826122a5565b6000806020838503121561232b57600080fd5b823567ffffffffffffffff8082111561234357600080fd5b818501915085601f83011261235757600080fd5b81358181111561236657600080fd5b8660208260051b850101111561229357600080fd5b60005b8381101561239657818101518382015260200161237e565b50506000910152565b600081518084526123b781602086016020860161237b565b601f01601f19169290920160200192915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b8281101561242257603f1988860301845261241085835161239f565b945092850192908501906001016123f4565b5092979650505050505050565b634e487b7160e01b600052601160045260246000fd5b808201808211156109755761097561242f565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261249b57600080fd5b83018035915067ffffffffffffffff8211156124b657600080fd5b6020019150368190038213156124cb57600080fd5b9250929050565b818103818111156109755761097561242f565b600082516124f781846020870161237b565b9190910192915050565b634e487b7160e01b600052602160045260246000fd5b602081526000610cfd602083018461239f56fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212209d482eea83e3c547d6b7a7976eeee6bd73b33f50f424013561ec0af41dd695f664736f6c63430008180033