Address Contract Verified
Address
0xB0caA67c712D96809f2aBAF2c95369EF942CE8Cb
Balance
0 ETH
Nonce
1
Code Size
13266 bytes
Creator
0x1FcCC097...1Fb7 at tx 0xce210c54...d71b17
Indexed Transactions
0
Contract Bytecode
13266 bytes
0x60806040526004361061015f5760003560e01c8063517afbcf116100c0578063d5cd7d2011610074578063d88ff1f411610059578063d88ff1f414610422578063e30c397814610464578063fc0c546a1461049157600080fd5b8063d5cd7d2014610422578063d7ace6ce1461044457600080fd5b80638129fc1c116100a55780638129fc1c146103ac57806382dabb21146103c15780638da5cb5b146103f557600080fd5b8063517afbcf1461036357806352d1902d1461039757600080fd5b80633659cfe61161011757806341d1de97116100fc57806341d1de97146102f65780634e71e0c81461033b5780634f1ef2861461035057600080fd5b80633659cfe6146102a95780633685ffe7146102c957600080fd5b80630f208beb116101485780630f208beb146101c6578063263a53621461025157806332a9caba1461028957600080fd5b8063078dfbe7146101645780630d6f141314610186575b600080fd5b34801561017057600080fd5b5061018461017f366004612b83565b6104c5565b005b34801561019257600080fd5b506101b36101a1366004612bcc565b60336020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101d257600080fd5b506102286101e1366004612be7565b60346020908152600092835260408084209091529082529020546fffffffffffffffffffffffffffffffff8082169170010000000000000000000000000000000090041682565b604080516fffffffffffffffffffffffffffffffff9384168152929091166020830152016101bd565b34801561025d57600080fd5b506101b361026c366004612c1a565b603560209081526000928352604080842090915290825290205481565b34801561029557600080fd5b506101846102a4366004612c1a565b6106b5565b3480156102b557600080fd5b506101846102c4366004612bcc565b6108b1565b3480156102d557600080fd5b506102e96102e4366004612c90565b610ab6565b6040516101bd9190612ce3565b34801561030257600080fd5b50610316610311366004612d27565b610bb0565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101bd565b34801561034757600080fd5b50610184610be7565b61018461035e366004612de7565b610cfd565b34801561036f57600080fd5b506103167f00000000000000000000000044087e105137a5095c008aab6a6530182821f2f081565b3480156103a357600080fd5b506101b3610ef3565b3480156103b857600080fd5b50610184610fdf565b3480156103cd57600080fd5b506103167f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021081565b34801561040157600080fd5b506000546103169073ffffffffffffffffffffffffffffffffffffffff1681565b34801561042e57600080fd5b506104376111d7565b6040516101bd9190612eab565b34801561045057600080fd5b5061018461045f366004612ef9565b611246565b34801561047057600080fd5b506001546103169073ffffffffffffffffffffffffffffffffffffffff1681565b34801561049d57600080fd5b506103167f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b60005473ffffffffffffffffffffffffffffffffffffffff16331461054b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b811561066f5773ffffffffffffffffffffffffffffffffffffffff83161515806105725750805b6105d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f4f776e61626c653a207a65726f206164647265737300000000000000000000006044820152606401610542565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808716939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff85167fffffffffffffffffffffffff000000000000000000000000000000000000000091821617909155600180549091169055505050565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555b505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610736576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610542565b61073f81611534565b1580610749575080155b15610783576040517f1da2a47b00000000000000000000000000000000000000000000000000000000815260048101829052602401610542565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260336020526040902054156107f8576040517fbfa6835d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83166004820152602401610542565b61080562093a8082612fcb565b73ffffffffffffffffffffffffffffffffffffffff831660008181526033602052604080822093909355603280546001810182559082527f11df491316f14931039edfd4f8964c9a443b862f02d4c7611d18c2bc4e6ff6970180547fffffffffffffffffffffffff00000000000000000000000000000000000000001683179055915183927f0c98febfffcec480c66a977e13f14bafdb5199ea9603591a0715b0cabe0c3ae291a35050565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b0caa67c712d96809f2abaf2c95369ef942ce8cb163003610976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610542565b7f000000000000000000000000b0caa67c712d96809f2abaf2c95369ef942ce8cb73ffffffffffffffffffffffffffffffffffffffff166109eb7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610542565b610a978161154a565b60408051600080825260208201909252610ab3918391906115cb565b50565b60608167ffffffffffffffff811115610ad157610ad1612d40565b604051908082528060200260200182016040528015610afa578160200160208202803683370190505b50905060005b82811015610b5d57610b38848483818110610b1d57610b1d612fde565b9050602002016020810190610b329190612bcc565b866117ca565b828281518110610b4a57610b4a612fde565b6020908102919091010152600101610b00565b50610ba984610b6b83611b37565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48169190611b74565b9392505050565b60328181548110610bc057600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60015473ffffffffffffffffffffffffffffffffffffffff16338114610c69576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c657220213d2070656e64696e67206f776e65726044820152606401610542565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff9092167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179055600180549091169055565b73ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b0caa67c712d96809f2abaf2c95369ef942ce8cb163003610dc2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f64656c656761746563616c6c00000000000000000000000000000000000000006064820152608401610542565b7f000000000000000000000000b0caa67c712d96809f2abaf2c95369ef942ce8cb73ffffffffffffffffffffffffffffffffffffffff16610e377f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614610eda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060448201527f6163746976652070726f787900000000000000000000000000000000000000006064820152608401610542565b610ee38261154a565b610eef828260016115cb565b5050565b60003073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b0caa67c712d96809f2abaf2c95369ef942ce8cb1614610fba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610542565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b6001547501000000000000000000000000000000000000000000900460ff161580801561102857506001805474010000000000000000000000000000000000000000900460ff16105b806110595750303b15801561105957506001805474010000000000000000000000000000000000000000900460ff16145b6110e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610542565b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1674010000000000000000000000000000000000000000179055801561116b57600180547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1675010000000000000000000000000000000000000000001790555b611173611c01565b8015610ab357600180547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff1681556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150565b6060603280548060200260200160405190810160405280929190818152602001828054801561123c57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311611211575b5050505050905090565b60005473ffffffffffffffffffffffffffffffffffffffff1633146112c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610542565b8584811415806112d75750828114155b1561130e576040517fa24a13a600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805b8281101561140b576113918a8a8381811061132f5761132f612fde565b90506020020160208101906113449190612bcc565b89898481811061135657611356612fde565b9050602002810190611368919061300d565b89898681811061137a5761137a612fde565b905060200281019061138c919061300d565b611cd8565b6113ef8686838181106113a6576113a6612fde565b90506020028101906113b8919061300d565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611b3792505050565b6113f99083613075565b915061140481613088565b9050611312565b5082811461144f576040517fc4b307b70000000000000000000000000000000000000000000000000000000081526004810182905260248101849052604401610542565b6040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018290527f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff16906323b872dd906064016020604051808303816000875af11580156114e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150c91906130c0565b50505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600061154362093a808361310c565b1592915050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ab3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610542565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156115fe576106b083611f91565b8273ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611683575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016820190925261168091810190613120565b60015b61170f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201527f6f6e206973206e6f7420555550530000000000000000000000000000000000006064820152608401610542565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81146117be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f7860448201527f6961626c655555494400000000000000000000000000000000000000000000006064820152608401610542565b506106b083838361209b565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081205483908203611842576040517f04e263b000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610542565b600061184e85856120c6565b905080600003611862576000925050611b30565b73ffffffffffffffffffffffffffffffffffffffff858116600090815260336020908152604080832054603483528184209489168452939091529020546fffffffffffffffffffffffffffffffff80821691700100000000000000000000000000000000900416828211156118de576000955050505050611b30565b60006118eb898984612255565b905080600084900361191c5781516119079062093a8090613139565b6fffffffffffffffffffffffffffffffff1693505b848411611ab1578561192f846001613075565b101561199857815181516fffffffffffffffffffffffffffffffff91821691160361196c576119698a8a611964866001613075565b612255565b90505b80516fffffffffffffffffffffffffffffffff16841115611998578261199181613088565b9350508091505b60208201516000906119aa90866123f2565b6fffffffffffffffffffffffffffffffff1690508015611a9c5760006119d08c87612457565b73ffffffffffffffffffffffffffffffffffffffff8d1660009081526035602090815260408083208a8452909152812054919250908290611a119085613162565b611a1b9190613179565b9050611a27818c613075565b9a508b73ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff167ffe7c5fc89da23a432c91f264decb100ab9d08ab7b14650c3cdb9b6b4f84a60e98984604051611a91929190918252602082015260400190565b60405180910390a350505b611aa962093a8086613075565b94505061191c565b50506040805180820182526fffffffffffffffffffffffffffffffff9384168152918316602080840191825273ffffffffffffffffffffffffffffffffffffffff808c16600090815260348352848120918c16815291529190912091519051831670010000000000000000000000000000000002921691909117905550505b5092915050565b600080805b8351811015611b3057838181518110611b5757611b57612fde565b602002602001015182611b6a9190613075565b9150600101611b3c565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526106b0908490612612565b6001547501000000000000000000000000000000000000000000900460ff16611cac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610542565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001633179055565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260336020526040812054869103611d4f576040517f04e263b000000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82166004820152602401610542565b838214611d88576040517fa2e95bbe00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff861660009081526033602052604081205490611db761271e565b6fffffffffffffffffffffffffffffffff16905060005b84811015611f1b576000888883818110611dea57611dea612fde565b9050602002013590506000878784818110611e0757611e07612fde565b60200291909101359150611e20905062093a8086613075565b8214611e62576040517ffb3880ba0000000000000000000000000000000000000000000000000000000081526004810186905260248101839052604401610542565b73ffffffffffffffffffffffffffffffffffffffff8b16600090815260356020908152604080832085845290915281208054839290611ea2908490613075565b90915550611eb5905062093a8086613075565b9450818b73ffffffffffffffffffffffffffffffffffffffff167fc9920255a27e7e0a5d647597e867ab827659000ae32276c878d8a04120efabb083604051611f0091815260200190565b60405180910390a3505080611f1490613088565b9050611dce565b50808210611f5f576040517ffb3880ba0000000000000000000000000000000000000000000000000000000081526004810183905260248101829052604401610542565b5073ffffffffffffffffffffffffffffffffffffffff9096166000908152603360205260409020959095555050505050565b73ffffffffffffffffffffffffffffffffffffffff81163b612035576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152608401610542565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6120a48361272e565b6000825111806120b15750805b156106b0576120c0838361277b565b50505050565b60007f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036121d3576040517ffc367c6100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae3170210169063fc367c61906024015b602060405180830381865afa1580156121a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121cc9190613120565b905061224f565b6040517f6aea282600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015284811660248301527f00000000000000000000000044087e105137a5095c008aab6a6530182821f2f01690636aea28269060440161218b565b92915050565b61225d612ae2565b7f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361236f576040517f7c386c7100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152602482018490527f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae31702101690637c386c71906044015b606060405180830381865afa158015612344573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061236891906131ad565b9050610ba9565b6040517f632c096d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528581166024830152604482018490527f00000000000000000000000044087e105137a5095c008aab6a6530182821f2f0169063632c096d90606401612327565b600082600001516fffffffffffffffffffffffffffffffff1682846020015161241b919061323d565b6fffffffffffffffffffffffffffffffff16111561243b5750600061224f565b81836020015161244b919061323d565b8351610ba99190613271565b60007f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612586576040517f947975d90000000000000000000000000000000000000000000000000000000081526fffffffffffffffffffffffffffffffff831660048201527f0000000000000000000000004f30a9d41b80ecc5b94306ab4364951ae317021073ffffffffffffffffffffffffffffffffffffffff169063947975d9906024015b602060405180830381865afa158015612549573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256d919061329a565b6fffffffffffffffffffffffffffffffff16905061224f565b6040517ff144cf1700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526fffffffffffffffffffffffffffffffff841660248301527f00000000000000000000000044087e105137a5095c008aab6a6530182821f2f0169063f144cf179060440161252c565b6000612674826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166127a09092919063ffffffff16565b8051909150156106b0578080602001905181019061269291906130c0565b6106b0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610542565b6000612729426127b7565b905090565b61273781611f91565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060610ba98383604051806060016040528060278152602001613376602791396127d1565b60606127af84846000856128f9565b949350505050565b600062093a806127c781846132b5565b61224f919061323d565b606073ffffffffffffffffffffffffffffffffffffffff84163b612877576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610542565b6000808573ffffffffffffffffffffffffffffffffffffffff168560405161289f9190613308565b600060405180830381855af49150503d80600081146128da576040519150601f19603f3d011682016040523d82523d6000602084013e6128df565b606091505b50915091506128ef828286612a8f565b9695505050505050565b60608247101561298b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610542565b73ffffffffffffffffffffffffffffffffffffffff85163b612a09576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610542565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612a329190613308565b60006040518083038185875af1925050503d8060008114612a6f576040519150601f19603f3d011682016040523d82523d6000602084013e612a74565b606091505b5091509150612a84828286612a8f565b979650505050505050565b60608315612a9e575081610ba9565b825115612aae5782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105429190613324565b604051806040016040528060006fffffffffffffffffffffffffffffffff168152602001612b47604051806040016040528060006fffffffffffffffffffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff1681525090565b905290565b803573ffffffffffffffffffffffffffffffffffffffff81168114612b7057600080fd5b919050565b8015158114610ab357600080fd5b600080600060608486031215612b9857600080fd5b612ba184612b4c565b92506020840135612bb181612b75565b91506040840135612bc181612b75565b809150509250925092565b600060208284031215612bde57600080fd5b610ba982612b4c565b60008060408385031215612bfa57600080fd5b612c0383612b4c565b9150612c1160208401612b4c565b90509250929050565b60008060408385031215612c2d57600080fd5b612c3683612b4c565b946020939093013593505050565b60008083601f840112612c5657600080fd5b50813567ffffffffffffffff811115612c6e57600080fd5b6020830191508360208260051b8501011115612c8957600080fd5b9250929050565b600080600060408486031215612ca557600080fd5b612cae84612b4c565b9250602084013567ffffffffffffffff811115612cca57600080fd5b612cd686828701612c44565b9497909650939450505050565b6020808252825182820181905260009190848201906040850190845b81811015612d1b57835183529284019291840191600101612cff565b50909695505050505050565b600060208284031215612d3957600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715612d9257612d92612d40565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612ddf57612ddf612d40565b604052919050565b60008060408385031215612dfa57600080fd5b612e0383612b4c565b915060208084013567ffffffffffffffff80821115612e2157600080fd5b818601915086601f830112612e3557600080fd5b813581811115612e4757612e47612d40565b612e77847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612d98565b91508082528784828501011115612e8d57600080fd5b80848401858401376000848284010152508093505050509250929050565b6020808252825182820181905260009190848201906040850190845b81811015612d1b57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101612ec7565b60008060008060008060006080888a031215612f1457600080fd5b873567ffffffffffffffff80821115612f2c57600080fd5b612f388b838c01612c44565b909950975060208a0135915080821115612f5157600080fd5b612f5d8b838c01612c44565b909750955060408a0135915080821115612f7657600080fd5b50612f838a828b01612c44565b989b979a50959894979596606090950135949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561224f5761224f612f9c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261304257600080fd5b83018035915067ffffffffffffffff82111561305d57600080fd5b6020019150600581901b3603821315612c8957600080fd5b8082018082111561224f5761224f612f9c565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036130b9576130b9612f9c565b5060010190565b6000602082840312156130d257600080fd5b8151610ba981612b75565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60008261311b5761311b6130dd565b500690565b60006020828403121561313257600080fd5b5051919050565b6fffffffffffffffffffffffffffffffff818116838216019080821115611b3057611b30612f9c565b808202811582820484141761224f5761224f612f9c565b600082613188576131886130dd565b500490565b80516fffffffffffffffffffffffffffffffff81168114612b7057600080fd5b600081830360608112156131c057600080fd5b6131c8612d6f565b6131d18461318d565b815260407fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08301121561320357600080fd5b61320b612d6f565b91506132196020850161318d565b82526132276040850161318d565b6020830152816020820152809250505092915050565b6fffffffffffffffffffffffffffffffff81811683821602808216919082811461326957613269612f9c565b505092915050565b6fffffffffffffffffffffffffffffffff828116828216039080821115611b3057611b30612f9c565b6000602082840312156132ac57600080fd5b610ba98261318d565b60006fffffffffffffffffffffffffffffffff808416806132d8576132d86130dd565b92169190910492915050565b60005b838110156132ff5781810151838201526020016132e7565b50506000910152565b6000825161331a8184602087016132e4565b9190910192915050565b60208152600082518060208401526133438160408501602087016132e4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a264697066735822122046cd37ccd69ef10255f82415591a328fe0b8054de7bc01b3b05b7cdaec028b5564736f6c63430008110033
Verified Source Code Full Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: Yes (90000 runs)
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
StorageSlot.sol 88 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*
* _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
IBeacon.sol 16 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeacon {
/**
* @dev Must return an address that can be used as a delegate call target.
*
* {BeaconProxy} will check that this address is a contract.
*/
function implementation() external view returns (address);
}
IPVeToken.sol 19 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IPVeToken {
// ============= USER INFO =============
function balanceOf(address user) external view returns (uint128);
function positionData(address user) external view returns (uint128 amount, uint128 expiry);
// ============= META DATA =============
function totalSupplyStored() external view returns (uint128);
function totalSupplyCurrent() external returns (uint128);
function totalSupplyAndBalanceCurrent(address user) external returns (uint128, uint128);
}
Errors.sol 169 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
/// Adapted from UniswapV3's Oracle
library Errors {
// BulkSeller
error BulkInsufficientSyForTrade(uint256 currentAmount, uint256 requiredAmount);
error BulkInsufficientTokenForTrade(uint256 currentAmount, uint256 requiredAmount);
error BulkInSufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
error BulkInSufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
error BulkInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
error BulkNotMaintainer();
error BulkNotAdmin();
error BulkSellerAlreadyExisted(address token, address SY, address bulk);
error BulkSellerInvalidToken(address token, address SY);
error BulkBadRateTokenToSy(uint256 actualRate, uint256 currentRate, uint256 eps);
error BulkBadRateSyToToken(uint256 actualRate, uint256 currentRate, uint256 eps);
// APPROX
error ApproxFail();
error ApproxParamsInvalid(uint256 guessMin, uint256 guessMax, uint256 eps);
error ApproxBinarySearchInputInvalid(
uint256 approxGuessMin,
uint256 approxGuessMax,
uint256 minGuessMin,
uint256 maxGuessMax
);
// MARKET + MARKET MATH CORE
error MarketExpired();
error MarketZeroAmountsInput();
error MarketZeroAmountsOutput();
error MarketZeroLnImpliedRate();
error MarketInsufficientPtForTrade(int256 currentAmount, int256 requiredAmount);
error MarketInsufficientPtReceived(uint256 actualBalance, uint256 requiredBalance);
error MarketInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
error MarketZeroTotalPtOrTotalAsset(int256 totalPt, int256 totalAsset);
error MarketExchangeRateBelowOne(int256 exchangeRate);
error MarketProportionMustNotEqualOne();
error MarketRateScalarBelowZero(int256 rateScalar);
error MarketScalarRootBelowZero(int256 scalarRoot);
error MarketProportionTooHigh(int256 proportion, int256 maxProportion);
error OracleUninitialized();
error OracleTargetTooOld(uint32 target, uint32 oldest);
error OracleZeroCardinality();
error MarketFactoryExpiredPt();
error MarketFactoryInvalidPt();
error MarketFactoryMarketExists();
error MarketFactoryLnFeeRateRootTooHigh(uint80 lnFeeRateRoot, uint256 maxLnFeeRateRoot);
error MarketFactoryReserveFeePercentTooHigh(
uint8 reserveFeePercent,
uint8 maxReserveFeePercent
);
error MarketFactoryZeroTreasury();
error MarketFactoryInitialAnchorTooLow(int256 initialAnchor, int256 minInitialAnchor);
// ROUTER
error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
error RouterInsufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
error RouterInsufficientPtOut(uint256 actualPtOut, uint256 requiredPtOut);
error RouterInsufficientYtOut(uint256 actualYtOut, uint256 requiredYtOut);
error RouterInsufficientPYOut(uint256 actualPYOut, uint256 requiredPYOut);
error RouterInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
error RouterExceededLimitSyIn(uint256 actualSyIn, uint256 limitSyIn);
error RouterExceededLimitPtIn(uint256 actualPtIn, uint256 limitPtIn);
error RouterExceededLimitYtIn(uint256 actualYtIn, uint256 limitYtIn);
error RouterInsufficientSyRepay(uint256 actualSyRepay, uint256 requiredSyRepay);
error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
error RouterNotAllSyUsed(uint256 netSyDesired, uint256 netSyUsed);
error RouterTimeRangeZero();
error RouterCallbackNotPendleMarket(address caller);
error RouterInvalidAction(bytes4 selector);
error RouterKyberSwapDataZero();
// YIELD CONTRACT
error YCExpired();
error YCNotExpired();
error YieldContractInsufficientSy(uint256 actualSy, uint256 requiredSy);
error YCNothingToRedeem();
error YCPostExpiryDataNotSet();
error YCNoFloatingSy();
// YieldFactory
error YCFactoryInvalidExpiry();
error YCFactoryYieldContractExisted();
error YCFactoryZeroExpiryDivisor();
error YCFactoryZeroTreasury();
error YCFactoryInterestFeeRateTooHigh(uint256 interestFeeRate, uint256 maxInterestFeeRate);
error YCFactoryRewardFeeRateTooHigh(uint256 newRewardFeeRate, uint256 maxRewardFeeRate);
// SY
error SYInvalidTokenIn(address token);
error SYInvalidTokenOut(address token);
error SYZeroDeposit();
error SYZeroRedeem();
error SYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
error SYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
// SY-specific
error SYQiTokenMintFailed(uint256 errCode);
error SYQiTokenRedeemFailed(uint256 errCode);
error SYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
error SYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
error SYCurveInvalidPid();
error SYCurve3crvPoolNotFound();
error SYApeDepositAmountTooSmall(uint256 amountDeposited);
// Liquidity Mining
error VCInactivePool(address pool);
error VCPoolAlreadyActive(address pool);
error VCZeroVePendle(address user);
error VCExceededMaxWeight(uint256 totalWeight, uint256 maxWeight);
error VCEpochNotFinalized(uint256 wTime);
error VCPoolAlreadyAddAndRemoved(address pool);
error VEInvalidNewExpiry(uint256 newExpiry);
error VEExceededMaxLockTime();
error VEInsufficientLockTime();
error VENotAllowedReduceExpiry();
error VEZeroAmountLocked();
error VEPositionNotExpired();
error VEZeroPosition();
error VEZeroSlope(uint128 bias, uint128 slope);
error VEReceiveOldSupply(uint256 msgTime);
error GCNotPendleMarket(address caller);
error GCNotVotingController(address caller);
error InvalidWTime(uint256 wTime);
error ExpiryInThePast(uint256 expiry);
error ChainNotSupported(uint256 chainId);
error FDTotalAmountFundedNotMatch(uint256 actualTotalAmount, uint256 expectedTotalAmount);
error FDEpochLengthMismatch();
error FDInvalidPool(address pool);
error FDPoolAlreadyExists(address pool);
error FDInvalidNewFinishedEpoch(uint256 oldFinishedEpoch, uint256 newFinishedEpoch);
error FDInvalidStartEpoch(uint256 startEpoch);
error FDInvalidWTimeFund(uint256 lastFunded, uint256 wTime);
error FDFutureFunding(uint256 lastFunded, uint256 currentWTime);
error BDInvalidEpoch(uint256 epoch, uint256 startTime);
// Cross-Chain
error MsgNotFromSendEndpoint(uint16 srcChainId, bytes path);
error MsgNotFromReceiveEndpoint(address sender);
error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee);
error ApproxDstExecutionGasNotSet();
error InvalidRetryData();
// GENERIC MSG
error ArrayLengthMismatch();
error ArrayEmpty();
error ArrayOutOfBounds();
error ZeroAddress();
error OnlyLayerZeroEndpoint();
error OnlyYT();
error OnlyYCFactory();
error OnlyWhitelisted();
}
draft-IERC1822.sol 20 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822Proxiable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}
ArrayLib.sol 51 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity >=0.8.0;
library ArrayLib {
function sum(uint256[] memory input) internal pure returns (uint256) {
uint256 value = 0;
for (uint256 i = 0; i < input.length; ) {
value += input[i];
unchecked {
i++;
}
}
return value;
}
function max(uint256[] memory input) internal pure returns (uint256 value) {
for (uint256 i = 0; i < input.length; ) {
if (input[i] > value) value = input[i];
unchecked {
i++;
}
}
}
function contains(address[] memory array, address element) internal pure returns (bool) {
uint256 length = array.length;
for (uint256 i = 0; i < length; ) {
if (array[i] == element) return true;
unchecked {
i++;
}
}
return false;
}
function append(address[] memory inp, address element)
internal
pure
returns (address[] memory out)
{
uint256 length = inp.length;
out = new address[](length + 1);
for (uint256 i = 0; i < length; ) {
out[i] = inp[i];
unchecked {
i++;
}
}
out[length] = element;
}
}
UUPSUpgradeable.sol 95 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822.sol";
import "../ERC1967/ERC1967Upgrade.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate that the this implementation remains valid after an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeTo(address newImplementation) external virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
}
SafeERC20.sol 116 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
Math.sol 178 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity 0.8.17;
/* solhint-disable private-vars-leading-underscore, reason-string */
library Math {
uint256 internal constant ONE = 1e18; // 18 decimal places
int256 internal constant IONE = 1e18; // 18 decimal places
function subMax0(uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
return (a >= b ? a - b : 0);
}
}
function subNoNeg(int256 a, int256 b) internal pure returns (int256) {
require(a >= b, "negative");
return a - b; // no unchecked since if b is very negative, a - b might overflow
}
function mulDown(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 product = a * b;
unchecked {
return product / ONE;
}
}
function mulDown(int256 a, int256 b) internal pure returns (int256) {
int256 product = a * b;
unchecked {
return product / IONE;
}
}
function divDown(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 aInflated = a * ONE;
unchecked {
return aInflated / b;
}
}
function divDown(int256 a, int256 b) internal pure returns (int256) {
int256 aInflated = a * IONE;
unchecked {
return aInflated / b;
}
}
function rawDivUp(uint256 a, uint256 b) internal pure returns (uint256) {
return (a + b - 1) / b;
}
// @author Uniswap
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;
}
}
function abs(int256 x) internal pure returns (uint256) {
return uint256(x > 0 ? x : -x);
}
function neg(int256 x) internal pure returns (int256) {
return x * (-1);
}
function neg(uint256 x) internal pure returns (int256) {
return Int(x) * (-1);
}
function max(uint256 x, uint256 y) internal pure returns (uint256) {
return (x > y ? x : y);
}
function max(int256 x, int256 y) internal pure returns (int256) {
return (x > y ? x : y);
}
function min(uint256 x, uint256 y) internal pure returns (uint256) {
return (x < y ? x : y);
}
function min(int256 x, int256 y) internal pure returns (int256) {
return (x < y ? x : y);
}
/*///////////////////////////////////////////////////////////////
SIGNED CASTS
//////////////////////////////////////////////////////////////*/
function Int(uint256 x) internal pure returns (int256) {
require(x <= uint256(type(int256).max));
return int256(x);
}
function Int128(int256 x) internal pure returns (int128) {
require(type(int128).min <= x && x <= type(int128).max);
return int128(x);
}
function Int128(uint256 x) internal pure returns (int128) {
return Int128(Int(x));
}
/*///////////////////////////////////////////////////////////////
UNSIGNED CASTS
//////////////////////////////////////////////////////////////*/
function Uint(int256 x) internal pure returns (uint256) {
require(x >= 0);
return uint256(x);
}
function Uint32(uint256 x) internal pure returns (uint32) {
require(x <= type(uint32).max);
return uint32(x);
}
function Uint112(uint256 x) internal pure returns (uint112) {
require(x <= type(uint112).max);
return uint112(x);
}
function Uint96(uint256 x) internal pure returns (uint96) {
require(x <= type(uint96).max);
return uint96(x);
}
function Uint128(uint256 x) internal pure returns (uint128) {
require(x <= type(uint128).max);
return uint128(x);
}
function isAApproxB(
uint256 a,
uint256 b,
uint256 eps
) internal pure returns (bool) {
return mulDown(b, ONE - eps) <= a && a <= mulDown(b, ONE + eps);
}
function isAGreaterApproxB(
uint256 a,
uint256 b,
uint256 eps
) internal pure returns (bool) {
return a >= b && a <= mulDown(b, ONE + eps);
}
function isASmallerApproxB(
uint256 a,
uint256 b,
uint256 eps
) internal pure returns (bool) {
return a <= b && a >= mulDown(b, ONE - eps);
}
}
ERC1967Upgrade.sol 185 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeacon.sol";
import "../../interfaces/draft-IERC1822.sol";
import "../../utils/Address.sol";
import "../../utils/StorageSlot.sol";
/**
* @dev This abstract contract provides getters and event emitting update functions for
* https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.
*
* _Available since v4.1._
*
* @custom:oz-upgrades-unsafe-allow delegatecall
*/
abstract contract ERC1967Upgrade {
// This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1
bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Emitted when the implementation is upgraded.
*/
event Upgraded(address indexed implementation);
/**
* @dev Returns the current implementation address.
*/
function _getImplementation() internal view returns (address) {
return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
}
/**
* @dev Perform implementation upgrade
*
* Emits an {Upgraded} event.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Perform implementation upgrade with additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCall(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
_upgradeTo(newImplementation);
if (data.length > 0 || forceCall) {
Address.functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Emitted when the admin account has changed.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Returns the current admin.
*/
function _getAdmin() internal view returns (address) {
return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 admin slot.
*/
function _setAdmin(address newAdmin) private {
require(newAdmin != address(0), "ERC1967: new admin is the zero address");
StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;
}
/**
* @dev Changes the admin of the proxy.
*
* Emits an {AdminChanged} event.
*/
function _changeAdmin(address newAdmin) internal {
emit AdminChanged(_getAdmin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.
* This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.
*/
bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;
/**
* @dev Emitted when the beacon is upgraded.
*/
event BeaconUpgraded(address indexed beacon);
/**
* @dev Returns the current beacon.
*/
function _getBeacon() internal view returns (address) {
return StorageSlot.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
Address.isContract(IBeacon(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;
}
/**
* @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does
* not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).
*
* Emits a {BeaconUpgraded} event.
*/
function _upgradeBeaconToAndCall(
address newBeacon,
bytes memory data,
bool forceCall
) internal {
_setBeacon(newBeacon);
emit BeaconUpgraded(newBeacon);
if (data.length > 0 || forceCall) {
Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);
}
}
}
IPFeeDistributor.sol 21 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
interface IPFeeDistributor {
event UpdateFee(address indexed pool, uint256 indexed wTime, uint256 amount);
event ClaimReward(address indexed pool, address indexed user, uint256 wTime, uint256 amount);
event PoolAdded(address indexed pool, uint256 indexed startWeek);
struct UserInfo {
uint128 firstUnclaimedWeek;
uint128 iter;
}
function claimReward(address user, address[] calldata pools)
external
returns (uint256[] memory amountRewardOut);
function getAllPools() external view returns (address[] memory);
}
IPVotingController.sol 43 lines
pragma solidity 0.8.17;
import "../LiquidityMining/libraries/VeBalanceLib.sol";
import "../LiquidityMining/libraries/VeHistoryLib.sol";
interface IPVotingController {
event AddPool(uint64 indexed chainId, address indexed pool);
event RemovePool(uint64 indexed chainId, address indexed pool);
event Vote(address indexed user, address indexed pool, uint64 weight, VeBalance vote);
event PoolVoteChange(address indexed pool, VeBalance vote);
event SetPendlePerSec(uint256 newPendlePerSec);
event BroadcastResults(
uint64 indexed chainId,
uint128 indexed wTime,
uint128 totalPendlePerSec
);
function applyPoolSlopeChanges(address pool) external;
function getUserPoolHistoryLength(address user, address pool) external view returns (uint256);
function getUserPoolHistoryAt(
address user,
address pool,
uint256 index
) external view returns (Checkpoint memory);
function getWeekData(uint128 wTime, address[] calldata pools)
external
view
returns (
bool isEpochFinalized,
uint128 totalVotes,
uint128[] memory poolVotes
);
function getPoolTotalVoteAt(address pool, uint128 wTime) external view returns (uint128);
}
AddressUpgradeable.sol 195 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Initializable.sol 138 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}
WeekMath.sol 19 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
library WeekMath {
uint128 internal constant WEEK = 7 days;
function getWeekStartTimestamp(uint128 timestamp) internal pure returns (uint128) {
return (timestamp / WEEK) * WEEK;
}
function getCurrentWeekStart() internal view returns (uint128) {
return getWeekStartTimestamp(uint128(block.timestamp));
}
function isValidWTime(uint256 time) internal pure returns (bool) {
return time % WEEK == 0;
}
}
IPVotingEscrowMainchain.sol 34 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "./IPVeToken.sol";
import "../LiquidityMining/libraries/VeBalanceLib.sol";
import "../LiquidityMining/libraries/VeHistoryLib.sol";
interface IPVotingEscrowMainchain is IPVeToken {
event NewLockPosition(address indexed user, uint128 amount, uint128 expiry);
event Withdraw(address indexed user, uint128 amount);
event BroadcastTotalSupply(VeBalance newTotalSupply, uint256[] chainIds);
event BroadcastUserPosition(address indexed user, uint256[] chainIds);
// ============= ACTIONS =============
function increaseLockPosition(uint128 additionalAmountToLock, uint128 expiry)
external
returns (uint128);
function withdraw() external returns (uint128);
function totalSupplyAt(uint128 timestamp) external view returns (uint128);
function getUserHistoryLength(address user) external view returns (uint256);
function getUserHistoryAt(address user, uint256 index)
external
view
returns (Checkpoint memory);
}
draft-IERC20Permit.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
VeBalanceLib.sol 96 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "../../core/libraries/math/Math.sol";
import "../../core/libraries/Errors.sol";
struct VeBalance {
uint128 bias;
uint128 slope;
}
struct LockedPosition {
uint128 amount;
uint128 expiry;
}
library VeBalanceLib {
using Math for uint256;
uint128 internal constant MAX_LOCK_TIME = 104 weeks;
uint256 internal constant USER_VOTE_MAX_WEIGHT = 10**18;
function add(VeBalance memory a, VeBalance memory b)
internal
pure
returns (VeBalance memory res)
{
res.bias = a.bias + b.bias;
res.slope = a.slope + b.slope;
}
function sub(VeBalance memory a, VeBalance memory b)
internal
pure
returns (VeBalance memory res)
{
res.bias = a.bias - b.bias;
res.slope = a.slope - b.slope;
}
function sub(
VeBalance memory a,
uint128 slope,
uint128 expiry
) internal pure returns (VeBalance memory res) {
res.slope = a.slope - slope;
res.bias = a.bias - slope * expiry;
}
function isExpired(VeBalance memory a) internal view returns (bool) {
return a.slope * uint128(block.timestamp) >= a.bias;
}
function getCurrentValue(VeBalance memory a) internal view returns (uint128) {
if (isExpired(a)) return 0;
return getValueAt(a, uint128(block.timestamp));
}
function getValueAt(VeBalance memory a, uint128 t) internal pure returns (uint128) {
if (a.slope * t > a.bias) {
return 0;
}
return a.bias - a.slope * t;
}
function getExpiry(VeBalance memory a) internal pure returns (uint128) {
if (a.slope == 0) revert Errors.VEZeroSlope(a.bias, a.slope);
return a.bias / a.slope;
}
function convertToVeBalance(LockedPosition memory position)
internal
pure
returns (VeBalance memory res)
{
res.slope = position.amount / MAX_LOCK_TIME;
res.bias = res.slope * position.expiry;
}
function convertToVeBalance(LockedPosition memory position, uint256 weight)
internal
pure
returns (VeBalance memory res)
{
res.slope = ((position.amount * weight) / MAX_LOCK_TIME / USER_VOTE_MAX_WEIGHT).Uint128();
res.bias = res.slope * position.expiry;
}
function convertToVeBalance(uint128 amount, uint128 expiry)
internal
pure
returns (uint128, uint128)
{
VeBalance memory balance = convertToVeBalance(LockedPosition(amount, expiry));
return (balance.bias, balance.slope);
}
}
VeHistoryLib.sol 44 lines
// SPDX-License-Identifier: GPL-3.0-or-later
// Forked from OpenZeppelin (v4.5.0) (utils/Checkpoints.sol)
pragma solidity ^0.8.0;
import "../../core/libraries/math/Math.sol";
import "./VeBalanceLib.sol";
import "./WeekMath.sol";
struct Checkpoint {
uint128 timestamp;
VeBalance value;
}
library CheckpointHelper {
function assignWith(Checkpoint memory a, Checkpoint memory b) internal pure {
a.timestamp = b.timestamp;
a.value = b.value;
}
}
library Checkpoints {
struct History {
Checkpoint[] _checkpoints;
}
function length(History storage self) internal view returns (uint256) {
return self._checkpoints.length;
}
function get(History storage self, uint256 index) internal view returns (Checkpoint memory) {
return self._checkpoints[index];
}
function push(History storage self, VeBalance memory value) internal {
uint256 pos = self._checkpoints.length;
if (pos > 0 && self._checkpoints[pos - 1].timestamp == WeekMath.getCurrentWeekStart()) {
self._checkpoints[pos - 1].value = value;
} else {
self._checkpoints.push(
Checkpoint({ timestamp: WeekMath.getCurrentWeekStart(), value: value })
);
}
}
}
BoringOwnableUpgradeable.sol 62 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
contract BoringOwnableUpgradeableData {
address public owner;
address public pendingOwner;
}
abstract contract BoringOwnableUpgradeable is BoringOwnableUpgradeableData, Initializable {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function __BoringOwnable_init() internal onlyInitializing {
owner = msg.sender;
}
/// @notice Transfers ownership to `newOwner`. Either directly or claimable by the new pending owner.
/// Can only be invoked by the current `owner`.
/// @param newOwner Address of the new owner.
/// @param direct True if `newOwner` should be set immediately. False if `newOwner` needs to use `claimOwnership`.
/// @param renounce Allows the `newOwner` to be `address(0)` if `direct` and `renounce` is True. Has no effect otherwise.
function transferOwnership(
address newOwner,
bool direct,
bool renounce
) public onlyOwner {
if (direct) {
// Checks
require(newOwner != address(0) || renounce, "Ownable: zero address");
// Effects
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
pendingOwner = address(0);
} else {
// Effects
pendingOwner = newOwner;
}
}
/// @notice Needs to be called by `pendingOwner` to claim ownership.
function claimOwnership() public {
address _pendingOwner = pendingOwner;
// Checks
require(msg.sender == _pendingOwner, "Ownable: caller != pending owner");
// Effects
emit OwnershipTransferred(owner, _pendingOwner);
owner = _pendingOwner;
pendingOwner = address(0);
}
/// @notice Only allows the `owner` to execute the function.
modifier onlyOwner() {
require(msg.sender == owner, "Ownable: caller is not the owner");
_;
}
uint256[48] private __gap;
}
PendleFeeDistributor.sol 224 lines
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
import "../../core/libraries/BoringOwnableUpgradeable.sol";
import "../../core/libraries/Errors.sol";
import "../../interfaces/IPFeeDistributor.sol";
import "../../interfaces/IPVotingEscrowMainchain.sol";
import "../../interfaces/IPVotingController.sol";
import "../libraries/WeekMath.sol";
import "../libraries/VeHistoryLib.sol";
import "../../core/libraries/ArrayLib.sol";
contract PendleFeeDistributor is UUPSUpgradeable, BoringOwnableUpgradeable, IPFeeDistributor {
using SafeERC20 for IERC20;
using VeBalanceLib for VeBalance;
using ArrayLib for uint256[];
address public immutable votingController;
address public immutable vePendle;
address public immutable token;
address[] public allPools;
// [pool] => lastFundedWeek
mapping(address => uint256) public lastFundedWeek;
// [pool, user] => UserInfo
mapping(address => mapping(address => UserInfo)) public userInfo;
// [pool, epoch] => [fee]
mapping(address => mapping(uint256 => uint256)) public fees;
modifier ensureValidPool(address pool) {
if (lastFundedWeek[pool] == 0) revert Errors.FDInvalidPool(pool);
_;
}
constructor(
address _votingController,
address _vePendle,
address _rewardToken
) initializer {
votingController = _votingController;
vePendle = _vePendle;
token = _rewardToken;
}
function addPool(address pool, uint256 _startWeek) external onlyOwner {
if (!WeekMath.isValidWTime(_startWeek) || _startWeek == 0)
revert Errors.FDInvalidStartEpoch(_startWeek);
if (lastFundedWeek[pool] != 0) revert Errors.FDPoolAlreadyExists(pool);
lastFundedWeek[pool] = _startWeek - WeekMath.WEEK;
allPools.push(pool);
emit PoolAdded(pool, _startWeek);
}
function getAllPools() external view returns (address[] memory) {
return allPools;
}
function fund(
address[] calldata pools,
uint256[][] calldata wTimes,
uint256[][] calldata amounts,
uint256 totalAmountToFund
) external onlyOwner {
uint256 length = pools.length;
if (wTimes.length != length || amounts.length != length)
revert Errors.ArrayLengthMismatch();
uint256 totalFunded = 0;
for (uint256 i = 0; i < length; ++i) {
_fund(pools[i], wTimes[i], amounts[i]);
totalFunded += amounts[i].sum();
}
if (totalFunded != totalAmountToFund)
revert Errors.FDTotalAmountFundedNotMatch(totalFunded, totalAmountToFund);
IERC20(token).transferFrom(msg.sender, address(this), totalFunded);
}
function _fund(
address pool,
uint256[] calldata wTimes,
uint256[] calldata amounts
) internal ensureValidPool(pool) {
if (wTimes.length != amounts.length) revert Errors.FDEpochLengthMismatch();
uint256 lastFunded = lastFundedWeek[pool];
uint256 curWeek = WeekMath.getCurrentWeekStart();
for (uint256 i = 0; i < amounts.length; ++i) {
uint256 wTime = wTimes[i];
uint256 amount = amounts[i];
if (wTime != lastFunded + WeekMath.WEEK)
revert Errors.FDInvalidWTimeFund(lastFunded, wTime);
fees[pool][wTime] += amount;
lastFunded += WeekMath.WEEK;
emit UpdateFee(pool, wTime, amount);
}
if (lastFunded >= curWeek) revert Errors.FDInvalidWTimeFund(lastFunded, curWeek);
lastFundedWeek[pool] = lastFunded;
}
function claimReward(address user, address[] calldata pools)
external
returns (uint256[] memory amountRewardOut)
{
amountRewardOut = new uint256[](pools.length);
for (uint256 i = 0; i < pools.length; ) {
amountRewardOut[i] = _accumulateUserReward(pools[i], user);
unchecked {
i++;
}
}
IERC20(token).safeTransfer(user, amountRewardOut.sum());
}
function getAllActivePools() external view returns (address[] memory) {
return allPools;
}
function _accumulateUserReward(address pool, address user)
internal
ensureValidPool(pool)
returns (uint256 totalReward)
{
uint256 length = _getUserCheckpointLength(pool, user);
if (length == 0) return 0;
uint256 lastWeek = lastFundedWeek[pool];
uint256 curWeek = userInfo[pool][user].firstUnclaimedWeek;
uint256 iter = userInfo[pool][user].iter;
if (curWeek > lastWeek) return 0; // nothing to account
Checkpoint memory checkpoint = _getUserCheckpointAt(pool, user, iter);
Checkpoint memory nextCheckpoint = checkpoint;
if (curWeek == 0) curWeek = checkpoint.timestamp + WeekMath.WEEK;
while (curWeek <= lastWeek) {
// we have at most one checkpoint per week
if (iter + 1 < length) {
if (nextCheckpoint.timestamp == checkpoint.timestamp) {
// next have been assigned to current checkpoint, so we need to get the next one
nextCheckpoint = _getUserCheckpointAt(pool, user, iter + 1);
}
if (nextCheckpoint.timestamp < curWeek) {
iter++;
checkpoint = nextCheckpoint;
}
// Important invariant: checkpoint[iter] < curWeek <= checkpoint[iter+1]
}
// assert(checkpoint.timestamp < curWeek); should always hold
uint256 userShare = checkpoint.value.getValueAt(uint128(curWeek));
if (userShare != 0) {
uint256 totalShare = _getPoolTotalSharesAt(pool, uint128(curWeek));
// userShare != 0 => totalShare != 0
uint256 amountRewardOut = (userShare * fees[pool][curWeek]) / totalShare;
totalReward += amountRewardOut;
emit ClaimReward(pool, user, curWeek, amountRewardOut);
}
curWeek += WeekMath.WEEK;
}
userInfo[pool][user] = UserInfo({
firstUnclaimedWeek: uint128(curWeek),
iter: uint128(iter)
});
}
function _getPoolTotalSharesAt(address pool, uint128 wTime) internal view returns (uint256) {
if (pool == vePendle) {
return IPVotingEscrowMainchain(vePendle).totalSupplyAt(wTime);
} else {
return IPVotingController(votingController).getPoolTotalVoteAt(pool, wTime);
}
}
function _getUserCheckpointAt(
address pool,
address user,
uint256 index
) internal view returns (Checkpoint memory) {
if (pool == vePendle) {
return IPVotingEscrowMainchain(vePendle).getUserHistoryAt(user, index);
} else {
return IPVotingController(votingController).getUserPoolHistoryAt(user, pool, index);
}
}
function _getUserCheckpointLength(address pool, address user) internal view returns (uint256) {
if (pool == vePendle) {
return IPVotingEscrowMainchain(vePendle).getUserHistoryLength(user);
} else {
return IPVotingController(votingController).getUserPoolHistoryLength(user, pool);
}
}
function initialize() external initializer {
__BoringOwnable_init();
}
// ----------------- upgrade-related -----------------
function _authorizeUpgrade(address) internal override onlyOwner {}
}
Read Contract
allPools 0x41d1de97 → address
fees 0x263a5362 → uint256
getAllActivePools 0xd5cd7d20 → address[]
getAllPools 0xd88ff1f4 → address[]
lastFundedWeek 0x0d6f1413 → uint256
owner 0x8da5cb5b → address
pendingOwner 0xe30c3978 → address
proxiableUUID 0x52d1902d → bytes32
token 0xfc0c546a → address
userInfo 0x0f208beb → uint128, uint128
vePendle 0x82dabb21 → address
votingController 0x517afbcf → address
Write Contract 8 functions
These functions modify contract state and require a wallet transaction to execute.
addPool 0x32a9caba
address pool
uint256 _startWeek
claimOwnership 0x4e71e0c8
No parameters
claimReward 0x3685ffe7
address user
address[] pools
returns: uint256[]
fund 0xd7ace6ce
address[] pools
uint256[][] wTimes
uint256[][] amounts
uint256 totalAmountToFund
initialize 0x8129fc1c
No parameters
transferOwnership 0x078dfbe7
address newOwner
bool direct
bool renounce
upgradeTo 0x3659cfe6
address newImplementation
upgradeToAndCall 0x4f1ef286
address newImplementation
bytes data
Recent Transactions
No transactions found for this address