4 txs
302 calls
constructor
constructor(address _poolManager, address _defaultRecipient)
functions
DEFAULT_ADMIN_ROLE
viewfunction DEFAULT_ADMIN_ROLE() view returns (bytes32)
defaultRecipient
viewfunction defaultRecipient() view returns (address)
FEE_DENOMINATOR
viewfunction FEE_DENOMINATOR() view returns (uint256)
getMaxRecipientsPerPool
viewfunction getMaxRecipientsPerPool() view returns (uint256)
getPoolAccumulatedFees
viewfunction getPoolAccumulatedFees(tuple poolKey, address currency) view returns (uint256)
getPoolAccumulatedFeesBoth
viewfunction getPoolAccumulatedFeesBoth(tuple poolKey) view returns (uint256 amount0, uint256 amount1)
getPoolRecipients
viewfunction getPoolRecipients(tuple poolKey) view returns (tuple[] recipients)
getRoleAdmin
viewfunction getRoleAdmin(bytes32 role) view returns (bytes32)
hasRole
viewfunction hasRole(bytes32 role, address account) view returns (bool)
hookAddress
viewfunction hookAddress() view returns (address)
maxRecipientsPerPool
viewfunction maxRecipientsPerPool() view returns (uint256)
poolFeeAccumulated
viewfunction poolFeeAccumulated(bytes32, address) view returns (uint256)
poolManager
viewfunction poolManager() view returns (address)
poolRecipients
viewfunction poolRecipients(bytes32, uint256) view returns (address recipient, uint256 feeRate, string role)
supportsInterface
viewfunction supportsInterface(bytes4 interfaceId) view returns (bool)
grantRole
nonpayablefunction grantRole(bytes32 role, address account)
renounceRole
nonpayablefunction renounceRole(bytes32 role, address account)
revokeRole
nonpayablefunction revokeRole(bytes32 role, address account)
setDefaultRecipient
nonpayablefunction setDefaultRecipient(address newRecipient)
setHookAddress
nonpayablefunction setHookAddress(address newHookAddress)
setMaxRecipientsPerPool
nonpayablefunction setMaxRecipientsPerPool(uint256 newMax)
setRecipients
nonpayablefunction setRecipients(tuple[] poolKeys, tuple[][] recipientsArray)
setSinglePoolRecipients
nonpayablefunction setSinglePoolRecipients(tuple poolKey, tuple[] recipients)
trackPoolFee
nonpayablefunction trackPoolFee(bytes32 poolId, address currency, uint256 amount)
unlockCallback
nonpayablefunction unlockCallback(bytes data) returns (bytes)
withdrawPoolFees
nonpayablefunction withdrawPoolFees(tuple[] poolKeys)
events
DefaultRecipientUpdated
event DefaultRecipientUpdated(address indexed oldRecipient, address indexed newRecipient)
FeeDistributed
event FeeDistributed(bytes32 indexed poolId, address indexed currency, address indexed recipient, uint256 amount, string role)
FeesWithdrawn
event FeesWithdrawn(address indexed currency, uint256 amount, address indexed recipient)
HookAddressUpdated
event HookAddressUpdated(address indexed oldHook, address indexed newHook)
MaxRecipientsUpdated
event MaxRecipientsUpdated(uint256 newMax)
PoolFeeTracked
event PoolFeeTracked(bytes32 indexed poolId, address indexed currency, uint256 amount)
RecipientsCleared
event RecipientsCleared(bytes32 indexed poolId)
RecipientSet
event RecipientSet(bytes32 indexed poolId, address indexed recipient, uint256 feeRate, uint256 index)
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)
errors
ArrayLengthMismatch
error ArrayLengthMismatch()
InvalidAmount
error InvalidAmount()
InvalidFeeRate
error InvalidFeeRate()
InvalidRecipient
error InvalidRecipient()
NotPoolManager
error NotPoolManager()
OnlyHook
error OnlyHook()
creation bytecode
0x60a03461013d57601f6122df38819003918201601f19168301916001600160401b0383118484101761014157808492604094855283398101031261013d578051906001600160a01b038216820361013d57602001516001600160a01b038116919082900361013d5760805260018055600a600655801561012e57600280546001600160a01b031916919091179055335f9081525f805160206122bf833981519152602052604090205460ff16156100de575b604051612169908161015682396080518181816101d80152818161042e015281816106170152611b920152f35b335f8181525f805160206122bf83398151915260205260408120805460ff1916600117905581907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a46100b1565b634e46966960e11b5f5260045ffd5b5f80fd5b634e487b7160e01b5f52604160045260245ffdfe6080806040526004361015610012575f80fd5b5f3560e01c90816301ffc9a714611509575080630b5e8df9146114e15780631f8b6ee81461149d578063248a9ca31461146b57806329df6257146103595780632f2ff15d146113b457806332a3cf961461138c57806336568abe146112fa5780634580e47214611288578063458633221461121f5780634f7a6c3c146111ac57806364c3f0e314610da65780636d643d4514610c7e578063818f496c146108a45780638978bdbf1461084257806391d14854146107fa57806391dd7346146105c6578063a217fddf146105ac578063b1ac6e651461051d578063c5d39cb6146104bd578063d547741f14610479578063d73792a91461045d578063dc4c90d314610419578063e7a6139d14610376578063e9b34913146103595763fbcbbe6a1461013a575f80fd5b34610288576020366003190112610288576004356001600160401b0381116102885761016a903690600401611708565b90600260015414610314576002600155604051918060408401602080860152526060830191905f5b818110610297576101d35f866101b1818803601f198101835282611623565b604051809381926348c8949160e01b83526020600484015260248301906116e4565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561028c57610213575b60018055005b3d805f833e6102228183611623565b810190602081830312610288578051906001600160401b038211610288570181601f82011215610288578051610257816118ae565b926102656040519485611623565b81845260208284010111610288575f928160208094018483015e0101528061020d565b5f80fd5b6040513d5f823e3d90fd5b90919260a0806001928380831b036102ae88611588565b1681528380831b036102c260208901611588565b16602082015262ffffff6102d860408901611768565b1660408201526102ea60608801611778565b60020b60608201528380831b0361030360808901611588565b166080820152019401929101610192565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b34610288575f366003190112610288576020600654604051908152f35b346102885760603660031901126102885760043561039261155c565b6003546044359291906001600160a01b0316330361040a5760207f81cfe8eba247097352563591bb4ca8fcd339786f5d6eac65a8f1b1ec6482a2f591835f526004825260405f2060018060a01b0382165f52825260405f206103f58682546118a1565b90556040519485526001600160a01b031693a3005b635a91834f60e01b5f5260045ffd5b34610288575f366003190112610288576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b34610288575f3660031901126102885760206040516127108152f35b34610288576040366003190112610288576104bb60043561049861155c565b906104b66104b1825f525f602052600160405f20015490565b611a2d565b611a6f565b005b3461028857366003190160c081126102885760a0136102885760a4356001600160a01b03811681036102885760a06104f436611786565b205f52600460205260405f209060018060a01b03165f52602052602060405f2054604051908152f35b346102885760a03660031901126102885760a061053936611786565b20805f52600460205260405f2060043560018060a01b03811681036102885760018060a01b03165f5260205260405f2054905f52600460205260405f20906024359160018060a01b038316830361028857826040935060018060a01b03165f52602052815f205482519182526020820152f35b34610288575f3660031901126102885760206040515f8152f35b34610288576020366003190112610288576004356001600160401b03811161028857366023820112156102885780600401356001600160401b038111610288578101906024820191368311610288577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036107eb5760209082900312610288576024810135906001600160401b03821161028857018160438201121561028857602481013561067e81611876565b9261068c6040519485611623565b8184526020602460a08287019402850101019281841161028857604401915b8383106107d157845f5b81518110156107a5578060a06106cd60019385611b27565b5120828060a01b036106df8386611b27565b51511690838060a01b0360206106f58588611b27565b5101515f83815260046020908152604080832060a08a901b8a90038881168552925280832054949093169081168252919020549093909180610774575b505080610743575b505050016106b5565b61074e908383611b3b565b5f52600460205260405f2090838060a01b03165f526020525f604081205583808061073a565b61077f908285611b3b565b825f52600460205260405f2090868060a01b03165f526020525f60408120558680610732565b6107cd6040516107b6602082611623565b5f81526040519182916020835260208301906116e4565b0390f35b602060a0916107e0848661180d565b8152019201916106ab565b63570c108560e11b5f5260045ffd5b346102885760403660031901126102885761081361155c565b6004355f525f60205260405f209060018060a01b03165f52602052602060ff60405f2054166040519015158152f35b346102885760203660031901126102885760043561085e6118c9565b8015610895576020817f625e33d0247c41d7d9e8e3333a170ede206ce082fa83f578f61ff578f5a4fc0b92600655604051908152a1005b63162908e360e11b5f5260045ffd5b3461028857366003190160c081126102885760a0136102885760a4356001600160401b038111610288576108dc903690600401611738565b906108e56119b6565b6006548211610895575f805b838210610c3057612710915011610c215760a061090f36600461180d565b2090815f52600560205260405f208054905f815581610b80575b5050817f55262d6272d5af7f4d0d8405e7bedc7a352dfb9b505efa14e42a817c19102ea45f80a25f5b83811061095b57005b825f52600560205260405f20610972828685611aef565b908054600160401b811015610b6c576109909160018201815561159c565b610b59576002906001600160a01b036109a88461188d565b82546001600160a01b031916911617815560208301356001820155019060408101359036819003601e190182121561028857018035906001600160401b03821161028857813603602082011361028857610a0283546115b5565b601f8111610b1e575b505f90601f8311600114610ab1579180610a3f9260019695945f92610aa3575b50508160011b915f199060031b1c19161790565b90555b610a55610a50828786611aef565b61188d565b847fc4f2795edc45f09a21e0fe3cde3cba9846bf12fc67b0ad65176bcf3fb4f2270760406020610a86868b8a611aef565b0135938151948552856020860152868060a01b031693a301610952565b602092500101358980610a2b565b601f19831691845f5260205f20925f5b818110610b04575091600196959492918388959310610ae8575b505050811b019055610a42565b01602001355f19600384901b60f8161c19169055888080610adb565b602083850181013586556001909501949283019201610ac1565b610b4990845f5260205f20601f850160051c81019160208610610b4f575b601f0160051c0190611b11565b87610a0b565b9091508190610b3c565b634e487b7160e01b5f525f60045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b81600302916003830403610c0d575f5260205f20908101905b8181101561092957805f600392555f600182015560028101610bbb81546115b5565b9081610bca575b505001610b99565b81601f5f9311600114610be15750555b8680610bc2565b81835260208320610bfd91601f0160051c810190600101611b11565b8082528160208120915555610bda565b634e487b7160e01b5f52601160045260245ffd5b630adad23360e31b5f5260045ffd5b6001600160a01b03610c46610a50848787611aef565b1615610c6f57610c676001916020610c5f858888611aef565b0135906118a1565b9101906108f1565b634e46966960e11b5f5260045ffd5b346102885760a03660031901126102885760a0610c9a36611786565b205f52600560205260405f20805490610cb282611876565b91610cc06040519384611623565b8083526020830180925f5260205f205f915b838310610d6157848660405191829160208301906020845251809152604083019060408160051b85010192915f905b828210610d1057505050500390f35b91936001919395506020610d518192603f198a8203018652606060408a51878060a01b038151168452858101518685015201519181604082015201906116e4565b9601920192018594939192610d01565b60036020600192604051610d74816115ed565b848060a01b0386541681528486015483820152610d9360028701611644565b6040820152815201920192019190610cd2565b34610288576040366003190112610288576004356001600160401b03811161028857610dd6903690600401611708565b6024356001600160401b03811161028857610df5903690600401611738565b9190610dff6119b6565b82820361119d57909136829003601e190191905f5b848110156104bb5781811015611189578060051b830135848112156102885783018035906001600160401b038211610288576020018160051b36038113610288576006548211610895575f805b83821061115257612710915011610c215760a0610e82368286028b0161180d565b2090815f52600560205260405f208054905f8155816110c5575b5050817f55262d6272d5af7f4d0d8405e7bedc7a352dfb9b505efa14e42a817c19102ea45f80a25f5b838110610ed85750505050600101610e14565b825f52600560205260405f20610eef828685611aef565b908054600160401b811015610b6c57610f0d9160018201815561159c565b610b59576002906001600160a01b03610f258461188d565b82546001600160a01b031916911617815560208301356001820155019060408101359036819003601e190182121561028857018035906001600160401b03821161028857813603602082011361028857610f7f83546115b5565b601f8111611095575b505f90601f8311600114611028579180610fbb9260019695945f9261101a5750508160011b915f199060031b1c19161790565b90555b610fcc610a50828786611aef565b847fc4f2795edc45f09a21e0fe3cde3cba9846bf12fc67b0ad65176bcf3fb4f2270760406020610ffd868b8a611aef565b0135938151948552856020860152868060a01b031693a301610ec5565b602092500101358f80610a2b565b601f19831691845f5260205f20925f5b81811061107b57509160019695949291838895931061105f575b505050811b019055610fbe565b01602001355f19600384901b60f8161c191690558e8080611052565b919360206001819282888801013581550195019201611038565b6110bf90845f5260205f20601f850160051c81019160208610610b4f57601f0160051c0190611b11565b8d610f88565b81600302916003830403610c0d575f5260205f20908101905b81811015610e9c57805f600392555f60018201556002810161110081546115b5565b908161110f575b5050016110de565b81601f5f93116001146111265750555b8c80611107565b8183526020832061114291601f0160051c810190600101611b11565b808252816020812091555561111f565b6001600160a01b03611168610a50848787611aef565b1615610c6f576111816001916020610c5f858888611aef565b910190610e61565b634e487b7160e01b5f52603260045260245ffd5b63512509d360e11b5f5260045ffd5b34610288576020366003190112610288576111c5611572565b6111cd6118c9565b6001600160a01b03168015610c6f57600280546001600160a01b0319811683179091556001600160a01b03167fb7d98556d0cd03d304805aa0c454f1b3d608930011691c4533090f1db295d9335f80a3005b3461028857602036600319011261028857611238611572565b6112406118c9565b600380546001600160a01b039283166001600160a01b0319821681179092559091167fd8e16b0405d2475f5f1929d7180cbc126b0c7447afdff6237714f6b1ad3f6fd85f80a3005b34610288576040366003190112610288576024356004355f52600560205260405f20908154811015610288576112bd9161159c565b5060018060a01b038154166107cd6112dc600260018501549401611644565b604051938493845260208401526060604084015260608301906116e4565b346102885760403660031901126102885761131361155c565b336001600160a01b0382160361132f576104bb90600435611a6f565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b34610288575f366003190112610288576003546040516001600160a01b039091168152602090f35b34610288576040366003190112610288576004356113d061155c565b906113e96104b1825f525f602052600160405f20015490565b5f818152602081815260408083206001600160a01b038616845290915290205460ff161561141357005b5f818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4005b346102885760203660031901126102885760206114956004355f525f602052600160405f20015490565b604051908152f35b34610288576040366003190112610288576114b661155c565b6004355f52600460205260405f209060018060a01b03165f52602052602060405f2054604051908152f35b34610288575f366003190112610288576002546040516001600160a01b039091168152602090f35b34610288576020366003190112610288576004359063ffffffff60e01b821680920361028857602091637965db0b60e01b811490811561154b575b5015158152f35b6301ffc9a760e01b14905083611544565b602435906001600160a01b038216820361028857565b600435906001600160a01b038216820361028857565b35906001600160a01b038216820361028857565b8054821015611189575f52600360205f20910201905f90565b90600182811c921680156115e3575b60208310146115cf57565b634e487b7160e01b5f52602260045260245ffd5b91607f16916115c4565b606081019081106001600160401b03821117610b6c57604052565b60a081019081106001600160401b03821117610b6c57604052565b90601f801991011681019081106001600160401b03821117610b6c57604052565b9060405191825f825492611657846115b5565b80845293600181169081156116c2575060011461167e575b5061167c92500383611623565b565b90505f9291925260205f20905f915b8183106116a657505090602061167c928201015f61166f565b602091935080600191548385890101520191019091849261168d565b90506020925061167c94915060ff191682840152151560051b8201015f61166f565b805180835260209291819084018484015e5f828201840152601f01601f1916010190565b9181601f84011215610288578235916001600160401b0383116102885760208085019460a0850201011161028857565b9181601f84011215610288578235916001600160401b038311610288576020808501948460051b01011161028857565b359062ffffff8216820361028857565b35908160020b820361028857565b60a0906003190112610288576040519061179f82611608565b816004356001600160a01b03811681036102885781526024356001600160a01b038116810361028857602082015260443562ffffff811681036102885760408201526064358060020b8103610288576060820152608435906001600160a01b03821682036102885760800152565b91908260a09103126102885760405161182581611608565b608061187181839561183681611588565b855261184460208201611588565b602086015261185560408201611768565b604086015261186660608201611778565b606086015201611588565b910152565b6001600160401b038111610b6c5760051b60200190565b356001600160a01b03811681036102885790565b91908201809211610c0d57565b6001600160401b038111610b6c57601f01601f191660200190565b335f9081527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5602052604090205460ff161561190157565b6119b26020611992601161191433611f06565b6037846119205f611fec565b6040519687947f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000828701528051918291018587015e8401907001034b99036b4b9b9b4b733903937b6329607d1b84830152805192839101604883015e01015f838201520301601f198101835282611623565b60405162461bcd60e51b81526020600482015291829160248301906116e4565b0390fd5b335f9081527fb497279b420fc1abc102de7c767f45c11a9d845cd29c3b80bf35d2bfc8427745602052604090205460ff16156119ee57565b6119b260206119926011611a0133611f06565b6037846119207f281f82fd978e2c38e850625548719a07130d224a4f528f7e52b269729749a11f611fec565b5f8181526020818152604080832033845290915290205460ff1615611a4f5750565b602061199260116119b293603784611920611a6933611f06565b93611fec565b5f818152602081815260408083206001600160a01b038616845290915290205460ff16611a9a575050565b5f818152602081815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4565b91908110156111895760051b81013590605e1981360301821215610288570190565b818110611b1c575050565b5f8155600101611b11565b80518210156111895760209160051b010190565b929190925f90805f52600560205260405f20928354611b5981611876565b94611b676040519687611623565b81865260208601905f5260205f205f915b838310611eb0575050506001600160a01b038781169491507f000000000000000000000000000000000000000000000000000000000000000016803b1561028857604051637a94c56560e11b81523060048201528560248201528360448201525f8160648183865af1801561028c57611e9b575b508192825b8751811015611d3757611c126020611c09838b611b27565b5101518361208e565b80611c21575b50600101611bf1565b946001600160a01b03611c34838b611b27565b515116843b15611d3357604051630b0d9c0960e01b81526001600160a01b038d8116600483015291909116602482015260448101879052858160648183895af18015611d285788889493888d948d94611d00575b5050611cb76001967fe5ec5765798b7b1a69b6a46188f90a86b953dda23dcd9ef066bf2b69ee748d8c926118a1565b996040611cd787898060a01b03611cce828a611b27565b51511697611b27565b51015190611cf760405192839283526040602084015260408301906116e4565b0390a490611c18565b919596509350611d139250839150611623565b611d2457908888888894885f611c88565b8480fd5b6040513d88823e3d90fd5b8580fd5b50969790919294955084870394878611611e87578703611d93575b50506002546040519586526001600160a01b0316947f87044da2612407bc001bb0985725dcc651a0dc71eaabfd1d7e8617ca85a8c19c9350602092509050a3565b6002546001600160a01b031690823b15611e8357604051630b0d9c0960e01b81526001600160a01b03918216600482015291166024820152604481018590529082908290606490829084905af18015611e78579085939291611e5a575b50507fe5ec5765798b7b1a69b6a46188f90a86b953dda23dcd9ef066bf2b69ee748d8c608060018060a01b036002541694604051908152604060208201526011604082015270191959985d5b1d17dc9958da5c1a595b9d607a1b6060820152a45f80808080611d52565b8180939450611e6891611623565b611e755790818492611df0565b80fd5b6040513d84823e3d90fd5b8380fd5b634e487b7160e01b84526011600452602484fd5b611ea89192505f90611623565b5f905f611bec565b60036020600192604051611ec3816115ed565b848060a01b0386541681528486015483820152611ee260028701611644565b6040820152815201920192019190611b78565b908151811015611189570160200190565b611f10602a6118ae565b90611f1e6040519283611623565b602a8252611f2c602a6118ae565b6020830190601f19013682378251156111895760309053815160011015611189576078602183015360295b60018111611fab5750611f675790565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b90600f81166010811015611189576f181899199a1a9b1b9c1cb0b131b232b360811b901a611fd98385611ef5565b5360041c908015610c0d575f1901611f57565b611ff660426118ae565b906120046040519283611623565b6042825261201260426118ae565b6020830190601f19013682378251156111895760309053815160011015611189576078602183015360415b6001811161204d5750611f675790565b90600f81166010811015611189576f181899199a1a9b1b9c1cb0b131b232b360811b901a61207b8385611ef5565b5360041c908015610c0d575f190161203d565b5f1982820982820291828083109203918083039214612128578161271011156120eb577fbc01a36e2eb1c432ca57a786c226809d495182a9930be0ded288ce703afb7e9193612710910990828211900360fc1b910360041c170290565b60405162461bcd60e51b81526020600482015260156024820152744d6174683a206d756c446976206f766572666c6f7760581b6044820152606490fd5b50506127109150049056fea264697066735822122000e6e768356c6bb18f0211a47d236978a408d38c3732aa5e829d315ccbe2dfcf64736f6c634300081a0033ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5000000000000000000000000498581ff718922c3f8e6a244956af099b2652b2b0000000000000000000000008078254008819bcfd9301fd68886433c2f81b792