0 txs
112 calls
constructor
constructor()
functions
currentPoolId
viewfunction currentPoolId() view returns (uint256)
getContractBalance
viewfunction getContractBalance() view returns (uint256)
getPoolBalance
viewfunction getPoolBalance(uint256 poolId) view returns (uint256)
getPoolInfo
viewfunction getPoolInfo(uint256 poolId) view returns (bytes32 merkleRoot, uint256 totalAmount, uint256 withdrawnAmount, uint256 deadline, bool active)
getTotalPools
viewfunction getTotalPools() view returns (uint256)
hasClaimed
viewfunction hasClaimed(uint256 poolId, address user) view returns (bool)
isPoolExpired
viewfunction isPoolExpired(uint256 poolId) view returns (bool)
owner
viewfunction owner() view returns (address)
paused
viewfunction paused() view returns (bool)
pools
viewfunction pools(uint256) view returns (bytes32 merkleRoot, uint256 totalAmount, uint256 withdrawnAmount, uint256 withdrawalDeadline, bool active)
WITHDRAWAL_PERIOD
viewfunction WITHDRAWAL_PERIOD() view returns (uint256)
activatePool
nonpayablefunction activatePool(uint256 poolId)
claimWithMerkleProof
nonpayablefunction claimWithMerkleProof(uint256 poolId, uint256 amount, bytes32[] merkleProof)
cleanupExpiredPool
nonpayablefunction cleanupExpiredPool(uint256 poolId)
createMerklePool
nonpayablefunction createMerklePool(bytes32 merkleRoot, uint256 customDeadline) returns (uint256)
deactivatePool
nonpayablefunction deactivatePool(uint256 poolId, string reason)
emergencyWithdraw
nonpayablefunction emergencyWithdraw(uint256 poolId, string reason)
fundPool
payablefunction fundPool(uint256 poolId) payable
pause
nonpayablefunction pause()
renounceOwnership
nonpayablefunction renounceOwnership()
transferOwnership
nonpayablefunction transferOwnership(address newOwner)
unpause
nonpayablefunction unpause()
events
EmergencyWithdrawal
event EmergencyWithdrawal(uint256 indexed poolId, address indexed owner, uint256 amount, string reason, uint256 timestamp)
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Paused
event Paused(address account)
PoolActivated
event PoolActivated(uint256 indexed poolId, address indexed activator, uint256 timestamp)
PoolDeactivated
event PoolDeactivated(uint256 indexed poolId, address indexed deactivator, uint256 timestamp, string reason)
PoolFunded
event PoolFunded(uint256 indexed poolId, address indexed funder, uint256 amount, uint256 newTotalAmount, uint256 timestamp)
Unpaused
event Unpaused(address account)
WithdrawalClaimed
event WithdrawalClaimed(uint256 indexed poolId, address indexed beneficiary, uint256 amount, uint256 timestamp, uint256 remainingPoolBalance)
WithdrawalPoolCreated
event WithdrawalPoolCreated(uint256 indexed poolId, bytes32 merkleRoot, uint256 withdrawalDeadline, address indexed creator, uint256 timestamp)
errors
AlreadyClaimed
error AlreadyClaimed(address beneficiary, uint256 poolId)
InsufficientBalance
error InsufficientBalance()
InvalidMerkleRoot
error InvalidMerkleRoot()
InvalidProof
error InvalidProof()
NoFundsToWithdraw
error NoFundsToWithdraw()
PoolAlreadyExists
error PoolAlreadyExists(uint256 poolId)
PoolExpired
error PoolExpired(uint256 poolId)
PoolNotActive
error PoolNotActive(uint256 poolId)
PoolNotExpired
error PoolNotExpired(uint256 poolId)
PoolNotFound
error PoolNotFound(uint256 poolId)
TransferFailed
error TransferFailed()
ZeroAmount
error ZeroAmount()
creation bytecode
0x608060405234801561001057600080fd5b5061001a33610032565b600180556002805460ff191690556000600455610082565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6114a2806100916000396000f3fe6080604052600436106101395760003560e01c80638456cb59116100ab578063da3a5f721161006f578063da3a5f72146103ed578063e6464d6a14610400578063ebc5163b14610433578063ed1375d514610449578063f2fde38b14610469578063f4bfe2561461048957600080fd5b80638456cb591461032d578063873f6f9e146103425780638da5cb5b14610362578063ac4afa381461038a578063d3ffe67a146103d857600080fd5b80633cbb4668116100fd5780633cbb46681461028c5780633f4ba83a146102ac5780635c975abb146102c15780636215f58e146102e55780636f9fb98a14610305578063715018a61461031857600080fd5b806308f747dd146101885780630bf390b8146101aa57806310a2f82d146101d45780632f380b35146101f457806339f1e0be1461026c57600080fd5b3661018357604080513480825260208201524281830152905133916000917f731186fddf29ba4b8811ee94ce58b0296fd5375205325db2e8be38521b3fcc2c9181900360600190a3005b600080fd5b34801561019457600080fd5b506101a86101a33660046111ed565b6104a9565b005b3480156101b657600080fd5b506101c16276a70081565b6040519081526020015b60405180910390f35b3480156101e057600080fd5b506101a86101ef3660046111ed565b6105ce565b34801561020057600080fd5b5061024261020f3660046111ed565b60009081526003602081905260409091208054600182015460028301549383015460049093015491949093929160ff1690565b6040805195865260208601949094529284019190915260608301521515608082015260a0016101cb565b34801561027857600080fd5b506101a8610287366004611206565b61076c565b34801561029857600080fd5b506101a86102a7366004611206565b6107f5565b3480156102b857600080fd5b506101a861094e565b3480156102cd57600080fd5b5060025460ff165b60405190151581526020016101cb565b3480156102f157600080fd5b506101a8610300366004611282565b610960565b34801561031157600080fd5b50476101c1565b34801561032457600080fd5b506101a8610c25565b34801561033957600080fd5b506101a8610c37565b34801561034e57600080fd5b506102d561035d366004611321565b610c47565b34801561036e57600080fd5b506000546040516001600160a01b0390911681526020016101cb565b34801561039657600080fd5b506102426103a53660046111ed565b60036020819052600091825260409091208054600182015460028301549383015460049093015491939092909160ff1685565b3480156103e457600080fd5b506004546101c1565b6101a86103fb3660046111ed565b610c77565b34801561040c57600080fd5b506102d561041b3660046111ed565b60009081526003602081905260409091200154421190565b34801561043f57600080fd5b506101c160045481565b34801561045557600080fd5b506101c16104643660046111ed565b610d65565b34801561047557600080fd5b506101a861048436600461134d565b610d8e565b34801561049557600080fd5b506101c16104a4366004611368565b610e07565b6104b1610f3d565b60008181526003602052604090208115806104cd575060045482115b156104f3576040516302ad881560e41b8152600481018390526024015b60405180910390fd5b80600101546000036105555760405162461bcd60e51b815260206004820152602560248201527f506f6f6c206d7573742062652066756e646564206265666f726520616374697660448201526430ba34b7b760d91b60648201526084016104ea565b806003015442111561057d576040516303a8d1c960e11b8152600481018390526024016104ea565b60048101805460ff19166001179055604051339083907ffb7c7c8a67305e1c28c9fc2bd8da53d40d98510fafbe86fa020d1026e478973b906105c29042815260200190565b60405180910390a35050565b6105d6610f3d565b60008181526003602052604090208115806105f2575060045482115b15610613576040516302ad881560e41b8152600481018390526024016104ea565b8060030154421161063a57604051636243a8a960e11b8152600481018390526024016104ea565b60008160020154826001015461065091906113a0565b60048301805460ff191690559050801561076757600080546040516001600160a01b039091169083908381818185875af1925050503d80600081146106b1576040519150601f19603f3d011682016040523d82523d6000602084013e6106b6565b606091505b50509050806106d8576040516312171d8360e31b815260040160405180910390fd5b6000546001600160a01b03166001600160a01b0316847f32fabcfaed149e8972868b94559fb37e513cbd7632b8c5ec92e84fbd23146ba1844260405161075d929190918252606060208301819052601d908301527f506f6f6c20636c65616e75702061667465722065787069726174696f6e0000006080830152604082015260a00190565b60405180910390a3505b505050565b610774610f3d565b6000838152600360205260409020831580610790575060045484115b156107b1576040516302ad881560e41b8152600481018590526024016104ea565b60048101805460ff19169055604051339085907f5e5494f32a9aa60868cef6192afdd28f99b2604770f880db9199becf723b248c9061075d904290889088906113dc565b6107fd610f3d565b6000838152600360205260409020831580610819575060045484115b1561083a576040516302ad881560e41b8152600481018590526024016104ea565b60008160020154826001015461085091906113a0565b905080600003610873576040516367e3990d60e01b815260040160405180910390fd5b60048201805460ff19169055600080546040516001600160a01b039091169083908381818185875af1925050503d80600081146108cc576040519150601f19603f3d011682016040523d82523d6000602084013e6108d1565b606091505b50509050806108f3576040516312171d8360e31b815260040160405180910390fd5b6000546001600160a01b03166001600160a01b0316867f32fabcfaed149e8972868b94559fb37e513cbd7632b8c5ec92e84fbd23146ba18488884260405161093e94939291906113ff565b60405180910390a3505050505050565b610956610f3d565b61095e610f97565b565b610968610fe9565b610970611042565b8260000361099157604051631f2a200560e01b815260040160405180910390fd5b60008481526003602052604090208415806109ad575060045485115b156109ce576040516302ad881560e41b8152600481018690526024016104ea565b600481015460ff166109f5576040516268d63360e21b8152600481018690526024016104ea565b8060030154421115610a1d576040516303a8d1c960e11b8152600481018690526024016104ea565b33600090815260058201602052604090205460ff1615610a595760405163732750ed60e11b8152336004820152602481018690526044016104ea565b6040516bffffffffffffffffffffffff193360601b16602082015260348101859052600090605401604051602081830303815290604052805190602001209050610ad98484808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152505085549150849050611088565b610af6576040516309bde33960e01b815260040160405180910390fd5b84471015610b1757604051631e9acf1760e31b815260040160405180910390fd5b3360009081526005830160205260408120805460ff19166001179055600283018054879290610b4790849061142a565b9091555050604051600090339087908381818185875af1925050503d8060008114610b8e576040519150601f19603f3d011682016040523d82523d6000602084013e610b93565b606091505b5050905080610bb5576040516312171d8360e31b815260040160405180910390fd5b600083600201548460010154610bcb91906113a0565b60408051898152426020820152908101829052909150339089907f2adb7e8c694f4540aef6e90814ee3e206124acb4b0bb69f3e4fbe72552d518679060600160405180910390a350505050610c1f60018055565b50505050565b610c2d610f3d565b61095e600061109e565b610c3f610f3d565b61095e6110ee565b60008281526003602090815260408083206001600160a01b038516845260050190915290205460ff165b92915050565b610c7f610f3d565b34600003610ca057604051631f2a200560e01b815260040160405180910390fd5b6000818152600360205260409020811580610cbc575060045482115b15610cdd576040516302ad881560e41b8152600481018390526024016104ea565b8060030154421115610d05576040516303a8d1c960e11b8152600481018390526024016104ea565b34816001016000828254610d19919061142a565b909155505060018101546040805134815260208101929092524290820152339083907f731186fddf29ba4b8811ee94ce58b0296fd5375205325db2e8be38521b3fcc2c906060016105c2565b600081815260036020526040812060028101546001820154610d8791906113a0565b9392505050565b610d96610f3d565b6001600160a01b038116610dfb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104ea565b610e048161109e565b50565b6000610e11610f3d565b82610e2f57604051639dd854d360e01b815260040160405180910390fd5b60048054906000610e3f8361143d565b909155505060045460009081526003602052604081208481556001810182905560028101919091558215610ec857428311610ebc5760405162461bcd60e51b815260206004820152601e60248201527f446561646c696e65206d75737420626520696e2074686520667574757265000060448201526064016104ea565b60038101839055610edb565b610ed56276a7004261142a565b60038201555b6004818101805460ff1916905554600382015460408051878152602081019290925242908201523391907f39b7b63f888ea9bb5e7f3b228f005a334c005cabd9d3a13a06d5bce6ec6be91a9060600160405180910390a3505060045492915050565b6000546001600160a01b0316331461095e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104ea565b610f9f61112b565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60026001540361103b5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016104ea565b6002600155565b60025460ff161561095e5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016104ea565b6000826110958584611174565b14949350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6110f6611042565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258610fcc3390565b60025460ff1661095e5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016104ea565b600081815b84518110156111b9576111a58286838151811061119857611198611456565b60200260200101516111c1565b9150806111b18161143d565b915050611179565b509392505050565b60008183106111dd576000828152602084905260409020610d87565b5060009182526020526040902090565b6000602082840312156111ff57600080fd5b5035919050565b60008060006040848603121561121b57600080fd5b83359250602084013567ffffffffffffffff8082111561123a57600080fd5b818601915086601f83011261124e57600080fd5b81358181111561125d57600080fd5b87602082850101111561126f57600080fd5b6020830194508093505050509250925092565b6000806000806060858703121561129857600080fd5b8435935060208501359250604085013567ffffffffffffffff808211156112be57600080fd5b818701915087601f8301126112d257600080fd5b8135818111156112e157600080fd5b8860208260051b85010111156112f657600080fd5b95989497505060200194505050565b80356001600160a01b038116811461131c57600080fd5b919050565b6000806040838503121561133457600080fd5b8235915061134460208401611305565b90509250929050565b60006020828403121561135f57600080fd5b610d8782611305565b6000806040838503121561137b57600080fd5b50508035926020909101359150565b634e487b7160e01b600052601160045260246000fd5b81810381811115610c7157610c7161138a565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b8381526040602082015260006113f66040830184866113b3565b95945050505050565b8481526060602082015260006114196060830185876113b3565b905082604083015295945050505050565b80820180821115610c7157610c7161138a565b60006001820161144f5761144f61138a565b5060010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220bf415f8be34e334912f1fc25e8e148a1da22619f871636444ef85d18843b40d764736f6c63430008140033