Address Contract Partially Verified
Address
0xc8805CeBD927941a3B26e2EDCed20d666Fb118Ba
Balance
0 ETH
Nonce
1
Code Size
12189 bytes
Creator
0xaB066655...5483 at tx 0x2fb36e42...b011f2
Indexed Transactions
0
Contract Bytecode
12189 bytes
0x608060405234801561001057600080fd5b506004361061023d5760003560e01c80638a22744a1161013b578063de5f9866116100b8578063f1127ed81161007c578063f1127ed814610745578063f617e4101461079f578063fa7eee391461085d578063fc0c546a1461091b578063ffe4aa00146109235761023d565b8063de5f986614610649578063e228f32a14610651578063e7242fa014610677578063eaa18f2714610735578063ec43d75c1461073d5761023d565b8063bc25cf77116100ff578063bc25cf7714610511578063c5c7fcb514610537578063cf8149a01461053f578063d09bba0214610565578063d901fc1d1461058b5761023d565b80638a22744a146104735780638da5cb5b14610499578063b4b5ea57146104bd578063ba659254146104e3578063bbaa08f5146105095761023d565b8063534fd09f116101c95780636b3703c31161018d5780636b3703c3146103d257806376db0696146103da578063782d6fe1146104195780637fc31c0614610445578063892a38551461044d5761023d565b8063534fd09f1461036257806355b04e701461037f57806359b9c1ab146103875780636167ae45146103a457806361d09fdf146103ac5761023d565b806333af619b1161021057806333af619b146102d057806335856e96146102f45780634162ef28146102fc5780634357eb6d146103525780634d5ce9ed1461035a5761023d565b806313af4035146102425780631e83409a1461026a5780632989ee921461029057806330ef8ca3146102c8575b600080fd5b6102686004803603602081101561025857600080fd5b50356001600160a01b0316610949565b005b6102686004803603602081101561028057600080fd5b50356001600160a01b03166109f1565b6102b6600480360360208110156102a657600080fd5b50356001600160a01b0316610cde565b60408051918252519081900360200190f35b6102b6610d02565b6102d8610d08565b604080516001600160601b039092168252519081900360200190f35b6102d8610d17565b6103226004803603602081101561031257600080fd5b50356001600160a01b0316610d2d565b604080516001600160601b03948516815292909316602083015263ffffffff168183015290519081900360600190f35b6102d8610d63565b6102b6610d72565b6102686004803603602081101561037857600080fd5b5035610d78565b6102b6610eaf565b6102686004803603602081101561039d57600080fd5b5035610eb5565b6102b6610fec565b6102b6600480360360208110156103c257600080fd5b50356001600160a01b0316610ff2565b6102d861103d565b610400600480360360208110156103f057600080fd5b50356001600160a01b0316611053565b6040805163ffffffff9092168252519081900360200190f35b6102d86004803603604081101561042f57600080fd5b506001600160a01b03813516906020013561106b565b6102b66112b0565b6102d86004803603602081101561046357600080fd5b50356001600160a01b03166112b6565b6102b66004803603602081101561048957600080fd5b50356001600160a01b03166112c2565b6104a16112ed565b604080516001600160a01b039092168252519081900360200190f35b6102d8600480360360208110156104d357600080fd5b50356001600160a01b03166112fc565b6102d8600480360360208110156104f957600080fd5b50356001600160a01b0316611344565b6102b6611350565b6102686004803603602081101561052757600080fd5b50356001600160a01b0316611356565b6102b6611470565b6102b66004803603602081101561055557600080fd5b50356001600160a01b0316611476565b6102b66004803603602081101561057b57600080fd5b50356001600160a01b03166114ac565b610268600480360360408110156105a157600080fd5b810190602081018135600160201b8111156105bb57600080fd5b8201836020820111156105cd57600080fd5b803590602001918460208302840111600160201b831117156105ee57600080fd5b919390929091602081019035600160201b81111561060b57600080fd5b82018360208201111561061d57600080fd5b803590602001918460208302840111600160201b8311171561063e57600080fd5b5090925090506114d0565b6102d86118a7565b6103226004803603602081101561066757600080fd5b50356001600160a01b03166119a1565b6102686004803603604081101561068d57600080fd5b810190602081018135600160201b8111156106a757600080fd5b8201836020820111156106b957600080fd5b803590602001918460208302840111600160201b831117156106da57600080fd5b919390929091602081019035600160201b8111156106f757600080fd5b82018360208201111561070957600080fd5b803590602001918460208302840111600160201b8311171561072a57600080fd5b5090925090506119d7565b6102b6611d77565b6102b6611e31565b6107776004803603604081101561075b57600080fd5b5080356001600160a01b0316906020013563ffffffff16611e37565b6040805163ffffffff90931683526001600160601b0390911660208301528051918290030190f35b610268600480360360408110156107b557600080fd5b810190602081018135600160201b8111156107cf57600080fd5b8201836020820111156107e157600080fd5b803590602001918460208302840111600160201b8311171561080257600080fd5b919390929091602081019035600160201b81111561081f57600080fd5b82018360208201111561083157600080fd5b803590602001918460208302840111600160201b8311171561085257600080fd5b509092509050611e69565b6102686004803603604081101561087357600080fd5b810190602081018135600160201b81111561088d57600080fd5b82018360208201111561089f57600080fd5b803590602001918460208302840111600160201b831117156108c057600080fd5b919390929091602081019035600160201b8111156108dd57600080fd5b8201836020820111156108ef57600080fd5b803590602001918460208302840111600160201b8311171561091057600080fd5b50909250905061211f565b6104a16123f5565b6102b66004803603602081101561093957600080fd5b50356001600160a01b0316612419565b6002546001600160a01b03163314610997576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600280546001600160a01b0319166001600160a01b03838116919091179182905560408051929091168252517f50146d0e3c60aa1d17a70635b05494f864e86144a2201275021014fbf08bafe2916020908290030190a150565b336109fa612f30565b506001600160a01b038116600090815260056020908152604091829020825160608101845290546001600160601b038082168352600160601b82041692820192909252600160c01b90910463ffffffff1691810191909152610a5a612f30565b506001600160a01b0382166000908152600660209081526040808320815160608101835290546001600160601b038082168352600160601b820416828501819052600160c01b90910463ffffffff1692820192909252918401519192610ad283610ac3886112b6565b6001600160601b031690612444565b90506000610ae383610ac389611344565b9050610af86001600160601b038516836124a6565b6001600160a01b03881660009081526005602052604090208054600160601b600160c01b031916600160601b6001600160601b0393841602179055610b3f908416826124a6565b6001600160a01b03881660009081526006602052604090208054600160601b600160c01b031916600160601b6001600160601b03938416810291909117909155600354610b909291900416836124a6565b60038054600160601b600160c01b031916600160601b6001600160601b0393841602179055600454610bc39116826124a6565b600480546001600160601b0319166001600160601b03928316179055600090610bee908416836124a6565b6001600160a01b03891660009081526001602052604090205490915063ffffffff16610c395785518751610c39916000918b91610c34916001600160601b0316906124a6565b6124fc565b610c45886000836124fc565b610c797f000000000000000000000000d502f487e1841fdc805130e13eae80c61186bc988a836001600160601b0316612680565b604080516001600160a01b03808b1682528b1660208201526001600160601b03808616828401528416606082015290517f865ca08d59f5cb456e85cd2f7ef63664ea4f73327414e9d8152c4158b0e946459181900360800190a1505050505050505050565b6001600160a01b03166000908152600560205260409020546001600160601b031690565b600b5481565b6003546001600160601b031681565b600254600160a01b90046001600160601b031681565b6005602052600090815260409020546001600160601b0380821691600160601b810490911690600160c01b900463ffffffff1683565b6004546001600160601b031681565b600e5481565b6002546001600160a01b03163314610dc6576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600b54600e5414610e14576040805162461bcd60e51b8152602060048201526013602482015272151497d4d513d417d053149150511657d4d155606a1b604482015290519081900360640190fd5b438110158015610e255750600b5481105b610e70576040805162461bcd60e51b81526020600482015260176024820152762a292fa4a72b20a624a22fa12627a1a5afa72aa6a122a960491b604482015290519081900360640190fd5b600c81905543600e556040805182815290517f934cc9b36aa2ef3a7649683f0d03ccf35d83c04aeb4c57d18c2a85171351a2ff9181900360200190a150565b600d5481565b6002546001600160a01b03163314610f03576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600854600d5414610f51576040805162461bcd60e51b8152602060048201526013602482015272151497d4d513d417d053149150511657d4d155606a1b604482015290519081900360640190fd5b438110158015610f62575060085481105b610fad576040805162461bcd60e51b81526020600482015260176024820152762a292fa4a72b20a624a22fa12627a1a5afa72aa6a122a960491b604482015290519081900360640190fd5b600981905543600d556040805182815290517f13d912bb286abe264da9c0961908c7b9674ef54c5e86955eb906169fe1d620b39181900360200190a150565b600a5481565b6001600160a01b03811660009081526005602052604081205461103790600160601b90046001600160601b0316611028846112b6565b6001600160601b0316906127df565b92915050565b600354600160601b90046001600160601b031681565b60016020526000908152604090205463ffffffff1681565b6001600160a01b03821660009081526005602090815260408083205460068352818420546001909352908320546001600160601b039182169290911690839063ffffffff1615806110e257506001600160a01b03861660009081526020818152604080832083805290915290205463ffffffff1685105b15611170576001600160a01b038616600090815260056020526040902054600160c01b900463ffffffff168510611129576111266001600160601b038216846124a6565b90505b6001600160a01b038616600090815260066020526040902054600160c01b900463ffffffff16851061116b576111686001600160601b038216836124a6565b90505b61117d565b61117a868661281b565b90505b6008546009541480156111935750600b54600c54145b156111a2579250611037915050565b84600d541180156111b4575084600e54115b156111c3579250611037915050565b600080600d54871061122f5760006111e86007546008546127df90919063ffffffff16565b905060006112036009546008546127df90919063ffffffff16565b905061122a6112258361121f6001600160601b038b1685612a4c565b90612aaa565b612b05565b935050505b600e54871061128d576000611251600a54600b546127df90919063ffffffff16565b9050600061126c600c54600b546127df90919063ffffffff16565b90506112886112258361121f6001600160601b038a1685612a4c565b925050505b6112a481610ac36001600160601b03861685612444565b98975050505050505050565b60075481565b60006110378243612b58565b6001600160a01b0316600090815260056020526040902054600160601b90046001600160601b031690565b6002546001600160a01b031681565b6001600160a01b0316600090815260208181526040808320600183528184205463ffffffff90811660001901168452909152902054600160201b90046001600160601b031690565b60006110378243612be2565b60095481565b6002546001600160a01b031633146113a4576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b6001600160a01b0381166113f1576040805162461bcd60e51b815260206004820152600f60248201526e54525f414444524553535f5a45524f60881b604482015290519081900360640190fd5b60006113fb611d77565b90506114287f000000000000000000000000d502f487e1841fdc805130e13eae80c61186bc988383612680565b604080516001600160a01b03841681526020810183905281517f5e99aaf6d3588fb2497fde044168e8c046704a3223559cfe107f8f94b42cefdd929181900390910190a15050565b600c5481565b6001600160a01b03811660009081526006602052604081205461103790600160601b90046001600160601b031661102884611344565b6001600160a01b03166000908152600660205260409020546001600160601b031690565b6002546001600160a01b0316331461151e576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600b54600e541461156c576040805162461bcd60e51b8152602060048201526013602482015272151497d4d513d417d053149150511657d4d155606a1b604482015290519081900360640190fd5b8281146115b5576040805162461bcd60e51b815260206004820152601260248201527154525f494e56414c49445f4c454e4754485360701b604482015290519081900360640190fd5b60005b838110156117a95760008585838181106115ce57fe5b905060200201356001600160a01b0316905060008484848181106115ee57fe5b6001600160a01b038516600090815260066020908152604090912054910292909201356001600160601b03908116935090911690508061166d576040805162461bcd60e51b8152602060048201526015602482015274151497d0531313d0d0551253d397d393d517d4d155605a1b604482015290519081900360640190fd5b816001600160601b031661168084611344565b6001600160601b031611156116d6576040805162461bcd60e51b8152602060048201526017602482015276151497d0531313d0d0551253d397d513d3d7d4d3505313604a1b604482015290519081900360640190fd5b6003546117019083906116f2906001600160601b031684612444565b6001600160601b0316906124a6565b600380546001600160601b03199081166001600160601b03938416179091556001600160a01b0385166000908152600660209081526040808320805490941687861617938490556001909152902054600160601b9091049091169063ffffffff161561178057611780846000610c346001600160601b03861685612444565b611799600085610c346001600160601b03871685612444565b5050600190920191506115b89050565b506117b26118a7565b6001600160601b03167f000000000000000000000000d502f487e1841fdc805130e13eae80c61186bc986001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561182857600080fd5b505afa15801561183c573d6000803e3d6000fd5b505050506040513d602081101561185257600080fd5b505110156118a1576040805162461bcd60e51b815260206004820152601760248201527654525f494e53554646494349454e545f42414c414e434560481b604482015290519081900360640190fd5b50505050565b6000806118c16007546008546127df90919063ffffffff16565b905060006118dc6007546009546127df90919063ffffffff16565b6002549091506000906119099061122590859061121f90600160a01b90046001600160601b031686612a4c565b90506000611924600a54600b546127df90919063ffffffff16565b9050600061193f600a54600c546127df90919063ffffffff16565b6003549091506000906119659061122590859061121f906001600160601b031686612a4c565b600454600354919250611996916001600160601b0391821691610ac391600160601b900481169082908916866124a6565b965050505050505090565b6006602052600090815260409020546001600160601b0380821691600160601b810490911690600160c01b900463ffffffff1683565b6002546001600160a01b03163314611a25576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600b54600e5414611a73576040805162461bcd60e51b8152602060048201526013602482015272151497d4d513d417d053149150511657d4d155606a1b604482015290519081900360640190fd5b828114611abc576040805162461bcd60e51b815260206004820152601260248201527154525f494e56414c49445f4c454e4754485360701b604482015290519081900360640190fd5b6000611ac743612c5d565b90506000805b85811015611c41576000878783818110611ae357fe5b602090810292909201356001600160a01b031660008181526006909352604090922054919250506001600160601b031615611b61576040805162461bcd60e51b8152602060048201526019602482015278151497d0531313d0d0551253d397d053149150511657d4d155603a1b604482015290519081900360640190fd5b6000868684818110611b6f57fe5b905060200201356001600160601b031690506000816001600160601b031611611bd4576040805162461bcd60e51b815260206004820152601260248201527154525f414c4c4f434154494f4e5f5a45524f60701b604482015290519081900360640190fd5b6001600160a01b0382166000908152600660205260409020805463ffffffff808816600160c01b0263ffffffff60c01b196001600160601b038087166001600160601b0319909516949094171617909255611c35919086169083906124a616565b93505050600101611acd565b50600354611c58906001600160601b0316826124a6565b600380546001600160601b0319166001600160601b0392909216919091179055611c806118a7565b6001600160601b03167f000000000000000000000000d502f487e1841fdc805130e13eae80c61186bc986001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611cf657600080fd5b505afa158015611d0a573d6000803e3d6000fd5b505050506040513d6020811015611d2057600080fd5b50511015611d6f576040805162461bcd60e51b815260206004820152601760248201527654525f494e53554646494349454e545f42414c414e434560481b604482015290519081900360640190fd5b505050505050565b6000611e2c611d846118a7565b6001600160601b03167f000000000000000000000000d502f487e1841fdc805130e13eae80c61186bc986001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015611dfa57600080fd5b505afa158015611e0e573d6000803e3d6000fd5b505050506040513d6020811015611e2457600080fd5b5051906127df565b905090565b60085481565b600060208181529281526040808220909352908152205463ffffffff811690600160201b90046001600160601b031682565b6002546001600160a01b03163314611eb7576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600854600d5414611f05576040805162461bcd60e51b8152602060048201526013602482015272151497d4d513d417d053149150511657d4d155606a1b604482015290519081900360640190fd5b828114611f4e576040805162461bcd60e51b815260206004820152601260248201527154525f494e56414c49445f4c454e4754485360701b604482015290519081900360640190fd5b6000611f5943612c5d565b90506000805b858110156120d3576000878783818110611f7557fe5b602090810292909201356001600160a01b031660008181526005909352604090922054919250506001600160601b031615611ff3576040805162461bcd60e51b8152602060048201526019602482015278151497d0531313d0d0551253d397d053149150511657d4d155603a1b604482015290519081900360640190fd5b600086868481811061200157fe5b905060200201356001600160601b031690506000816001600160601b031611612066576040805162461bcd60e51b815260206004820152601260248201527154525f414c4c4f434154494f4e5f5a45524f60701b604482015290519081900360640190fd5b6001600160a01b0382166000908152600560205260409020805463ffffffff808816600160c01b0263ffffffff60c01b196001600160601b038087166001600160601b03199095169490941716179092556120c7919086169083906124a616565b93505050600101611f5f565b506002546120f190600160a01b90046001600160601b0316826124a6565b600260146101000a8154816001600160601b0302191690836001600160601b03160217905550611c806118a7565b6002546001600160a01b0316331461216d576040805162461bcd60e51b815260206004820152600c60248201526b2a292fa327a92124a22222a760a11b604482015290519081900360640190fd5b600854600d54146121bb576040805162461bcd60e51b8152602060048201526013602482015272151497d4d513d417d053149150511657d4d155606a1b604482015290519081900360640190fd5b828114612204576040805162461bcd60e51b815260206004820152601260248201527154525f494e56414c49445f4c454e4754485360701b604482015290519081900360640190fd5b60005b838110156117a957600085858381811061221d57fe5b905060200201356001600160a01b03169050600084848481811061223d57fe5b6001600160a01b038516600090815260056020908152604090912054910292909201356001600160601b0390811693509091169050806122bc576040805162461bcd60e51b8152602060048201526015602482015274151497d0531313d0d0551253d397d393d517d4d155605a1b604482015290519081900360640190fd5b816001600160601b03166122cf846112b6565b6001600160601b03161115612325576040805162461bcd60e51b8152602060048201526017602482015276151497d0531313d0d0551253d397d513d3d7d4d3505313604a1b604482015290519081900360640190fd5b6002546123489083906116f290600160a01b90046001600160601b031684612444565b600280546001600160a01b03908116600160a01b6001600160601b0394851602179091558416600090815260056020908152604080832080546001600160601b0319168786161790819055600190925290912054600160601b9091049091169063ffffffff16156123cc576123cc846000610c346001600160601b03861685612444565b6123e5600085610c346001600160601b03871685612444565b5050600190920191506122079050565b7f000000000000000000000000d502f487e1841fdc805130e13eae80c61186bc9881565b6001600160a01b0316600090815260066020526040902054600160601b90046001600160601b031690565b6000826001600160601b0316826001600160601b031611156124a0576040805162461bcd60e51b815260206004820152601060248201526f534d5f5355425f554e444552464c4f5760801b604482015290519081900360640190fd5b50900390565b8181016001600160601b038084169082161015611037576040805162461bcd60e51b815260206004820152600f60248201526e534d5f4144445f4f564552464c4f5760881b604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b0316148061252357506001600160601b038116155b1561252d5761267b565b6001600160a01b03831615612603576001600160a01b03831660009081526001602052604090205463ffffffff16806125a5576040805162461bcd60e51b8152602060048201526015602482015274564f5f494e53554646494349454e545f564f54455360581b604482015290519081900360640190fd5b6001600160a01b03841660009081526020818152604080832063ffffffff60001986018116855292528220546001600160601b03600160201b9091041691906125f2908390869061244416565b90506125ff868483612cac565b5050505b6001600160a01b0382161561267b576001600160a01b03821660009081526001602090815260408083205483835281842063ffffffff9182166000198101831686529352908320549192600160201b9092046001600160601b0316919061266e90839086906124a616565b9050611d6f858483612cac565b505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b602083106126fd5780518252601f1990920191602091820191016126de565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461275f576040519150601f19603f3d011682016040523d82523d6000602084013e612764565b606091505b5091509150818015612792575080511580612792575080806020019051602081101561278f57600080fd5b50515b6127d8576040805162461bcd60e51b8152602060048201526012602482015271151217d514905394d1915497d1905253115160721b604482015290519081900360640190fd5b5050505050565b600061281483836040518060400160405280601081526020016f534d5f5355425f554e444552464c4f5760801b815250612e82565b9392505050565b6000438210612869576040805162461bcd60e51b81526020600482015260156024820152741593d7d393d517d6515517d1115511549352539151605a1b604482015290519081900360640190fd5b6001600160a01b03831660009081526001602052604090205463ffffffff1680612897576000915050611037565b6001600160a01b03841660009081526020818152604080832063ffffffff60001986018116855292529091205416831061290f576001600160a01b0384166000908152602081815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b03169050611037565b6001600160a01b03841660009081526020818152604080832083805290915290205463ffffffff16831015612948576000915050611037565b600060001982015b8163ffffffff168163ffffffff161115612a0957600282820363ffffffff1604810361297a612f50565b506001600160a01b03871660009081526020818152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b031691810191909152908714156129e4576020015194506110379350505050565b805163ffffffff168711156129fb57819350612a02565b6001820392505b5050612950565b506001600160a01b03851660009081526020818152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b6000811580612a6757505080820282828281612a6457fe5b04145b611037576040805162461bcd60e51b815260206004820152600f60248201526e534d5f4d554c5f4f564552464c4f5760881b604482015290519081900360640190fd5b6000808211612af1576040805162461bcd60e51b815260206004820152600e60248201526d534d5f4449565f42595f5a45524f60901b604482015290519081900360640190fd5b6000828481612afc57fe5b04949350505050565b6000600160601b8210612b54576040805162461bcd60e51b815260206004820152601260248201527149545f455843454544535f39365f4249545360701b604482015290519081900360640190fd5b5090565b60006007548211612b6b57506000611037565b6000612b85600754612b7f85600954612f1a565b906127df565b90506000612ba06007546008546127df90919063ffffffff16565b6001600160a01b038616600090815260056020526040902054909150612bd99061122590839061121f906001600160601b031686612a4c565b95945050505050565b6000600a548211612bf557506000611037565b6000612c09600a54612b7f85600c54612f1a565b90506000612c24600a54600b546127df90919063ffffffff16565b6001600160a01b038616600090815260066020526040902054909150612bd99061122590839061121f906001600160601b031686612a4c565b6000600160201b8210612b54576040805162461bcd60e51b8152602060048201526012602482015271564f5f455843454544535f33325f4249545360701b604482015290519081900360640190fd5b6000612cb743612c5d565b6001600160a01b038516600090815260208181526040808320600019880163ffffffff9081168552925290912054919250600160201b9091046001600160601b031690841615801590612d3957506001600160a01b03851660009081526020818152604080832063ffffffff6000198901811685529252909120548382169116145b15612d96576001600160a01b038516600090815260208181526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b03861602179055612e2e565b60408051808201825263ffffffff84811682526001600160601b0386811660208085019182526001600160a01b038b1660008181528083528781208c87168252835287812096518754945163ffffffff19958616918816919091176fffffffffffffffffffffffff000000001916600160201b9190961602949094179095559382526001938490529390208054909316918701161790555b604080516001600160601b0380841682528516602082015281516001600160a01b038816927f664ef4a22338e827df5b675ec1747eac10c2ea611e1c575f3d96c38a2e24231e928290030190a25050505050565b8183038184821115612f125760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612ed7578181015183820152602001612ebf565b50505050905090810190601f168015612f045780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b6000818310612f295781612814565b5090919050565b604080516060810182526000808252602082018190529181019190915290565b60408051808201909152600080825260208201529056fea2646970667358221220ef28f3c1d55105e8e91af984cf04968c3ef61e3bea6471c9b91b4246bfaca23064736f6c63430007050033
Verified Source Code Partial Match
Compiler: v0.7.5+commit.eb77ed08
EVM: istanbul
Optimization: Yes (200 runs)
Math.sol 38 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
// a library for performing various math operations
library Math {
function min(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x < y ? x : y;
}
function max(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = x > y ? x : y;
}
function min32(uint32 x, uint32 y) internal pure returns (uint32 z) {
z = x < y ? x : y;
}
function max32(uint32 x, uint32 y) internal pure returns (uint32 z) {
z = x > y ? x : y;
}
// babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)
function sqrt(uint256 y) internal pure returns (uint256 z) {
if (y > 3) {
z = y;
uint256 x = y / 2 + 1;
while (x < z) {
z = x;
x = (y / x + x) / 2;
}
} else if (y != 0) {
z = 1;
}
}
}
Votes.sol 117 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// CODE COPIED FROM COMPOUND PROTOCOL (https://github.com/compound-finance/compound-protocol/tree/b9b14038612d846b83f8a009a82c38974ff2dcfe)
// Copyright 2020 Compound Labs, Inc.
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// CODE WAS SLIGHTLY MODIFIED
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
import 'SafeMath.sol';
contract Votes {
using SafeMath for uint96;
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;
mapping(address => uint32) public checkpointsLength;
event DelegateVotesChanged(address indexed account, uint96 oldVotes, uint96 newVotes);
function getCurrentVotes(address account) external view returns (uint96) {
// out of bounds access is safe and returns 0 votes
return checkpoints[account][checkpointsLength[account] - 1].votes;
}
function _getPriorVotes(address account, uint256 blockNumber) internal view returns (uint96) {
require(blockNumber < block.number, 'VO_NOT_YET_DETERMINED');
uint32 n = checkpointsLength[account];
if (n == 0) {
return 0;
}
if (checkpoints[account][n - 1].fromBlock <= blockNumber) {
return checkpoints[account][n - 1].votes;
}
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = n - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2;
Checkpoint memory checkpoint = checkpoints[account][center];
if (checkpoint.fromBlock == blockNumber) {
return checkpoint.votes;
} else if (checkpoint.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _updateVotes(
address giver,
address receiver,
uint96 votes
) internal {
if (giver == receiver || votes == 0) {
return;
}
if (giver != address(0)) {
uint32 n = checkpointsLength[giver];
require(n > 0, 'VO_INSUFFICIENT_VOTES');
// out of bounds access is safe and returns 0 votes
uint96 oldVotes = checkpoints[giver][n - 1].votes;
uint96 newVotes = oldVotes.sub96(votes);
_writeCheckpoint(giver, n, newVotes);
}
if (receiver != address(0)) {
uint32 n = checkpointsLength[receiver];
// out of bounds access is safe and returns 0 votes
uint96 oldVotes = checkpoints[receiver][n - 1].votes;
uint96 newVotes = oldVotes.add96(votes);
_writeCheckpoint(receiver, n, newVotes);
}
}
function _writeCheckpoint(
address account,
uint32 n,
uint96 votes
) internal {
uint32 blockNumber = safe32(block.number);
// out of bounds access is safe and returns 0 votes
uint96 oldVotes = checkpoints[account][n - 1].votes;
if (n > 0 && checkpoints[account][n - 1].fromBlock == blockNumber) {
checkpoints[account][n - 1].votes = votes;
} else {
checkpoints[account][n] = Checkpoint(blockNumber, votes);
checkpointsLength[account] = n + 1;
}
emit DelegateVotesChanged(account, oldVotes, votes);
}
function safe32(uint256 n) internal pure returns (uint32) {
require(n < 2**32, 'VO_EXCEEDS_32_BITS');
return uint32(n);
}
}
IERC20.sol 31 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
}
SafeMath.sol 88 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, 'SM_ADD_OVERFLOW');
}
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
z = sub(x, y, 'SM_SUB_UNDERFLOW');
}
function sub(
uint256 x,
uint256 y,
string memory message
) internal pure returns (uint256 z) {
require((z = x - y) <= x, message);
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, 'SM_MUL_OVERFLOW');
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, 'SM_DIV_BY_ZERO');
uint256 c = a / b;
return c;
}
function ceil_div(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = div(a, b);
if (c == mul(a, b)) {
return c;
} else {
return add(c, 1);
}
}
function safe32(uint256 n) internal pure returns (uint32) {
require(n < 2**32, 'IS_EXCEEDS_32_BITS');
return uint32(n);
}
function add96(uint96 a, uint96 b) internal pure returns (uint96 c) {
c = a + b;
require(c >= a, 'SM_ADD_OVERFLOW');
}
function sub96(uint96 a, uint96 b) internal pure returns (uint96) {
require(b <= a, 'SM_SUB_UNDERFLOW');
return a - b;
}
function mul96(uint96 x, uint96 y) internal pure returns (uint96 z) {
require(y == 0 || (z = x * y) / y == x, 'SM_MUL_OVERFLOW');
}
function div96(uint96 a, uint96 b) internal pure returns (uint96) {
require(b > 0, 'SM_DIV_BY_ZERO');
uint96 c = a / b;
return c;
}
function add32(uint32 a, uint32 b) internal pure returns (uint32 c) {
c = a + b;
require(c >= a, 'SM_ADD_OVERFLOW');
}
function sub32(uint32 a, uint32 b) internal pure returns (uint32) {
require(b <= a, 'SM_SUB_UNDERFLOW');
return a - b;
}
function mul32(uint32 x, uint32 y) internal pure returns (uint32 z) {
require(y == 0 || (z = x * y) / y == x, 'SM_MUL_OVERFLOW');
}
function div32(uint32 a, uint32 b) internal pure returns (uint32) {
require(b > 0, 'SM_DIV_BY_ZERO');
uint32 c = a / b;
return c;
}
}
TransferHelper.sol 43 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TH_APPROVE_FAILED');
}
function safeTransfer(
address token,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TH_TRANSFER_FAILED');
}
function safeTransferFrom(
address token,
address from,
address to,
uint256 value
) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TH_TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint256 value) internal {
(bool success, ) = to.call{ value: value }(new bytes(0));
require(success, 'TH_ETH_TRANSFER_FAILED');
}
}
IntegralTimeRelease.sol 320 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
import 'Math.sol';
import 'SafeMath.sol';
import 'TransferHelper.sol';
import 'IERC20.sol';
import 'IIntegralTimeRelease.sol';
import 'Votes.sol';
contract IntegralTimeRelease is IIntegralTimeRelease, Votes {
using SafeMath for uint256;
using SafeMath for uint96;
address public immutable token;
address public owner;
uint96 public option1TotalAllocations;
uint96 public option2TotalAllocations;
uint96 public option1TotalClaimed;
uint96 public option2TotalClaimed;
struct Option {
uint96 allocation;
uint96 claimed;
uint32 initBlock;
}
mapping(address => Option) public option1;
mapping(address => Option) public option2;
uint256 public option1StartBlock;
uint256 public option1EndBlock;
uint256 public option1StopBlock;
uint256 public option2StartBlock;
uint256 public option2EndBlock;
uint256 public option2StopBlock;
uint256 public option1StopSetBlock;
uint256 public option2StopSetBlock;
constructor(
address _token,
uint256 _option1StartBlock,
uint256 _option1EndBlock,
uint256 _option2StartBlock,
uint256 _option2EndBlock
) {
owner = msg.sender;
emit OwnerSet(owner);
token = _token;
_setOption1Timeframe(_option1StartBlock, _option1EndBlock);
_setOption2Timeframe(_option2StartBlock, _option2EndBlock);
}
function setOwner(address _owner) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
owner = _owner;
emit OwnerSet(owner);
}
function _setOption1Timeframe(uint256 _option1StartBlock, uint256 _option1EndBlock) internal {
require(_option1EndBlock > _option1StartBlock, 'INVALID_OPTION1_TIME_FRAME');
option1StartBlock = _option1StartBlock;
option1EndBlock = _option1EndBlock;
option1StopBlock = _option1EndBlock;
option1StopSetBlock = _option1EndBlock;
}
function _setOption2Timeframe(uint256 _option2StartBlock, uint256 _option2EndBlock) internal {
require(_option2EndBlock > _option2StartBlock, 'INVALID_OPTION2_TIME_FRAME');
option2StartBlock = _option2StartBlock;
option2EndBlock = _option2EndBlock;
option2StopBlock = _option2EndBlock;
option2StopSetBlock = _option2EndBlock;
}
function initOption1Allocations(address[] calldata wallets, uint96[] calldata amounts) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(option1StopSetBlock == option1EndBlock, 'TR_STOP_ALREADY_SET');
require(wallets.length == amounts.length, 'TR_INVALID_LENGTHS');
uint32 initBlock = safe32(block.number);
uint96 total = 0;
for (uint256 i = 0; i < wallets.length; i++) {
address wallet = wallets[i];
require(option1[wallet].allocation == 0, 'TR_ALLOCATION_ALREADY_SET');
uint96 amount = amounts[i];
require(amount > 0, 'TR_ALLOCATION_ZERO');
option1[wallet].allocation = amount;
option1[wallet].initBlock = initBlock;
total = total.add96(amount);
}
option1TotalAllocations = option1TotalAllocations.add96(total);
require(IERC20(token).balanceOf(address(this)) >= getTokensLeft(), 'TR_INSUFFICIENT_BALANCE');
}
function initOption2Allocations(address[] calldata wallets, uint96[] calldata amounts) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(option2StopSetBlock == option2EndBlock, 'TR_STOP_ALREADY_SET');
require(wallets.length == amounts.length, 'TR_INVALID_LENGTHS');
uint32 initBlock = safe32(block.number);
uint96 total = 0;
for (uint256 i = 0; i < wallets.length; i++) {
address wallet = wallets[i];
require(option2[wallet].allocation == 0, 'TR_ALLOCATION_ALREADY_SET');
uint96 amount = amounts[i];
require(amount > 0, 'TR_ALLOCATION_ZERO');
option2[wallet].allocation = amount;
option2[wallet].initBlock = initBlock;
total = total.add96(amount);
}
option2TotalAllocations = option2TotalAllocations.add96(total);
require(IERC20(token).balanceOf(address(this)) >= getTokensLeft(), 'TR_INSUFFICIENT_BALANCE');
}
function updateOption1Allocations(address[] calldata wallets, uint96[] calldata amounts) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(option1StopSetBlock == option1EndBlock, 'TR_STOP_ALREADY_SET');
require(wallets.length == amounts.length, 'TR_INVALID_LENGTHS');
for (uint256 i = 0; i < wallets.length; i++) {
address wallet = wallets[i];
uint96 amount = amounts[i];
uint96 oldAmount = option1[wallet].allocation;
require(oldAmount > 0, 'TR_ALLOCATION_NOT_SET');
require(getReleasedOption1(wallet) <= amount, 'TR_ALLOCATION_TOO_SMALL');
option1TotalAllocations = option1TotalAllocations.sub96(oldAmount).add96(amount);
option1[wallet].allocation = amount;
uint96 claimed = option1[wallet].claimed;
if (checkpointsLength[wallet] != 0) {
_updateVotes(wallet, address(0), oldAmount.sub96(claimed));
}
_updateVotes(address(0), wallet, amount.sub96(claimed));
}
require(IERC20(token).balanceOf(address(this)) >= getTokensLeft(), 'TR_INSUFFICIENT_BALANCE');
}
function updateOption2Allocations(address[] calldata wallets, uint96[] calldata amounts) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(option2StopSetBlock == option2EndBlock, 'TR_STOP_ALREADY_SET');
require(wallets.length == amounts.length, 'TR_INVALID_LENGTHS');
for (uint256 i = 0; i < wallets.length; i++) {
address wallet = wallets[i];
uint96 amount = amounts[i];
uint96 oldAmount = option2[wallet].allocation;
require(oldAmount > 0, 'TR_ALLOCATION_NOT_SET');
require(getReleasedOption2(wallet) <= amount, 'TR_ALLOCATION_TOO_SMALL');
option2TotalAllocations = option2TotalAllocations.sub96(oldAmount).add96(amount);
option2[wallet].allocation = amount;
uint96 claimed = option2[wallet].claimed;
if (checkpointsLength[wallet] != 0) {
_updateVotes(wallet, address(0), oldAmount.sub96(claimed));
}
_updateVotes(address(0), wallet, amount.sub96(claimed));
}
require(IERC20(token).balanceOf(address(this)) >= getTokensLeft(), 'TR_INSUFFICIENT_BALANCE');
}
function getTokensLeft() public view returns (uint96) {
uint256 allocationTime1 = option1EndBlock.sub(option1StartBlock);
uint256 claimableTime1 = option1StopBlock.sub(option1StartBlock);
uint96 allocation1 = safe96(uint256(option1TotalAllocations).mul(claimableTime1).div(allocationTime1));
uint256 allocationTime2 = option2EndBlock.sub(option2StartBlock);
uint256 claimableTime2 = option2StopBlock.sub(option2StartBlock);
uint96 allocation2 = safe96(uint256(option2TotalAllocations).mul(claimableTime2).div(allocationTime2));
return allocation1.add96(allocation2).sub96(option1TotalClaimed).sub96(option2TotalClaimed);
}
function setOption1StopBlock(uint256 _option1StopBlock) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(option1StopSetBlock == option1EndBlock, 'TR_STOP_ALREADY_SET');
require(_option1StopBlock >= block.number && _option1StopBlock < option1EndBlock, 'TR_INVALID_BLOCK_NUMBER');
option1StopBlock = _option1StopBlock;
option1StopSetBlock = block.number;
emit Option1StopBlockSet(_option1StopBlock);
}
function setOption2StopBlock(uint256 _option2StopBlock) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(option2StopSetBlock == option2EndBlock, 'TR_STOP_ALREADY_SET');
require(_option2StopBlock >= block.number && _option2StopBlock < option2EndBlock, 'TR_INVALID_BLOCK_NUMBER');
option2StopBlock = _option2StopBlock;
option2StopSetBlock = block.number;
emit Option2StopBlockSet(_option2StopBlock);
}
function skim(address to) external {
require(msg.sender == owner, 'TR_FORBIDDEN');
require(to != address(0), 'TR_ADDRESS_ZERO');
uint256 amount = getExcessTokens();
TransferHelper.safeTransfer(token, to, amount);
emit Skim(to, amount);
}
function getExcessTokens() public view returns (uint256) {
return IERC20(token).balanceOf(address(this)).sub(getTokensLeft());
}
function getReleasedOption1(address wallet) public view returns (uint96) {
return _getReleasedOption1ForBlock(wallet, block.number);
}
function _getReleasedOption1ForBlock(address wallet, uint256 blockNumber) internal view returns (uint96) {
if (blockNumber <= option1StartBlock) {
return 0;
}
uint256 elapsed = Math.min(blockNumber, option1StopBlock).sub(option1StartBlock);
uint256 allocationTime = option1EndBlock.sub(option1StartBlock);
return safe96(uint256(option1[wallet].allocation).mul(elapsed).div(allocationTime));
}
function getReleasedOption2(address wallet) public view returns (uint96) {
return _getReleasedOption2ForBlock(wallet, block.number);
}
function _getReleasedOption2ForBlock(address wallet, uint256 blockNumber) internal view returns (uint96) {
if (blockNumber <= option2StartBlock) {
return 0;
}
uint256 elapsed = Math.min(blockNumber, option2StopBlock).sub(option2StartBlock);
uint256 allocationTime = option2EndBlock.sub(option2StartBlock);
return safe96(uint256(option2[wallet].allocation).mul(elapsed).div(allocationTime));
}
function getClaimableOption1(address wallet) external view returns (uint256) {
return getReleasedOption1(wallet).sub(option1[wallet].claimed);
}
function getClaimableOption2(address wallet) external view returns (uint256) {
return getReleasedOption2(wallet).sub(option2[wallet].claimed);
}
function getOption1Allocation(address wallet) external view returns (uint256) {
return option1[wallet].allocation;
}
function getOption1Claimed(address wallet) external view returns (uint256) {
return option1[wallet].claimed;
}
function getOption2Allocation(address wallet) external view returns (uint256) {
return option2[wallet].allocation;
}
function getOption2Claimed(address wallet) external view returns (uint256) {
return option2[wallet].claimed;
}
function claim(address to) external {
address sender = msg.sender;
Option memory _option1 = option1[sender];
Option memory _option2 = option2[sender];
uint96 _option1Claimed = _option1.claimed;
uint96 _option2Claimed = _option2.claimed;
uint96 option1Amount = getReleasedOption1(sender).sub96(_option1Claimed);
uint96 option2Amount = getReleasedOption2(sender).sub96(_option2Claimed);
option1[sender].claimed = _option1Claimed.add96(option1Amount);
option2[sender].claimed = _option2Claimed.add96(option2Amount);
option1TotalClaimed = option1TotalClaimed.add96(option1Amount);
option2TotalClaimed = option2TotalClaimed.add96(option2Amount);
uint96 totalClaimed = option1Amount.add96(option2Amount);
if (checkpointsLength[sender] == 0) {
_updateVotes(address(0), sender, _option1.allocation.add96(_option2.allocation));
}
_updateVotes(sender, address(0), totalClaimed);
TransferHelper.safeTransfer(token, to, totalClaimed);
emit Claim(sender, to, option1Amount, option2Amount);
}
function safe96(uint256 n) internal pure returns (uint96) {
require(n < 2**96, 'IT_EXCEEDS_96_BITS');
return uint96(n);
}
function getPriorVotes(address account, uint256 blockNumber) external view returns (uint96) {
uint96 option1TotalAllocation = option1[account].allocation;
uint96 option2TotalAllocation = option2[account].allocation;
uint96 votes = 0;
if (checkpointsLength[account] == 0 || checkpoints[account][0].fromBlock > blockNumber) {
if (option1[account].initBlock <= blockNumber) {
votes = votes.add96(option1TotalAllocation);
}
if (option2[account].initBlock <= blockNumber) {
votes = votes.add96(option2TotalAllocation);
}
} else {
votes = _getPriorVotes(account, blockNumber);
}
if (option1StopBlock == option1EndBlock && option2StopBlock == option2EndBlock) {
return votes;
}
if (option1StopSetBlock > blockNumber && option2StopSetBlock > blockNumber) {
return votes;
}
uint96 lockedAllocation1;
uint96 lockedAllocation2;
if (blockNumber >= option1StopSetBlock) {
uint256 allocationTime = option1EndBlock.sub(option1StartBlock);
uint256 haltedTime = option1EndBlock.sub(option1StopBlock);
lockedAllocation1 = safe96(uint256(option1TotalAllocation).mul(haltedTime).div(allocationTime));
}
if (blockNumber >= option2StopSetBlock) {
uint256 allocationTime = option2EndBlock.sub(option2StartBlock);
uint256 haltedTime = option2EndBlock.sub(option2StopBlock);
lockedAllocation2 = safe96(uint256(option2TotalAllocation).mul(haltedTime).div(allocationTime));
}
return votes.sub96(lockedAllocation1).sub96(lockedAllocation2);
}
}
IIntegralTimeRelease.sol 12 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Deployed with donations via Gitcoin GR9
pragma solidity 0.7.5;
interface IIntegralTimeRelease {
event OwnerSet(address owner);
event Claim(address claimer, address receiver, uint256 option1Amount, uint256 option2Amount);
event Skim(address to, uint256 amount);
event Option1StopBlockSet(uint256 option1StopBlock);
event Option2StopBlockSet(uint256 option2StopBlock);
}
Read Contract
checkpoints 0xf1127ed8 → uint32, uint96
checkpointsLength 0x76db0696 → uint32
getClaimableOption1 0x61d09fdf → uint256
getClaimableOption2 0xcf8149a0 → uint256
getCurrentVotes 0xb4b5ea57 → uint96
getExcessTokens 0xeaa18f27 → uint256
getOption1Allocation 0x2989ee92 → uint256
getOption1Claimed 0x8a22744a → uint256
getOption2Allocation 0xd09bba02 → uint256
getOption2Claimed 0xffe4aa00 → uint256
getPriorVotes 0x782d6fe1 → uint96
getReleasedOption1 0x892a3855 → uint96
getReleasedOption2 0xba659254 → uint96
getTokensLeft 0xde5f9866 → uint96
option1 0x4162ef28 → uint96, uint96, uint32
option1EndBlock 0xec43d75c → uint256
option1StartBlock 0x7fc31c06 → uint256
option1StopBlock 0xbbaa08f5 → uint256
option1StopSetBlock 0x55b04e70 → uint256
option1TotalAllocations 0x35856e96 → uint96
option1TotalClaimed 0x6b3703c3 → uint96
option2 0xe228f32a → uint96, uint96, uint32
option2EndBlock 0x30ef8ca3 → uint256
option2StartBlock 0x6167ae45 → uint256
option2StopBlock 0xc5c7fcb5 → uint256
option2StopSetBlock 0x4d5ce9ed → uint256
option2TotalAllocations 0x33af619b → uint96
option2TotalClaimed 0x4357eb6d → uint96
owner 0x8da5cb5b → address
token 0xfc0c546a → address
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
claim 0x1e83409a
address to
initOption1Allocations 0xf617e410
address[] wallets
uint96[] amounts
initOption2Allocations 0xe7242fa0
address[] wallets
uint96[] amounts
setOption1StopBlock 0x59b9c1ab
uint256 _option1StopBlock
setOption2StopBlock 0x534fd09f
uint256 _option2StopBlock
setOwner 0x13af4035
address _owner
skim 0xbc25cf77
address to
updateOption1Allocations 0xfa7eee39
address[] wallets
uint96[] amounts
updateOption2Allocations 0xd901fc1d
address[] wallets
uint96[] amounts
Recent Transactions
No transactions found for this address