Address Contract Verified
Address
0xae9daA2d8A9348765887207A1ADc92e3bBC73d87
Balance
0 ETH
Nonce
1
Code Size
18947 bytes
Creator
0xE64CA754...2B5B at tx 0xb0dfbfee...fa7405
Indexed Transactions
0
Contract Bytecode
18947 bytes
0x6080604052600436106102345760003560e01c80637f258bfb1161012e578063bb4e96a6116100ab578063dbf7d2531161006f578063dbf7d2531461087b578063e58378bb146108ba578063ea70c9dc146108e5578063f701965d14610922578063fc0c546a1461094d5761023e565b8063bb4e96a614610784578063c9028aff146107ad578063d547741f146107ea578063d9a2761014610813578063dbef86891461083c5761023e565b806391d14854116100f257806391d14854146106855780639852099c146106c2578063a217fddf146106ed578063b82c589914610718578063b8e7023d1461075b5761023e565b80637f258bfb146105985780638456cb59146105d5578063879d9090146105ec578063890db72f1461061757806389ef50a01461065a5761023e565b80633f4ba83a116101bc5780635c975abb116101805780635c975abb146104b15780636ba03924146104dc57806370a0823114610507578063772e0f03146105445780637b0472f01461056f5761023e565b80633f4ba83a146103e0578063412d954f146103f757806348a88706146104205780634a0f085c1461045d5780635a09a413146104885761023e565b80632e1a7d4d116102035780632e1a7d4d146103255780632ec086691461034e5780632f2ff15d146103775780632f6169b5146103a057806336568abe146103b75761023e565b806301ffc9a714610243578063124be9e0146102805780631e58f6db146102ab578063248a9ca3146102e85761023e565b3661023e57600080fd5b600080fd5b34801561024f57600080fd5b5061026a60048036038101906102659190613140565b610978565b6040516102779190613188565b60405180910390f35b34801561028c57600080fd5b506102956109f2565b6040516102a29190613188565b60405180910390f35b3480156102b757600080fd5b506102d260048036038101906102cd91906131d9565b610a05565b6040516102df9190613215565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190613266565b610a29565b60405161031c91906132a2565b60405180910390f35b34801561033157600080fd5b5061034c600480360381019061034791906131d9565b610a48565b005b34801561035a57600080fd5b50610375600480360381019061037091906132bd565b611091565b005b34801561038357600080fd5b5061039e6004803603810190610399919061336e565b6111f5565b005b3480156103ac57600080fd5b506103b561121e565b005b3480156103c357600080fd5b506103de60048036038101906103d9919061336e565b61127d565b005b3480156103ec57600080fd5b506103f5611300565b005b34801561040357600080fd5b5061041e600480360381019061041991906133ae565b61133d565b005b34801561042c57600080fd5b50610447600480360381019061044291906133ae565b6114aa565b6040516104549190613215565b60405180910390f35b34801561046957600080fd5b5061047261150f565b60405161047f9190613215565b60405180910390f35b34801561049457600080fd5b506104af60048036038101906104aa91906133ee565b611515565b005b3480156104bd57600080fd5b506104c66116ff565b6040516104d39190613188565b60405180910390f35b3480156104e857600080fd5b506104f1611716565b6040516104fe91906134ec565b60405180910390f35b34801561051357600080fd5b5061052e6004803603810190610529919061350e565b61176e565b60405161053b9190613215565b60405180910390f35b34801561055057600080fd5b50610559611865565b6040516105669190613696565b60405180910390f35b34801561057b57600080fd5b50610596600480360381019061059191906133ae565b6119ac565b005b3480156105a457600080fd5b506105bf60048036038101906105ba91906136b8565b611de5565b6040516105cc9190613215565b60405180910390f35b3480156105e157600080fd5b506105ea611e16565b005b3480156105f857600080fd5b50610601611e53565b60405161060e9190613215565b60405180910390f35b34801561062357600080fd5b5061063e600480360381019061063991906131d9565b611e59565b6040516106519796959493929190613707565b60405180910390f35b34801561066657600080fd5b5061066f611f4b565b60405161067c91906134ec565b60405180910390f35b34801561069157600080fd5b506106ac60048036038101906106a7919061336e565b611fa3565b6040516106b99190613188565b60405180910390f35b3480156106ce57600080fd5b506106d761200d565b6040516106e49190613215565b60405180910390f35b3480156106f957600080fd5b50610702612013565b60405161070f91906132a2565b60405180910390f35b34801561072457600080fd5b5061073f600480360381019061073a91906131d9565b61201a565b6040516107529796959493929190613707565b60405180910390f35b34801561076757600080fd5b50610782600480360381019061077d91906133ae565b612089565b005b34801561079057600080fd5b506107ab60048036038101906107a691906131d9565b612401565b005b3480156107b957600080fd5b506107d460048036038101906107cf91906131d9565b6124d1565b6040516107e19190613215565b60405180910390f35b3480156107f657600080fd5b50610811600480360381019061080c919061336e565b6124f5565b005b34801561081f57600080fd5b5061083a600480360381019061083591906131d9565b61251e565b005b34801561084857600080fd5b50610863600480360381019061085e91906131d9565b612631565b60405161087293929190613776565b60405180910390f35b34801561088757600080fd5b506108a2600480360381019061089d91906131d9565b612668565b6040516108b193929190613776565b60405180910390f35b3480156108c657600080fd5b506108cf6126cc565b6040516108dc91906132a2565b60405180910390f35b3480156108f157600080fd5b5061090c6004803603810190610907919061350e565b6126f0565b60405161091991906134ec565b60405180910390f35b34801561092e57600080fd5b50610937612787565b6040516109449190613215565b60405180910390f35b34801561095957600080fd5b5061096261278d565b60405161096f91906137ad565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806109eb57506109ea826129ef565b5b9050919050565b600d60009054906101000a900460ff1681565b60088181548110610a1557600080fd5b906000526020600020016000915090505481565b6000806000838152602001908152602001600020600101549050919050565b600260015403610a8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8490613825565b60405180910390fd5b60026001819055506006600082815260200190815260200160002060050154421015610aee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae5906138b7565b60405180910390fd5b6006600082815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8990613949565b60405180910390fd5b6006600082815260200190815260200160002060060160009054906101000a900460ff1615610bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bed906139db565b60405180910390fd5b60016006600083815260200190815260200160002060060160006101000a81548160ff0219169083151502179055506000600560006006600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050905060005b81811015610f2b5782600560006006600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610d3557610d346139fb565b5b906000526020600020015403610f1857600560006006600086815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600183610dc79190613a59565b81548110610dd857610dd76139fb565b5b9060005260206000200154600560006006600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110610e6a57610e696139fb565b5b9060005260206000200181905550600560006006600086815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480610efd57610efc613a8d565b5b60019003818190600052602060002001600090559055610f2b565b8080610f2390613abc565b915050610ca5565b50600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3360066000868152602001908152602001600020600301546040518363ffffffff1660e01b8152600401610f9f929190613b04565b6020604051808303816000875af1158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190613b59565b611021576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101890613bf8565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16827f9da6493a92039daf47d1f2d7a782299c5994c6323eb1e972f69c432089ec52bf600660008681526020019081526020016000206003015460405161107e9190613215565b60405180910390a3506001808190555050565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6110c3816110be612a59565b612a61565b60008311611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fd90613c8a565b60405180910390fd5b61110f84612afe565b61114e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114590613d1c565b60405180910390fd5b61115783612b20565b8015611179575082600960008681526020019081526020016000206000015414155b156111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613dae565b60405180910390fd5b82600960008681526020019081526020016000206000018190555081600960008681526020019081526020016000206001018190555050505050565b6111fe82610a29565b61120f8161120a612a59565b612a61565b6112198383612b76565b505050565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6112508161124b612a59565b612a61565b600d60009054906101000a900460ff1615600d60006101000a81548160ff02191690831515021790555050565b611285612a59565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146112f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112e990613e40565b60405180910390fd5b6112fc8282612c56565b5050565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6113328161132d612a59565b612a61565b61133a612d37565b50565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e61136f8161136a612a59565b612a61565b600083116113b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a990613ed2565b60405180910390fd5b6113bb83612b20565b156113fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f290613f64565b60405180910390fd5b60006007600081548092919061141090613abc565b91905055905083600960008381526020019081526020016000206000018190555082600960008381526020019081526020016000206001018190555060016009600083815260200190815260200160002060020160006101000a81548160ff021916908315150217905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550505050565b60008060096000848152602001908152602001600020600101549050600060096000858152602001908152602001600020600001549050618e948183876114f19190613f84565b6114fb9190613f84565b611505919061400d565b9250505092915050565b600c5481565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e61154781611542612a59565b612a61565b600b5483111561158c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611583906140d6565b60405180910390fd5b600c544210156115d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c89061418e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611640576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163790614220565b60405180910390fd5b82600b60008282546116529190613a59565b92505081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83856040518363ffffffff1660e01b81526004016116b6929190613b04565b6020604051808303816000875af11580156116d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116f99190613b59565b50505050565b6000600260009054906101000a900460ff16905090565b6060600480548060200260200160405190810160405280929190818152602001828054801561176457602002820191906000526020600020905b815481526020019060010190808311611750575b5050505050905090565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156117fa57602002820191906000526020600020905b8154815260200190600101908083116117e6575b5050505050905060005b815181101561185e5760066000838381518110611824576118236139fb565b5b6020026020010151815260200190815260200160002060030154836118499190614240565b9250808061185690613abc565b915050611804565b5050919050565b606060088054905067ffffffffffffffff81111561188657611885614296565b5b6040519080825280602002602001820160405280156118b957816020015b60608152602001906001900390816118a45790505b50905060005b6008805490508110156119a8576118d581612dd9565b6118f46009600084815260200190815260200160002060000154612dd9565b6119136009600085815260200190815260200160002060010154612dd9565b6009600085815260200190815260200160002060020160009054906101000a900460ff1661194a576119456000612dd9565b611955565b6119546001612dd9565b5b604051602001611968949392919061434d565b60405160208183030381529060405282828151811061198a576119896139fb565b5b602002602001018190525080806119a090613abc565b9150506118bf565b5090565b6002600154036119f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e890613825565b60405180910390fd5b6002600181905550611a016116ff565b15611a41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a38906143f8565b60405180910390fd5b611a4a81612f39565b6000611a568383612fe7565b9050600060036000815480929190611a6d90613abc565b919050559050336006600083815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360066000838152602001908152602001600020600101819055508160066000838152602001908152602001600020600201819055508184611b0a9190614240565b600660008381526020019081526020016000206003018190555060096000848152602001908152602001600020600101546006600083815260200190815260200160002060040181905550620151806009600085815260200190815260200160002060000154611b7a9190613f84565b42611b859190614240565b600660008381526020019081526020016000206005018190555060006006600083815260200190815260200160002060060160006101000a81548160ff0219169083151502179055506004819080600181540180825580915050600190039060005260206000200160009091909190915055600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505060019003906000526020600020016000909190919091505581600b6000828254611c6f9190613a59565b92505081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330876040518463ffffffff1660e01b8152600401611cd593929190614418565b6020604051808303816000875af1158015611cf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d189190613b59565b611d57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4e906144c1565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16817f02b63b8e1c579c43105e71e3dd6fa6a50f2999d91c9fdc13b623463ef6a3086b86856006600087815260200190815260200160002060050154600960008a815260200190815260200160002060010154604051611dd094939291906144e1565b60405180910390a35050600180819055505050565b60056020528160005260406000208181548110611e0157600080fd5b90600052602060002001600091509150505481565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e611e4881611e43612a59565b612a61565b611e50613040565b50565b600b5481565b60008060008060008060006006600089815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600660008a815260200190815260200160002060010154600660008b815260200190815260200160002060020154600660008c815260200190815260200160002060030154600660008d815260200190815260200160002060040154600660008e815260200190815260200160002060050154600660008f815260200190815260200160002060060160009054906101000a900460ff169650965096509650965096509650919395979092949650565b60606008805480602002602001604051908101604052809291908181526020018280548015611f9957602002820191906000526020600020905b815481526020019060010190808311611f85575b5050505050905090565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60035481565b6000801b81565b60066020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030154908060040154908060050154908060060160009054906101000a900460ff16905087565b6002600154036120ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120c590613825565b60405180910390fd5b6002600181905550600d60009054906101000a900460ff16612125576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161211c90614598565b60405180910390fd5b61212e81612f39565b6006600083815260200190815260200160002060060160009054906101000a900460ff1615612192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121899061462a565b60405180910390fd5b6006600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612236576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222d90613949565b60405180910390fd5b600060066000848152602001908152602001600020600301549050600061225d8284612fe7565b9050600042600660008781526020019081526020016000206005015411612284574261229c565b60066000868152602001908152602001600020600501545b9050816006600087815260200190815260200160002060030160008282546122c49190614240565b925050819055506201518060096000868152602001908152602001600020600001546122f09190613f84565b816122fb9190614240565b600660008781526020019081526020016000206005018190555081600b60008282546123279190613a59565b925050819055503373ffffffffffffffffffffffffffffffffffffffff16857f02b63b8e1c579c43105e71e3dd6fa6a50f2999d91c9fdc13b623463ef6a3086b8585600660008b815260200190815260200160002060050154600960008b8152602001908152602001600020600101546040516123a794939291906144e1565b60405180910390a33373ffffffffffffffffffffffffffffffffffffffff16857fd05981d032a6825c067bf4a25f9deb246c8c8564d293d55a77a190859adc71d360405160405180910390a3505050600180819055505050565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e6124338161242e612a59565b612a61565b61243c82612afe565b61247b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247290613d1c565b60405180910390fd5b6009600083815260200190815260200160002060020160009054906101000a900460ff16156009600084815260200190815260200160002060020160006101000a81548160ff0219169083151502179055505050565b600481815481106124e157600080fd5b906000526020600020016000915090505481565b6124fe82610a29565b61250f8161250a612a59565b612a61565b6125198383612c56565b505050565b600260015403612563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255a90613825565b60405180910390fd5b600260018190555080600b600082825461257d9190614240565b92505081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b81526004016125e393929190614418565b6020604051808303816000875af1158015612602573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126269190613b59565b506001808190555050565b60096020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16905083565b6000806000600960008581526020019081526020016000206000015460096000868152602001908152602001600020600101546009600087815260200190815260200160002060020160009054906101000a900460ff169250925092509193909250565b7fb19546dff01e856fb3f010c267a7b1c60363cf8a4664e21cc89c26224620214e81565b6060600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561277b57602002820191906000526020600020905b815481526020019060010190808311612767575b50505050509050919050565b60075481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600060028360026127c69190613f84565b6127d09190614240565b67ffffffffffffffff8111156127e9576127e8614296565b5b6040519080825280601f01601f19166020018201604052801561281b5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612853576128526139fb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106128b7576128b66139fb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600060018460026128f79190613f84565b6129019190614240565b90505b60018111156129a1577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612943576129426139fb565b5b1a60f81b82828151811061295a576129596139fb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061299a9061464a565b9050612904565b50600084146129e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129dc906146bf565b60405180910390fd5b8091505092915050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b612a6b8282611fa3565b612afa57612a908173ffffffffffffffffffffffffffffffffffffffff1660146127b3565b612a9e8360001c60206127b3565b604051602001612aaf929190614777565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612af191906147ea565b60405180910390fd5b5050565b6000806009600084815260200190815260200160002060000154119050919050565b6000805b600880549050811015612b6b5782600960008381526020019081526020016000206000015403612b58576001915050612b71565b8080612b6390613abc565b915050612b24565b50600090505b919050565b612b808282611fa3565b612c5257600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612bf7612a59565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b612c608282611fa3565b15612d3357600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612cd8612a59565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b612d3f6116ff565b612d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d7590614858565b60405180910390fd5b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612dc2612a59565b604051612dcf91906137ad565b60405180910390a1565b606060008203612e20576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612f34565b600082905060005b60008214612e52578080612e3b90613abc565b915050600a82612e4b919061400d565b9150612e28565b60008167ffffffffffffffff811115612e6e57612e6d614296565b5b6040519080825280601f01601f191660200182016040528015612ea05781602001600182028036833780820191505090505b5090505b60008514612f2d57600182612eb99190613a59565b9150600a85612ec89190614878565b6030612ed49190614240565b60f81b818381518110612eea57612ee96139fb565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85612f26919061400d565b9450612ea4565b8093505050505b919050565b612f4281612afe565b612f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f7890613d1c565b60405180910390fd5b6009600082815260200190815260200160002060020160009054906101000a900460ff16612fe4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fdb9061491b565b60405180910390fd5b50565b6000612ff383836114aa565b905080600b54101561303a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613031906149ad565b60405180910390fd5b92915050565b6130486116ff565b15613088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161307f906143f8565b60405180910390fd5b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586130cc612a59565b6040516130d991906137ad565b60405180910390a1565b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61311d816130e8565b811461312857600080fd5b50565b60008135905061313a81613114565b92915050565b600060208284031215613156576131556130e3565b5b60006131648482850161312b565b91505092915050565b60008115159050919050565b6131828161316d565b82525050565b600060208201905061319d6000830184613179565b92915050565b6000819050919050565b6131b6816131a3565b81146131c157600080fd5b50565b6000813590506131d3816131ad565b92915050565b6000602082840312156131ef576131ee6130e3565b5b60006131fd848285016131c4565b91505092915050565b61320f816131a3565b82525050565b600060208201905061322a6000830184613206565b92915050565b6000819050919050565b61324381613230565b811461324e57600080fd5b50565b6000813590506132608161323a565b92915050565b60006020828403121561327c5761327b6130e3565b5b600061328a84828501613251565b91505092915050565b61329c81613230565b82525050565b60006020820190506132b76000830184613293565b92915050565b6000806000606084860312156132d6576132d56130e3565b5b60006132e4868287016131c4565b93505060206132f5868287016131c4565b9250506040613306868287016131c4565b9150509250925092565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061333b82613310565b9050919050565b61334b81613330565b811461335657600080fd5b50565b60008135905061336881613342565b92915050565b60008060408385031215613385576133846130e3565b5b600061339385828601613251565b92505060206133a485828601613359565b9150509250929050565b600080604083850312156133c5576133c46130e3565b5b60006133d3858286016131c4565b92505060206133e4858286016131c4565b9150509250929050565b60008060408385031215613405576134046130e3565b5b6000613413858286016131c4565b925050602061342485828601613359565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613463816131a3565b82525050565b6000613475838361345a565b60208301905092915050565b6000602082019050919050565b60006134998261342e565b6134a38185613439565b93506134ae8361344a565b8060005b838110156134df5781516134c68882613469565b97506134d183613481565b9250506001810190506134b2565b5085935050505092915050565b60006020820190508181036000830152613506818461348e565b905092915050565b600060208284031215613524576135236130e3565b5b600061353284828501613359565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156135a1578082015181840152602081019050613586565b838111156135b0576000848401525b50505050565b6000601f19601f8301169050919050565b60006135d282613567565b6135dc8185613572565b93506135ec818560208601613583565b6135f5816135b6565b840191505092915050565b600061360c83836135c7565b905092915050565b6000602082019050919050565b600061362c8261353b565b6136368185613546565b93508360208202850161364885613557565b8060005b8581101561368457848403895281516136658582613600565b945061367083613614565b925060208a0199505060018101905061364c565b50829750879550505050505092915050565b600060208201905081810360008301526136b08184613621565b905092915050565b600080604083850312156136cf576136ce6130e3565b5b60006136dd85828601613359565b92505060206136ee858286016131c4565b9150509250929050565b61370181613330565b82525050565b600060e08201905061371c600083018a6136f8565b6137296020830189613206565b6137366040830188613206565b6137436060830187613206565b6137506080830186613206565b61375d60a0830185613206565b61376a60c0830184613179565b98975050505050505050565b600060608201905061378b6000830186613206565b6137986020830185613206565b6137a56040830184613179565b949350505050565b60006020820190506137c260008301846136f8565b92915050565b600082825260208201905092915050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061380f601f836137c8565b915061381a826137d9565b602082019050919050565b6000602082019050818103600083015261383e81613802565b9050919050565b7f5368697274756d205374616b652056323a20556e6c6f636b2074696d6520686160008201527f73206e6f74206172726976656400000000000000000000000000000000000000602082015250565b60006138a1602d836137c8565b91506138ac82613845565b604082019050919050565b600060208201905081810360008301526138d081613894565b9050919050565b7f5368697274756d205374616b652056323a2053656e646572206973206e6f742060008201527f746865206f776e6572206f6620746865206465706f7369740000000000000000602082015250565b60006139336038836137c8565b915061393e826138d7565b604082019050919050565b6000602082019050818103600083015261396281613926565b9050919050565b7f5368697274756d205374616b652056323a206465706f7369742068617320626560008201527f656e20616c72656164792077697468647261776e000000000000000000000000602082015250565b60006139c56034836137c8565b91506139d082613969565b604082019050919050565b600060208201905081810360008301526139f4816139b8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613a64826131a3565b9150613a6f836131a3565b925082821015613a8257613a81613a2a565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000613ac7826131a3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613af957613af8613a2a565b5b600182019050919050565b6000604082019050613b1960008301856136f8565b613b266020830184613206565b9392505050565b613b368161316d565b8114613b4157600080fd5b50565b600081519050613b5381613b2d565b92915050565b600060208284031215613b6f57613b6e6130e3565b5b6000613b7d84828501613b44565b91505092915050565b7f5368697274756e205374616b652056323a20556e61626c6520746f207472616e60008201527f736665722074686520746f6b656e730000000000000000000000000000000000602082015250565b6000613be2602f836137c8565b9150613bed82613b86565b604082019050919050565b60006020820190508181036000830152613c1181613bd5565b9050919050565b7f5368697274756d205374616b652056323a206c6f636b696e672074696d65206d60008201527f7573742062652067726561746572207468616e20300000000000000000000000602082015250565b6000613c746035836137c8565b9150613c7f82613c18565b604082019050919050565b60006020820190508181036000830152613ca381613c67565b9050919050565b7f5368697274756d205374616b652056323a206c6f636b696e6720706572696f6460008201527f20646f65736e2774206578697374730000000000000000000000000000000000602082015250565b6000613d06602f836137c8565b9150613d1182613caa565b604082019050919050565b60006020820190508181036000830152613d3581613cf9565b9050919050565b7f4c6f636b696e672074696d6520616c72656164792065786973747320666f722060008201527f616e6f74686572206c6f636b696e6720706572696f6400000000000000000000602082015250565b6000613d986036836137c8565b9150613da382613d3c565b604082019050919050565b60006020820190508181036000830152613dc781613d8b565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000613e2a602f836137c8565b9150613e3582613dce565b604082019050919050565b60006020820190508181036000830152613e5981613e1d565b9050919050565b7f5368697274756d205374616b652056323a207374616b696e6720706572696f6460008201527f206d7573742062652067726561746572207468616e2030000000000000000000602082015250565b6000613ebc6037836137c8565b9150613ec782613e60565b604082019050919050565b60006020820190508181036000830152613eeb81613eaf565b9050919050565b7f5368697274756d205374616b652056323a206c6f636b696e6720706572696f6460008201527f20616c7265616479206578697374730000000000000000000000000000000000602082015250565b6000613f4e602f836137c8565b9150613f5982613ef2565b604082019050919050565b60006020820190508181036000830152613f7d81613f41565b9050919050565b6000613f8f826131a3565b9150613f9a836131a3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fd357613fd2613a2a565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614018826131a3565b9150614023836131a3565b92508261403357614032613fde565b5b828204905092915050565b7f5368697274756d205374616b652056323a2063616e206f6e6c7920776974686460008201527f726177207570746f20617661696c61626c6520726577617264732062616c616e60208201527f6365000000000000000000000000000000000000000000000000000000000000604082015250565b60006140c06042836137c8565b91506140cb8261403e565b606082019050919050565b600060208201905081810360008301526140ef816140b3565b9050919050565b7f5368697274756d205374616b652056323a2069742773206e6f7420706f73736960008201527f626c6520746f207769746864726177206265666f7220756e6c6f636b2074696d60208201527f6500000000000000000000000000000000000000000000000000000000000000604082015250565b60006141786041836137c8565b9150614183826140f6565b606082019050919050565b600060208201905081810360008301526141a78161416b565b9050919050565b7f5368697274756d205374616b652056323a2041646472657373206d757374206260008201527f6520646966666572656e7420746f207a65726f20616464726573730000000000602082015250565b600061420a603b836137c8565b9150614215826141ae565b604082019050919050565b60006020820190508181036000830152614239816141fd565b9050919050565b600061424b826131a3565b9150614256836131a3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561428b5761428a613a2a565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600081905092915050565b60006142db82613567565b6142e581856142c5565b93506142f5818560208601613583565b80840191505092915050565b7f3b00000000000000000000000000000000000000000000000000000000000000600082015250565b60006143376001836142c5565b915061434282614301565b600182019050919050565b600061435982876142d0565b91506143648261432a565b915061437082866142d0565b915061437b8261432a565b915061438782856142d0565b91506143928261432a565b915061439e82846142d0565b915081905095945050505050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006143e26010836137c8565b91506143ed826143ac565b602082019050919050565b60006020820190508181036000830152614411816143d5565b9050919050565b600060608201905061442d60008301866136f8565b61443a60208301856136f8565b6144476040830184613206565b949350505050565b7f5368697274756d205374616b652056323a20556e61626c6520746f207472616e60008201527f736665722074686520746f6b656e730000000000000000000000000000000000602082015250565b60006144ab602f836137c8565b91506144b68261444f565b604082019050919050565b600060208201905081810360008301526144da8161449e565b9050919050565b60006080820190506144f66000830187613206565b6145036020830186613206565b6145106040830185613206565b61451d6060830184613206565b95945050505050565b7f5368697274756d205374616b652056323a2072657374616b65206973206e6f7460008201527f20656e61626c6564000000000000000000000000000000000000000000000000602082015250565b60006145826028836137c8565b915061458d82614526565b604082019050919050565b600060208201905081810360008301526145b181614575565b9050919050565b7f5368697274756d205374616b652056323a204c6f636b656420746f6b656e206860008201527f6173206265656e20616c72656164792077697468647261776e00000000000000602082015250565b60006146146039836137c8565b915061461f826145b8565b604082019050919050565b6000602082019050818103600083015261464381614607565b9050919050565b6000614655826131a3565b91506000820361466857614667613a2a565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b60006146a96020836137c8565b91506146b482614673565b602082019050919050565b600060208201905081810360008301526146d88161469c565b9050919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006147156017836142c5565b9150614720826146df565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b60006147616011836142c5565b915061476c8261472b565b601182019050919050565b600061478282614708565b915061478e82856142d0565b915061479982614754565b91506147a582846142d0565b91508190509392505050565b60006147bc82613567565b6147c681856137c8565b93506147d6818560208601613583565b6147df816135b6565b840191505092915050565b6000602082019050818103600083015261480481846147b1565b905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b60006148426014836137c8565b915061484d8261480c565b602082019050919050565b6000602082019050818103600083015261487181614835565b9050919050565b6000614883826131a3565b915061488e836131a3565b92508261489e5761489d613fde565b5b828206905092915050565b7f5368697274756d205374616b652056323a206c6f636b696e6720706572696f6460008201527f206973206e6f7420656e61626c65640000000000000000000000000000000000602082015250565b6000614905602f836137c8565b9150614910826148a9565b604082019050919050565b60006020820190508181036000830152614934816148f8565b9050919050565b7f5368697274756d205374616b652056323a20696e737566696369656e7420667560008201527f6e647320746f2070617920726571756972656420726577617264730000000000602082015250565b6000614997603b836137c8565b91506149a28261493b565b604082019050919050565b600060208201905081810360008301526149c68161498a565b905091905056fea2646970667358221220392f50b7ab1a1c66eac659f09350f36a807096f7db7a8f769dadd3e2d746ac4e64736f6c634300080d0033
Verified Source Code Full Match
Compiler: v0.8.13+commit.abaa5c0e
EVM: london
Optimization: No
Address.sol 222 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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);
/**
* @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);
}
AccessControl.sol 223 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
IAccessControl.sol 88 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
ShirtumStakeV2.sol 348 lines
// SPDX-License-Identifier: MIT
pragma solidity = 0.8.13;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract ShirtumStakeV2 is AccessControl, ReentrancyGuard, Pausable {
using Strings for uint256;
// Create a new role identifier for the owner role
bytes32 public constant OWNER_ROLE = keccak256("OWNER_ROLE");
event Deposit(uint256 indexed depositId, address indexed user, uint256 amount, uint256 rewards,
uint256 unlockTime,uint256 apr);
event Withdraw(uint256 indexed depositId, address indexed user, uint256 amount);
event Restake(uint256 indexed depositId, address indexed user);
//Struct that holds each deposit data
struct Deposits {
address user;
uint256 amount;
uint256 rewards;
uint256 total;
uint256 apr;
uint256 unlockTime;
bool withdrawn;
}
//Struct that holds the locking period data
struct LockingPeriod {
uint256 lockingTime; //Time to lock the funds (expressed in days)
uint256 value; //APR
bool enabled;
}
//Deposits index
uint256 public depositId;
//Array of all deposits IDs
uint256[] public allDepositIds;
//User deposits
mapping (address => uint256[]) public depositsByAddress;
//Indexed deposits
mapping (uint256 => Deposits) public lockedDeposits;
//Lockin periods index
uint256 public periodsId;
//Array of all periods IDs
uint256[] public allPeriodsIds;
//Indexed locking periods
mapping (uint256 => LockingPeriod) public lockingPeriods;
//ERC20 Token
address public token;
//Available rewards
uint256 public availableRewards;
//Unlock time for admin withdraw
uint256 public adminWidrawUnlockTime;
//Variable that defines if restake option is enabled;
bool public restakeEnabled;
constructor (address _token,uint256[] memory _lockingPeriods,uint256[] memory intrestRates ) {
require(_token != address(0x0), 'Shirtum Stake V2: Address must be different to zero address');
require(_lockingPeriods.length == intrestRates.length, "Shirtum Stake V2: Amounts length must be equals to locking periods length");
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(OWNER_ROLE,msg.sender);
token = _token;
//Available rewards balance can be withdrawn only after the first year.
adminWidrawUnlockTime = block.timestamp + 365 days;
//Load of initial locking periods
for (uint256 i=0; i<_lockingPeriods.length; i++)
{
addLockingPeriod(_lockingPeriods[i], intrestRates[i]);
}
}
/**
* @dev Returns the total balance of the user.
*/
function balanceOf(address user) public view returns (uint256 balance) {
uint256[] memory ids = depositsByAddress[user];
for (uint256 i; i < ids.length;i++){
balance += lockedDeposits[ids[i]].total;
}
return balance;
}
/**
* @dev Validates that locking period exists and it's enabled.
*/
function validateLockinPeriod(uint256 periodId) internal view{
//Check that lockingPeriod-APR exists
require(lockingPeriodExistsById(periodId),"Shirtum Stake V2: locking period doesn't exists");
//Check that lockingPeriod-APR es enabled
require(lockingPeriods[periodId].enabled,"Shirtum Stake V2: locking period is not enabled");
}
/**
* @dev Validates available rewards.
* Returns rewards
*/
function validateRewards(uint256 amount,uint256 periodId) internal view returns(uint256 rewards){
rewards = calculateRewards(amount, periodId);
//Check that required rewards are available
require(availableRewards >= rewards,'Shirtum Stake V2: insuficient funds to pay required rewards');
return rewards;
}
/**
* @dev Returns the rewards for the given amount and locking period
*/
function calculateRewards(uint256 amount, uint256 periodId) public view returns(uint256 rewards){
uint intrestRate = lockingPeriods[periodId].value;
uint lockingTime = lockingPeriods[periodId].lockingTime;
return (amount * intrestRate * lockingTime) / (100 * 365);
}
/**
* @dev Generates the deposit
* Requirements: contract must not be paused
*
*/
function stake(uint256 amount,uint256 periodId) public nonReentrant whenNotPaused{
validateLockinPeriod(periodId);
uint256 rewards = validateRewards(amount, periodId);
uint256 _id = depositId++;
//Create the deposit
lockedDeposits[_id].user = msg.sender;
lockedDeposits[_id].amount = amount;
lockedDeposits[_id].rewards = rewards;
lockedDeposits[_id].total = amount + rewards;
lockedDeposits[_id].apr = lockingPeriods[periodId].value;
lockedDeposits[_id].unlockTime = block.timestamp + (lockingPeriods[periodId].lockingTime * 1 days);
lockedDeposits[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByAddress[msg.sender].push(_id);
//Update available rewards
availableRewards -= rewards;
require(
IERC20(token).transferFrom(msg.sender, address(this), amount),
"Shirtum Stake V2: Unable to transfer the tokens"
);
emit Deposit(_id,msg.sender, amount,rewards,lockedDeposits[_id].unlockTime,lockingPeriods[periodId].value);
}
/**
* @dev Update a specific deposit details (unlocktime and/or intrest rate applied)
*
*/
function restake(uint256 _id,uint256 periodId) public nonReentrant{
require(restakeEnabled,"Shirtum Stake V2: restake is not enabled");
validateLockinPeriod(periodId);
require(!lockedDeposits[_id].withdrawn, "Shirtum Stake V2: Locked token has been already withdrawn");
require(msg.sender == lockedDeposits[_id].user, "Shirtum Stake V2: Sender is not the owner of the deposit");
uint256 amount = lockedDeposits[_id].total;
uint256 rewards = validateRewards(amount, periodId);
uint256 unlockTime = lockedDeposits[_id].unlockTime > block.timestamp ? lockedDeposits[_id].unlockTime : block.timestamp;
//Update deposit values
lockedDeposits[_id].total += rewards;
lockedDeposits[_id].unlockTime = unlockTime + (lockingPeriods[periodId].lockingTime * 1 days);
//Update available rewards
availableRewards -= rewards;
emit Deposit(_id,msg.sender, amount,rewards,lockedDeposits[_id].unlockTime,lockingPeriods[periodId].value);
emit Restake(_id,msg.sender);
}
/**
* @dev Withdraw user deposit
* Requirements: unlock time has to be reached.
*
*/
function withdraw(uint256 _id) public nonReentrant{
require(block.timestamp >= lockedDeposits[_id].unlockTime, "Shirtum Stake V2: Unlock time has not arrived");
require(msg.sender == lockedDeposits[_id].user, "Shirtum Stake V2: Sender is not the owner of the deposit");
require(!lockedDeposits[_id].withdrawn, "Shirtum Stake V2: deposit has been already withdrawn");
lockedDeposits[_id].withdrawn = true;
//Remove this id from this address
uint256 totalByAddress = depositsByAddress[lockedDeposits[_id].user].length;
for (uint256 i = 0; i < totalByAddress; i++) {
if (depositsByAddress[lockedDeposits[_id].user][i] == _id) {
depositsByAddress[lockedDeposits[_id].user][i] = depositsByAddress[lockedDeposits[_id].user][totalByAddress - 1];
depositsByAddress[lockedDeposits[_id].user].pop();
break;
}
}
//Transfer tokens to user
require(
IERC20(token).transfer(msg.sender, lockedDeposits[_id].total),
"Shirtun Stake V2: Unable to transfer the tokens"
);
emit Withdraw(_id,msg.sender, lockedDeposits[_id].total);
}
function transferRewardFunds(uint256 amount) public nonReentrant{
availableRewards += amount;
IERC20(token).transferFrom(msg.sender, address(this), amount);
}
function adminWithdraw(uint256 amount,address withdrawalWallet) public onlyRole(OWNER_ROLE){
require(amount <= availableRewards,"Shirtum Stake V2: can only withdraw upto available rewards balance");
require(block.timestamp >= adminWidrawUnlockTime,"Shirtum Stake V2: it's not possible to withdraw befor unlock time");
require(withdrawalWallet != address(0x0), 'Shirtum Stake V2: Address must be different to zero address');
availableRewards -= amount;
IERC20(token).transfer(withdrawalWallet, amount);
}
function lockingPeriodExists(uint256 lockingTime) internal view returns(bool){
for (uint256 i;i<allPeriodsIds.length;i++){
if (lockingPeriods[i].lockingTime == lockingTime){
return true;
}
}
return false;
}
function lockingPeriodExistsById(uint256 periodId) internal view returns(bool){
return lockingPeriods[periodId].lockingTime > 0;
}
function toggleLockingPeriodStatus(uint256 periodId) public onlyRole(OWNER_ROLE){
require(lockingPeriodExistsById(periodId),"Shirtum Stake V2: locking period doesn't exists");
lockingPeriods[periodId].enabled = !lockingPeriods[periodId].enabled;
}
function addLockingPeriod (uint256 lockingTime, uint256 intrestRate) public onlyRole(OWNER_ROLE){
require(lockingTime > 0, "Shirtum Stake V2: staking period must be greater than 0");
require(!lockingPeriodExists(lockingTime),"Shirtum Stake V2: locking period already exists");
uint256 periodId = periodsId++;
lockingPeriods[periodId].lockingTime = lockingTime;
lockingPeriods[periodId].value = intrestRate;
lockingPeriods[periodId].enabled = true;
allPeriodsIds.push(periodId);
}
function updateLockingPeriod (uint256 periodId,uint256 lockingTime, uint256 intrestRate) public onlyRole(OWNER_ROLE){
require(lockingTime > 0, "Shirtum Stake V2: locking time must be greater than 0");
require(lockingPeriodExistsById(periodId),"Shirtum Stake V2: locking period doesn't exists");
//Reverts operation if locking time already exists for another locking period
if (lockingPeriodExists(lockingTime) && lockingPeriods[periodId].lockingTime != lockingTime){
revert("Locking time already exists for another locking period");
}
lockingPeriods[periodId].lockingTime = lockingTime;
lockingPeriods[periodId].value = intrestRate;
}
function getAllLockingPeriodsDetails() view external returns (string[] memory arr)
{
arr = new string[](allPeriodsIds.length);
for (uint256 i;i<allPeriodsIds.length;i++){
arr[i] = string(abi.encodePacked(i.toString(),";",
lockingPeriods[i].lockingTime.toString(),";",
lockingPeriods[i].value.toString(),";",
lockingPeriods[i].enabled ? (uint256(1).toString()) : uint256(0).toString()));
}
return arr;
}
function getAllLockingPeriodsIds() view external returns (uint256[] memory)
{
return allPeriodsIds;
}
function getLockingPeriodsDetails(uint256 _id) view external returns (uint256 lockingTime, uint256 value,bool enabled)
{
return (
lockingPeriods[_id].lockingTime,
lockingPeriods[_id].value,
lockingPeriods[_id].enabled
);
}
function getAllDepositIds() external view returns (uint256[] memory)
{
return allDepositIds;
}
function getDepositDetails(uint256 _id) external view returns (address _user, uint256 _amount,
uint256 _rewards, uint256 _total, uint256 _apr,uint256 _unlockTime, bool _withdrawn)
{
return (
lockedDeposits[_id].user,
lockedDeposits[_id].amount,
lockedDeposits[_id].rewards,
lockedDeposits[_id].total,
lockedDeposits[_id].apr,
lockedDeposits[_id].unlockTime,
lockedDeposits[_id].withdrawn
);
}
function getDepositsByAddress(address _address) view public returns (uint256[] memory)
{
return depositsByAddress[_address];
}
function pause() public onlyRole(OWNER_ROLE) {
_pause();
}
function unpause() public onlyRole(OWNER_ROLE) {
_unpause();
}
function toggleRestakeEnabledStatus() public onlyRole(OWNER_ROLE){
restakeEnabled = !restakeEnabled;
}
receive () external payable {
revert();
}
}
ReentrancyGuard.sol 63 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
OWNER_ROLE 0xe58378bb → bytes32
adminWidrawUnlockTime 0x4a0f085c → uint256
allDepositIds 0xc9028aff → uint256
allPeriodsIds 0x1e58f6db → uint256
availableRewards 0x879d9090 → uint256
balanceOf 0x70a08231 → uint256
calculateRewards 0x48a88706 → uint256
depositId 0x9852099c → uint256
depositsByAddress 0x7f258bfb → uint256
getAllDepositIds 0x6ba03924 → uint256[]
getAllLockingPeriodsDetails 0x772e0f03 → string[]
getAllLockingPeriodsIds 0x89ef50a0 → uint256[]
getDepositDetails 0x890db72f → address, uint256, uint256, uint256, uint256, uint256, bool
getDepositsByAddress 0xea70c9dc → uint256[]
getLockingPeriodsDetails 0xdbf7d253 → uint256, uint256, bool
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
lockedDeposits 0xb82c5899 → address, uint256, uint256, uint256, uint256, uint256, bool
lockingPeriods 0xdbef8689 → uint256, uint256, bool
paused 0x5c975abb → bool
periodsId 0xf701965d → uint256
restakeEnabled 0x124be9e0 → bool
supportsInterface 0x01ffc9a7 → bool
token 0xfc0c546a → address
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
addLockingPeriod 0x412d954f
uint256 lockingTime
uint256 intrestRate
adminWithdraw 0x5a09a413
uint256 amount
address withdrawalWallet
grantRole 0x2f2ff15d
bytes32 role
address account
pause 0x8456cb59
No parameters
renounceRole 0x36568abe
bytes32 role
address account
restake 0xb8e7023d
uint256 _id
uint256 periodId
revokeRole 0xd547741f
bytes32 role
address account
stake 0x7b0472f0
uint256 amount
uint256 periodId
toggleLockingPeriodStatus 0xbb4e96a6
uint256 periodId
toggleRestakeEnabledStatus 0x2f6169b5
No parameters
transferRewardFunds 0xd9a27610
uint256 amount
unpause 0x3f4ba83a
No parameters
updateLockingPeriod 0x2ec08669
uint256 periodId
uint256 lockingTime
uint256 intrestRate
withdraw 0x2e1a7d4d
uint256 _id
Recent Transactions
No transactions found for this address