Address Contract Partially Verified
Address
0xF2bAB5000f909b5765F61a71fbd76CE749d59FD6
Balance
0 ETH
Nonce
1
Code Size
17584 bytes
Creator
0x01d376Cd...5324 at tx 0xd36f0c13...8c3659
Indexed Transactions
0
Contract Bytecode
17584 bytes
0x608060405234801561001057600080fd5b50600436106102535760003560e01c8063715018a611610146578063afdbec5f116100c3578063d74ce03911610087578063d74ce039146106d0578063e031dc8c146106ec578063e09bcc2a146106f6578063e3e8421314610712578063f2fde38b1461072e578063fc0c546a1461074a57610253565b8063afdbec5f14610654578063b5769c6e1461065e578063cf8494421461067a578063d18ab7ee14610698578063d547741f146106b457610253565b80638da5cb5b1161010a5780638da5cb5b146105b057806391d14854146105ce578063a217fddf146105fe578063a8a65a781461061c578063ae04d45d1461063857610253565b8063715018a61461051e5780637c0b8de214610528578063850a7db1146105465780638abb1e74146105625780638cf756d61461058057610253565b806336568abe116101d45780635a648bc5116101985780635a648bc51461048e5780635dbdda69146104985780636643d795146104b657806369d03738146104d25780636c961ab9146104ee57610253565b806336568abe146103d8578063405ce7f4146103f4578063413d9c3a146104245780634d6ce1e5146104425780635838a5031461045e57610253565b806327a38f381161021b57806327a38f38146103225780632b535f23146103405780632f2ff15d1461035c57806332ac487f14610378578063350b99f8146103a857610253565b806301ffc9a714610258578063097337c4146102885780631680889f146102b8578063248a9ca3146102d657806326a4e8d214610306575b600080fd5b610272600480360381019061026d9190613395565b610768565b60405161027f91906133dd565b60405180910390f35b6102a2600480360381019061029d9190613456565b6107e2565b6040516102af919061349c565b60405180910390f35b6102c061092c565b6040516102cd919061349c565b60405180910390f35b6102f060048036038101906102eb91906134ed565b610932565b6040516102fd9190613529565b60405180910390f35b610320600480360381019061031b9190613456565b610952565b005b61032a610a0b565b6040516103379190613529565b60405180910390f35b61035a600480360381019061035591906136c9565b610a2f565b005b61037660048036038101906103719190613712565b610b64565b005b610392600480360381019061038d9190613456565b610b85565b60405161039f919061349c565b60405180910390f35b6103c260048036038101906103bd9190613752565b610d9d565b6040516103cf919061349c565b60405180910390f35b6103f260048036038101906103ed9190613712565b610dc5565b005b61040e6004803603810190610409919061377f565b610e48565b60405161041b919061349c565b60405180910390f35b61042c610f30565b604051610439919061349c565b60405180910390f35b61045c60048036038101906104579190613752565b610f36565b005b61047860048036038101906104739190613456565b61110e565b604051610485919061349c565b60405180910390f35b61049661115e565b005b6104a0611405565b6040516104ad919061349c565b60405180910390f35b6104d060048036038101906104cb919061377f565b61140b565b005b6104ec60048036038101906104e79190613456565b6115a1565b005b61050860048036038101906105039190613456565b61165a565b604051610515919061349c565b60405180910390f35b6105266116b7565b005b6105306117ea565b60405161053d919061381e565b60405180910390f35b610560600480360381019061055b9190613752565b611810565b005b61056a61188f565b604051610577919061349c565b60405180910390f35b61059a60048036038101906105959190613752565b611895565b6040516105a79190613848565b60405180910390f35b6105b86118d2565b6040516105c59190613848565b60405180910390f35b6105e860048036038101906105e39190613712565b6118fb565b6040516105f591906133dd565b60405180910390f35b610606611966565b6040516106139190613529565b60405180910390f35b61063660048036038101906106319190613752565b61196d565b005b610652600480360381019061064d9190613752565b6119ec565b005b61065c611a6b565b005b61067860048036038101906106739190613456565b611cb3565b005b610682611eba565b60405161068f919061349c565b60405180910390f35b6106b260048036038101906106ad9190613752565b611ec0565b005b6106ce60048036038101906106c99190613712565b612361565b005b6106ea60048036038101906106e591906136c9565b612382565b005b6106f4612548565b005b610710600480360381019061070b9190613863565b6125a3565b005b61072c60048036038101906107279190613752565b612705565b005b61074860048036038101906107439190613456565b612784565b005b610752612926565b60405161075f91906138e0565b60405180910390f35b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107db57506107da8261294c565b5b9050919050565b60008061082c600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b90508060045461083c919061392a565b91506002811415610872576064601483610856919061392a565b61086091906139b3565b8261086b91906139e4565b9150610926565b600381101580156108835750600581105b156108b3576064601983610897919061392a565b6108a191906139b3565b826108ac91906139e4565b9150610925565b600581101580156108c45750600a81105b156108f45760646023836108d8919061392a565b6108e291906139b3565b826108ed91906139e4565b9150610924565b600a8110610923576064602d8361090b919061392a565b61091591906139b3565b8261092091906139e4565b91505b5b5b5b50919050565b60055481565b600060016000838152602001908152602001600020600101549050919050565b3373ffffffffffffffffffffffffffffffffffffffff166109716118d2565b73ffffffffffffffffffffffffffffffffffffffff16146109c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109be90613a97565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f119d402b077b57613c1ce8f853b9170aebd415a21f15e4121d3534150a8b97ce81565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638462151c336040518263ffffffff1660e01b8152600401610a8c9190613848565b600060405180830381865afa158015610aa9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610ad29190613b63565b5111610b13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0a90613bf8565b60405180910390fd5b600081511115610b615760005b8151811015610b5f57610b4c828281518110610b3f57610b3e613c18565b5b6020026020010151610f36565b8080610b5790613c47565b915050610b20565b505b50565b610b6d82610932565b610b76816129cb565b610b8083836129df565b505050565b600080610bcf600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b905060005b81811015610cae576000610c2f82600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612abf90919063ffffffff16565b90506000600a6000838152602001908152602001600020541115610c9a576000600a60008381526020019081526020016000205442610c6e9190613c90565b905060075460045482610c81919061392a565b610c8b91906139b3565b85610c9691906139e4565b9450505b508080610ca690613c47565b915050610bd4565b506002811415610ce3576064601483610cc7919061392a565b610cd191906139b3565b82610cdc91906139e4565b9150610d97565b60038110158015610cf45750600581105b15610d24576064601983610d08919061392a565b610d1291906139b3565b82610d1d91906139e4565b9150610d96565b60058110158015610d355750600a81105b15610d65576064602383610d49919061392a565b610d5391906139b3565b82610d5e91906139e4565b9150610d95565b600a8110610d94576064602d83610d7c919061392a565b610d8691906139b3565b82610d9191906139e4565b91505b5b5b5b50919050565b6000600a60008381526020019081526020016000205442610dbe9190613c90565b9050919050565b610dcd612ad9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610e3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3190613d36565b60405180910390fd5b610e448282612ae1565b5050565b600080610e92600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b9050828111610ed6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ecd90613d7c565b60405180910390fd5b610f2783600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612abf90919063ffffffff16565b91505092915050565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614610fa4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9b90613e0e565b60405180910390fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b815260040161100393929190613e2e565b600060405180830381600087803b15801561101d57600080fd5b505af1158015611031573d6000803e3d6000fd5b5050505061108681600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612bc390919063ffffffff16565b5042600a60008381526020019081526020016000208190555033600c600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d600082825461110491906139e4565b9250508190555050565b6000611157600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b9050919050565b6111a5600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b6005546111b2919061392a565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b815260040161120d9190613848565b602060405180830381865afa15801561122a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124e9190613e65565b101561128f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128690613f04565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff16146112fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f490613e0e565b60405180910390fd5b5b6000611347600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b11156114035760006001611398600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b6113a29190613c90565b90506113fd6113f882600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612abf90919063ffffffff16565b611ec0565b506112fe565b565b60075481565b7f119d402b077b57613c1ce8f853b9170aebd415a21f15e4121d3534150a8b97ce611435816129cb565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8430856040518463ffffffff1660e01b815260040161149493929190613e2e565b600060405180830381600087803b1580156114ae57600080fd5b505af11580156114c2573d6000803e3d6000fd5b5050505061151782600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612bc390919063ffffffff16565b5042600a60008481526020019081526020016000208190555082600c600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d600082825461159591906139e4565b92505081905550505050565b3373ffffffffffffffffffffffffffffffffffffffff166115c06118d2565b73ffffffffffffffffffffffffffffffffffffffff1614611616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160d90613a97565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006116a3600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b6005546116b0919061392a565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff166116d66118d2565b73ffffffffffffffffffffffffffffffffffffffff161461172c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172390613a97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff1661182f6118d2565b73ffffffffffffffffffffffffffffffffffffffff1614611885576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187c90613a97565b60405180910390fd5b8060058190555050565b600d5481565b6000600c600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b81565b3373ffffffffffffffffffffffffffffffffffffffff1661198c6118d2565b73ffffffffffffffffffffffffffffffffffffffff16146119e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d990613a97565b60405180910390fd5b8060048190555050565b3373ffffffffffffffffffffffffffffffffffffffff16611a0b6118d2565b73ffffffffffffffffffffffffffffffffffffffff1614611a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5890613a97565b60405180910390fd5b8060068190555050565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614611ad9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad090613e0e565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638462151c336040518263ffffffff1660e01b8152600401611b369190613848565b600060405180830381865afa158015611b53573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611b7c9190613b63565b5111611bbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb490613bf8565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638462151c336040518263ffffffff1660e01b8152600401611c1a9190613848565b600060405180830381865afa158015611c37573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611c609190613b63565b9050600081511115611cb05760005b8151811015611cae57611c9b828281518110611c8e57611c8d613c18565b5b6020026020010151610f36565b8080611ca690613c47565b915050611c6f565b505b50565b7f119d402b077b57613c1ce8f853b9170aebd415a21f15e4121d3534150a8b97ce611cdd816129cb565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638462151c846040518263ffffffff1660e01b8152600401611d3a9190613848565b600060405180830381865afa158015611d57573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611d809190613b63565b5111611dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611db890613bf8565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638462151c846040518263ffffffff1660e01b8152600401611e1e9190613848565b600060405180830381865afa158015611e3b573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190611e649190613b63565b9050600081511115611eb55760005b8151811015611eb357611ea084838381518110611e9357611e92613c18565b5b602002602001015161140b565b8080611eab90613c47565b915050611e73565b505b505050565b60045481565b600e60009054906101000a900460ff1615611eda57600080fd5b6001600e60006101000a81548160ff021916908315150217905550600554600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401611f539190613848565b602060405180830381865afa158015611f70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f949190613e65565b1015611fd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fcc90613f04565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90613e0e565b60405180910390fd5b61209481600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612bdd90919063ffffffff16565b6120d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ca90613f70565b60405180910390fd5b600654600a600083815260200190815260200160002054426120f59190613c90565b11612135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212c90613fdc565b60405180910390fd5b61218681600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612bf790919063ffffffff16565b506000600a6000838152602001908152602001600020819055506000600c600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600d60008282546122069190613c90565b92505081905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3033846040518463ffffffff1660e01b815260040161226c93929190613e2e565b600060405180830381600087803b15801561228657600080fd5b505af115801561229a573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306005546040518463ffffffff1660e01b81526004016122ff93929190613e2e565b6020604051808303816000875af115801561231e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123429190614028565b506000600e60006101000a81548160ff02191690831515021790555050565b61236a82610932565b612373816129cb565b61237d8383612ae1565b505050565b60006123cb600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b1161240b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612402906140a1565b60405180910390fd5b805160055461241a919061392a565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b81526004016124759190613848565b602060405180830381865afa158015612492573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b69190613e65565b10156124f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ee90613f04565b60405180910390fd5b6000815111156125455760005b81518110156125435761253082828151811061252357612522613c18565b5b6020026020010151611ec0565b808061253b90613c47565b915050612504565b505b50565b600e60009054906101000a900460ff161561256257600080fd5b6001600e60006101000a81548160ff02191690831515021790555061258633612c11565b6000600e60006101000a81548160ff021916908315150217905550565b7f119d402b077b57613c1ce8f853b9170aebd415a21f15e4121d3534150a8b97ce6125cd816129cb565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638462151c856040518263ffffffff1660e01b815260040161262a9190613848565b600060405180830381865afa158015612647573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906126709190613b63565b51116126b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a890613bf8565b60405180910390fd5b6000825111156127005760005b82518110156126fe576126eb848483815181106126de576126dd613c18565b5b602002602001015161140b565b80806126f690613c47565b9150506126be565b505b505050565b3373ffffffffffffffffffffffffffffffffffffffff166127246118d2565b73ffffffffffffffffffffffffffffffffffffffff161461277a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161277190613a97565b60405180910390fd5b8060078190555050565b3373ffffffffffffffffffffffffffffffffffffffff166127a36118d2565b73ffffffffffffffffffffffffffffffffffffffff16146127f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127f090613a97565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286090614133565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60006129c482600001612d84565b9050919050565b6129dc816129d7612ad9565b612d95565b50565b6129e982826118fb565b612abb57600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612a60612ad9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000612ace8360000183612e1a565b60001c905092915050565b600033905090565b612aeb82826118fb565b15612bbf5760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612b64612ad9565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000612bd5836000018360001b612e8e565b905092915050565b6000612bef836000018360001b612efe565b905092915050565b6000612c09836000018360001b612f21565b905092915050565b3373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7690613e0e565b60405180910390fd5b6000612c8a82610b85565b90506000612cd5600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206129b6565b905060005b81811015612d63576000612d3582600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612abf90919063ffffffff16565b905042600a600083815260200190815260200160002081905550508080612d5b90613c47565b915050612cda565b506000821415612d74575050612d81565b612d7e838361302d565b50505b50565b600081600001805490509050919050565b612d9f82826118fb565b612e1657612dac816130c0565b612dba8360001c60206130ed565b604051602001612dcb929190614265565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e0d91906142d8565b60405180910390fd5b5050565b600081836000018054905011612e65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e5c9061436c565b60405180910390fd5b826000018281548110612e7b57612e7a613c18565b5b9060005260206000200154905092915050565b6000612e9a8383612efe565b612ef3578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612ef8565b600090505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114613021576000600182612f539190613c90565b9050600060018660000180549050612f6b9190613c90565b90506000866000018281548110612f8557612f84613c18565b5b9060005260206000200154905080876000018481548110612fa957612fa8613c18565b5b9060005260206000200181905550838760010160008381526020019081526020016000208190555086600001805480612fe557612fe461438c565b5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050613027565b60009150505b92915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1983836040518363ffffffff1660e01b815260040161308a9291906143bb565b600060405180830381600087803b1580156130a457600080fd5b505af11580156130b8573d6000803e3d6000fd5b505050505050565b60606130e68273ffffffffffffffffffffffffffffffffffffffff16601460ff166130ed565b9050919050565b606060006002836002613100919061392a565b61310a91906139e4565b67ffffffffffffffff8111156131235761312261355a565b5b6040519080825280601f01601f1916602001820160405280156131555781602001600182028036833780820191505090505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061318d5761318c613c18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106131f1576131f0613c18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002613231919061392a565b61323b91906139e4565b90505b60018111156132db577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061327d5761327c613c18565b5b1a60f81b82828151811061329457613293613c18565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c9450806132d4906143e4565b905061323e565b506000841461331f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133169061445a565b60405180910390fd5b8091505092915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6133728161333d565b811461337d57600080fd5b50565b60008135905061338f81613369565b92915050565b6000602082840312156133ab576133aa613333565b5b60006133b984828501613380565b91505092915050565b60008115159050919050565b6133d7816133c2565b82525050565b60006020820190506133f260008301846133ce565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613423826133f8565b9050919050565b61343381613418565b811461343e57600080fd5b50565b6000813590506134508161342a565b92915050565b60006020828403121561346c5761346b613333565b5b600061347a84828501613441565b91505092915050565b6000819050919050565b61349681613483565b82525050565b60006020820190506134b1600083018461348d565b92915050565b6000819050919050565b6134ca816134b7565b81146134d557600080fd5b50565b6000813590506134e7816134c1565b92915050565b60006020828403121561350357613502613333565b5b6000613511848285016134d8565b91505092915050565b613523816134b7565b82525050565b600060208201905061353e600083018461351a565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61359282613549565b810181811067ffffffffffffffff821117156135b1576135b061355a565b5b80604052505050565b60006135c4613329565b90506135d08282613589565b919050565b600067ffffffffffffffff8211156135f0576135ef61355a565b5b602082029050602081019050919050565b600080fd5b61360f81613483565b811461361a57600080fd5b50565b60008135905061362c81613606565b92915050565b6000613645613640846135d5565b6135ba565b9050808382526020820190506020840283018581111561366857613667613601565b5b835b81811015613691578061367d888261361d565b84526020840193505060208101905061366a565b5050509392505050565b600082601f8301126136b0576136af613544565b5b81356136c0848260208601613632565b91505092915050565b6000602082840312156136df576136de613333565b5b600082013567ffffffffffffffff8111156136fd576136fc613338565b5b6137098482850161369b565b91505092915050565b6000806040838503121561372957613728613333565b5b6000613737858286016134d8565b925050602061374885828601613441565b9150509250929050565b60006020828403121561376857613767613333565b5b60006137768482850161361d565b91505092915050565b6000806040838503121561379657613795613333565b5b60006137a485828601613441565b92505060206137b58582860161361d565b9150509250929050565b6000819050919050565b60006137e46137df6137da846133f8565b6137bf565b6133f8565b9050919050565b60006137f6826137c9565b9050919050565b6000613808826137eb565b9050919050565b613818816137fd565b82525050565b6000602082019050613833600083018461380f565b92915050565b61384281613418565b82525050565b600060208201905061385d6000830184613839565b92915050565b6000806040838503121561387a57613879613333565b5b600061388885828601613441565b925050602083013567ffffffffffffffff8111156138a9576138a8613338565b5b6138b58582860161369b565b9150509250929050565b60006138ca826137eb565b9050919050565b6138da816138bf565b82525050565b60006020820190506138f560008301846138d1565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061393582613483565b915061394083613483565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613979576139786138fb565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006139be82613483565b91506139c983613483565b9250826139d9576139d8613984565b5b828204905092915050565b60006139ef82613483565b91506139fa83613483565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a2f57613a2e6138fb565b5b828201905092915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613a81602083613a3a565b9150613a8c82613a4b565b602082019050919050565b60006020820190508181036000830152613ab081613a74565b9050919050565b600081519050613ac681613606565b92915050565b6000613adf613ada846135d5565b6135ba565b90508083825260208201905060208402830185811115613b0257613b01613601565b5b835b81811015613b2b5780613b178882613ab7565b845260208401935050602081019050613b04565b5050509392505050565b600082601f830112613b4a57613b49613544565b5b8151613b5a848260208601613acc565b91505092915050565b600060208284031215613b7957613b78613333565b5b600082015167ffffffffffffffff811115613b9757613b96613338565b5b613ba384828501613b35565b91505092915050565b7f4e6f20746f6b656e7320617661696c61626c652e000000000000000000000000600082015250565b6000613be2601483613a3a565b9150613bed82613bac565b602082019050919050565b60006020820190508181036000830152613c1181613bd5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000613c5282613483565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613c8557613c846138fb565b5b600182019050919050565b6000613c9b82613483565b9150613ca683613483565b925082821015613cb957613cb86138fb565b5b828203905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000613d20602f83613a3a565b9150613d2b82613cc4565b604082019050919050565b60006020820190508181036000830152613d4f81613d13565b9050919050565b50565b6000613d66600083613a3a565b9150613d7182613d56565b600082019050919050565b60006020820190508181036000830152613d9581613d59565b9050919050565b7f436f6e74726163742063616e27742061636365737320746869732066756e637460008201527f696f6e0000000000000000000000000000000000000000000000000000000000602082015250565b6000613df8602383613a3a565b9150613e0382613d9c565b604082019050919050565b60006020820190508181036000830152613e2781613deb565b9050919050565b6000606082019050613e436000830186613839565b613e506020830185613839565b613e5d604083018461348d565b949350505050565b600060208284031215613e7b57613e7a613333565b5b6000613e8984828501613ab7565b91505092915050565b7f596f7520646f206e6f74206861766520656e6f7567682024504c544e4d20746f60008201527f20776974686472617720796f7572205072696d61746573000000000000000000602082015250565b6000613eee603783613a3a565b9150613ef982613e92565b604082019050919050565b60006020820190508181036000830152613f1d81613ee1565b9050919050565b7f4e4654206e6f74207374616b6564206279204163636f756e7400000000000000600082015250565b6000613f5a601983613a3a565b9150613f6582613f24565b602082019050919050565b60006020820190508181036000830152613f8981613f4d565b9050919050565b7f4e46542063616e277420626520756e7374616b6564206e6f772e000000000000600082015250565b6000613fc6601a83613a3a565b9150613fd182613f90565b602082019050919050565b60006020820190508181036000830152613ff581613fb9565b9050919050565b614005816133c2565b811461401057600080fd5b50565b60008151905061402281613ffc565b92915050565b60006020828403121561403e5761403d613333565b5b600061404c84828501614013565b91505092915050565b7f596f7520646f206e6f74206861766520616e79207374616b6564204e46547300600082015250565b600061408b601f83613a3a565b915061409682614055565b602082019050919050565b600060208201905081810360008301526140ba8161407e565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061411d602683613a3a565b9150614128826140c1565b604082019050919050565b6000602082019050818103600083015261414c81614110565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000614194601783614153565b915061419f8261415e565b601782019050919050565b600081519050919050565b60005b838110156141d35780820151818401526020810190506141b8565b838111156141e2576000848401525b50505050565b60006141f3826141aa565b6141fd8185614153565b935061420d8185602086016141b5565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b600061424f601183614153565b915061425a82614219565b601182019050919050565b600061427082614187565b915061427c82856141e8565b915061428782614242565b915061429382846141e8565b91508190509392505050565b60006142aa826141aa565b6142b48185613a3a565b93506142c48185602086016141b5565b6142cd81613549565b840191505092915050565b600060208201905081810360008301526142f2818461429f565b905092915050565b7f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008201527f6473000000000000000000000000000000000000000000000000000000000000602082015250565b6000614356602283613a3a565b9150614361826142fa565b604082019050919050565b6000602082019050818103600083015261438581614349565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006040820190506143d06000830185613839565b6143dd602083018461348d565b9392505050565b60006143ef82613483565b91506000821415614403576144026138fb565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000614444602083613a3a565b915061444f8261440e565b602082019050919050565b6000602082019050818103600083015261447381614437565b905091905056fea2646970667358221220acf73aefc882ebf71e544794930ed2e529092c9e1c6587ef2c4d9259a0ee42c364736f6c634300080a0033
Verified Source Code Partial Match
Compiler: v0.8.10+commit.fc410830
EVM: london
Optimization: No
PlatinumStaking.sol 1255 lines
/* 2022 Platinum Primates Staking Contract 10232022
.
.
,%%%@@@@@@# ##@@@@@#
@@@@@,,,,,@@@@&*@@@,,,&@@@
%%%% ,@@@@%@@@@@%@@@@@@%%@@@%%@@
@& &@ ,@@@@ @@@@@@@@ @@@@@
&&&,*..*,,@@ ,@@@@ @@/@@@@ @@@@
@@&,*@&&* @@ @@@@@@@@@@@@@,,,,, @@@@
,@&%%/%@&& #@@@@@@@&&/,///// @@@#
,&@@@&@@@@@@@@&&&&,@@@@@@@
%%%% @&&&@@@@@@@@@@@@@@&*@@@@@@##
@@@@@ @@& @&&&@@& *@@@@,@&*, * @@
%%@@@@@ *&&*&@@@@@@@@@%%%%#%%@@@%,@@
@@@@@@@@@ **@&,***@&@@@&@@@&@@&&*&@@@
@@@@@@@@%% /@@@@&%%%%%%%%%%%%%%@@@// @%
.,., @@@@@@@@@@@ *,*&&&&&&&&&@@&@&&&* @@
........,,@@@@@@@@@@%% %%@@@
,,....&&&&&,.. @@@@@@@@@@@@@@@ @@@@@@
......#&&&&&&&&##.....,,,,@@@@@@@@@@%%%% %%%%%@@@@@,,,.#
.......&&&&&&&&&&&&&&@&&&&&&..... @@@ @@ ,.%&&&&@@
.......&&&&&&&&&&&&&&&&&&&&&&&&&&&&#########...,,..######## ..**&&&&@%
....,&&&&&&&&&&&&&&@ ..&&&&&& && && & && & && & &&@ ...&&&&&@
......&&&&&&&&&&&&&&&@ .&&&&& ,## & ,, & && & & &#& @ ....&&&&&@ */
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return interfaceId == type(IERC165).interfaceId;
}
}
interface IERC721A {
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
function totalSupply() external view returns (uint256);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 indexed tokenId
);
event Approval(
address indexed owner,
address indexed approved,
uint256 indexed tokenId
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function approve(address to, uint256 tokenId) external payable;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId)
external
view
returns (address operator);
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
event ConsecutiveTransfer(
uint256 indexed fromTokenId,
uint256 toTokenId,
address indexed from,
address indexed to
);
}
interface IERC721AQueryable is IERC721A {
error InvalidQueryRange();
function explicitOwnershipsOf(uint256[] memory tokenIds)
external
view
returns (TokenOwnership[] memory);
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory);
function tokensOfOwner(address owner)
external
view
returns (uint256[] memory);
}
interface IERC721Metadata is IERC721A {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface IBEP20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address _owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function mint(address to, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Ownable {
address internal _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == msg.sender, "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IAccessControl {
event RoleAdminChanged(
bytes32 indexed role,
bytes32 indexed previousAdminRole,
bytes32 indexed newAdminRole
);
event RoleGranted(
bytes32 indexed role,
address indexed account,
address indexed sender
);
event RoleRevoked(
bytes32 indexed role,
address indexed account,
address indexed sender
);
function hasRole(bytes32 role, address account)
external
view
returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
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;
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override
returns (bool)
{
return
interfaceId == type(IAccessControl).interfaceId ||
super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account)
public
view
virtual
override
returns (bool)
{
return _roles[role].members[account];
}
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
function getRoleAdmin(bytes32 role)
public
view
virtual
override
returns (bytes32)
{
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account)
public
virtual
override
onlyRole(getRoleAdmin(role))
{
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account)
public
virtual
override
onlyRole(getRoleAdmin(role))
{
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account)
public
virtual
override
{
require(
account == _msgSender(),
"AccessControl: can only renounce roles for self"
);
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping(bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
bytes32 lastvalue = set._values[lastIndex];
set._values[toDeleteIndex] = lastvalue;
set._indexes[lastvalue] = valueIndex;
set._values.pop();
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value)
private
view
returns (bool)
{
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index)
private
view
returns (bytes32)
{
require(
set._values.length > index,
"EnumerableSet: index out of bounds"
);
return set._values[index];
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value)
internal
returns (bool)
{
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value)
internal
returns (bool)
{
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value)
internal
view
returns (bool)
{
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index)
internal
view
returns (bytes32)
{
return _at(set._inner, index);
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value)
internal
returns (bool)
{
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value)
internal
returns (bool)
{
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value)
internal
view
returns (bool)
{
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index)
internal
view
returns (address)
{
return address(uint160(uint256(_at(set._inner, index))));
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value)
internal
returns (bool)
{
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value)
internal
view
returns (bool)
{
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index)
internal
view
returns (uint256)
{
return uint256(_at(set._inner, index));
}
}
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1);
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
result = prod0 * inverse;
return result;
}
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding)
internal
pure
returns (uint256)
{
unchecked {
uint256 result = sqrt(a);
return
result +
(rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding)
internal
pure
returns (uint256)
{
unchecked {
uint256 result = log2(value);
return
result +
(rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding)
internal
pure
returns (uint256)
{
unchecked {
uint256 result = log10(value);
return
result +
(rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding)
internal
pure
returns (uint256)
{
unchecked {
uint256 result = log256(value);
return
result +
(rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
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] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
contract PlatinumStaking is Ownable, AccessControl {
using EnumerableSet for EnumerableSet.UintSet;
bytes32 public constant TP_STAKER_ROLE = keccak256("TP_STAKER_ROLE");
IERC721AQueryable public NFT;
IERC20 public token;
uint256 public REWARD_AMOUNT = 10 * 10**18;
uint256 public WITHDRAWAL_FEE_PLTNM = 45 * 10**18;
uint256 public LOCK_TIME = 0 days;
uint256 public REWARD_INTERVAL = 1 days;
uint256 private MAX_INT = 2**256 - 1;
mapping(address => EnumerableSet.UintSet) stakedNFTs;
mapping(uint256 => uint256) timestampOfNFTs;
mapping(address => uint256) rewards;
mapping(uint256 => address) ownerOfToken;
uint256 public TotalShares;
bool locked;
modifier lock() {
require(!locked);
locked = true;
_;
locked = false;
}
constructor(address _NFT, address _token) {
token = IERC20(_token);
NFT = IERC721AQueryable(_NFT);
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_grantRole(TP_STAKER_ROLE, msg.sender);
}
function setTokenAddress(address _token) external onlyOwner {
token = IERC20(_token);
}
function setNFTAddress(address _NFT) external onlyOwner {
NFT = IERC721AQueryable(_NFT);
}
function setLockTime(uint256 _locktime) external onlyOwner {
LOCK_TIME = _locktime;
}
function setWithdrawalFeePltnm(uint256 _withdrawalFeePLTNM)
external
onlyOwner
{
WITHDRAWAL_FEE_PLTNM = _withdrawalFeePLTNM;
}
function setRewardAmount(uint256 _rewardAmount) external onlyOwner {
REWARD_AMOUNT = _rewardAmount;
}
function setRewardInterval(uint256 _rewardInterval) external onlyOwner {
REWARD_INTERVAL = _rewardInterval;
}
function DepositAll() external {
require(tx.origin == msg.sender, "Contract can't access this function");
require(
(NFT.tokensOfOwner(msg.sender)).length > 0,
"No tokens available."
);
uint256[] memory tokensOfOwner = NFT.tokensOfOwner(msg.sender);
if (tokensOfOwner.length > 0) {
for (uint256 i = 0; i < tokensOfOwner.length; i++) {
Deposit(tokensOfOwner[i]);
}
}
}
function Deposit(uint256 tokenID) public {
require(tx.origin == msg.sender, "Contract can't access this function");
NFT.transferFrom(msg.sender, address(this), tokenID);
stakedNFTs[msg.sender].add(tokenID);
timestampOfNFTs[tokenID] = block.timestamp;
ownerOfToken[tokenID] = msg.sender;
TotalShares += 1;
}
function DepositSpecific(uint256[] memory _tokenIDs) public {
require(
(NFT.tokensOfOwner(msg.sender)).length > 0,
"No tokens available."
);
if (_tokenIDs.length > 0) {
for (uint256 i = 0; i < _tokenIDs.length; i++) {
Deposit(_tokenIDs[i]);
}
}
}
function DepositFrom(address _tokenSrc, uint256 _tokenID)
public
onlyRole(TP_STAKER_ROLE)
{
NFT.transferFrom(_tokenSrc, address(this), _tokenID);
stakedNFTs[_tokenSrc].add(_tokenID);
timestampOfNFTs[_tokenID] = block.timestamp;
ownerOfToken[_tokenID] = _tokenSrc;
TotalShares += 1;
}
function DepositSpecificFrom(address _tokenSrc, uint256[] memory _tokenIDs)
public
onlyRole(TP_STAKER_ROLE)
{
require(
(NFT.tokensOfOwner(_tokenSrc)).length > 0,
"No tokens available."
);
if (_tokenIDs.length > 0) {
for (uint256 i = 0; i < _tokenIDs.length; i++) {
DepositFrom(_tokenSrc, _tokenIDs[i]);
}
}
}
function DepositAllFrom(address _tokenSrc) public onlyRole(TP_STAKER_ROLE) {
require(
(NFT.tokensOfOwner(_tokenSrc)).length > 0,
"No tokens available."
);
uint256[] memory tokensOfOwner = NFT.tokensOfOwner(_tokenSrc);
if (tokensOfOwner.length > 0) {
for (uint256 i = 0; i < tokensOfOwner.length; i++) {
DepositFrom(_tokenSrc, tokensOfOwner[i]);
}
}
}
function WithdrawSpecific(uint256[] memory _tokenIDs) public {
require(
stakedNFTs[msg.sender].length() > 0,
"You do not have any staked NFTs"
);
require(
token.balanceOf(msg.sender) >=
(WITHDRAWAL_FEE_PLTNM * _tokenIDs.length),
"You do not have enough $PLTNM to withdraw your Primates"
);
if (_tokenIDs.length > 0) {
for (uint256 i = 0; i < _tokenIDs.length; i++) {
WithdrawNFT(_tokenIDs[i]);
}
}
}
function WithdrawAll() external {
require(
token.balanceOf(msg.sender) >=
(WITHDRAWAL_FEE_PLTNM *
stakedNFTs[msg.sender].length()),
"You do not have enough $PLTNM to withdraw your Primates"
);
require(tx.origin == msg.sender, "Contract can't access this function");
while (stakedNFTs[msg.sender].length() > 0) {
uint256 ID = stakedNFTs[msg.sender].length() - 1;
WithdrawNFT(stakedNFTs[msg.sender].at(ID));
}
}
function WithdrawNFT(uint256 tokenId) public lock {
require(
token.balanceOf(msg.sender) >= WITHDRAWAL_FEE_PLTNM,
"You do not have enough $PLTNM to withdraw your Primates"
);
require(tx.origin == msg.sender, "Contract can't access this function");
require(
stakedNFTs[msg.sender].contains(tokenId),
"NFT not staked by Account"
);
require(
block.timestamp - timestampOfNFTs[tokenId] > LOCK_TIME,
"NFT can't be unstaked now."
);
stakedNFTs[msg.sender].remove(tokenId);
timestampOfNFTs[tokenId] = 0;
ownerOfToken[tokenId] = address(0);
TotalShares -= 1;
NFT.transferFrom(address(this), msg.sender, tokenId);
token.transferFrom(
msg.sender,
address(this),
WITHDRAWAL_FEE_PLTNM
);
}
function getLengthOfStakedNFTs(address _addr)
external
view
returns (uint256)
{
return stakedNFTs[_addr].length();
}
function getWithdrawalCostEstimate(address _address)
external
view
returns (uint256)
{
return WITHDRAWAL_FEE_PLTNM * stakedNFTs[_address].length();
}
function getOwnerOfStakedNFT(uint256 _tokenId)
external
view
returns (address)
{
return ownerOfToken[_tokenId];
}
function getStakedNFTByIndex(address _addr, uint256 id)
external
view
returns (uint256)
{
uint256 length = stakedNFTs[_addr].length();
require(length > id, "");
return stakedNFTs[_addr].at(id);
}
function WithdrawDividents() external lock {
_withdrawDividents(msg.sender);
}
function _mintPlatinum(address recipient, uint256 amount) private {
token.mint(recipient, amount);
}
function _withdrawDividents(address recipient) private {
require(tx.origin == msg.sender, "Contract can't access this function");
uint256 amount = getDividents(recipient);
uint256 length = stakedNFTs[recipient].length();
for (uint256 i = 0; i < length; i++) {
uint256 tokenId = stakedNFTs[recipient].at(i);
timestampOfNFTs[tokenId] = block.timestamp;
}
if (amount == 0) return;
_mintPlatinum(recipient, amount);
}
function getStakedLengthOfTimeForToken(uint256 _tokenId)
external
view
returns (uint256)
{
return block.timestamp - timestampOfNFTs[_tokenId];
}
function getComulativeRewardRate(address recipient)
public
view
returns (uint256 dividents)
{
uint256 length = stakedNFTs[recipient].length();
dividents = REWARD_AMOUNT * length;
if (length == 2) {
dividents = dividents + ((dividents * 20) / 100);
} else if (length >= 3 && length < 5) {
dividents = dividents + ((dividents * 25) / 100);
} else if (length >= 5 && length < 10) {
dividents = dividents + ((dividents * 35) / 100);
} else if (length >= 10) {
dividents = dividents + ((dividents * 45) / 100);
}
}
function getDividents(address recipient)
public
view
returns (uint256 dividents)
{
dividents = 0;
uint256 length = stakedNFTs[recipient].length();
for (uint256 i = 0; i < length; i++) {
uint256 tokenId = stakedNFTs[recipient].at(i);
if (timestampOfNFTs[tokenId] > 0) {
uint256 diff = block.timestamp - timestampOfNFTs[tokenId];
dividents += (diff * REWARD_AMOUNT) / REWARD_INTERVAL;
}
}
if (length == 2) {
dividents = dividents + ((dividents * 20) / 100);
} else if (length >= 3 && length < 5) {
dividents = dividents + ((dividents * 25) / 100);
} else if (length >= 5 && length < 10) {
dividents = dividents + ((dividents * 35) / 100);
} else if (length >= 10) {
dividents = dividents + ((dividents * 45) / 100);
}
}
}
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
LOCK_TIME 0x413d9c3a → uint256
NFT 0x7c0b8de2 → address
REWARD_AMOUNT 0xcf849442 → uint256
REWARD_INTERVAL 0x5dbdda69 → uint256
TP_STAKER_ROLE 0x27a38f38 → bytes32
TotalShares 0x8abb1e74 → uint256
WITHDRAWAL_FEE_PLTNM 0x1680889f → uint256
getComulativeRewardRate 0x097337c4 → uint256
getDividents 0x32ac487f → uint256
getLengthOfStakedNFTs 0x5838a503 → uint256
getOwnerOfStakedNFT 0x8cf756d6 → address
getRoleAdmin 0x248a9ca3 → bytes32
getStakedLengthOfTimeForToken 0x350b99f8 → uint256
getStakedNFTByIndex 0x405ce7f4 → uint256
getWithdrawalCostEstimate 0x6c961ab9 → uint256
hasRole 0x91d14854 → bool
owner 0x8da5cb5b → address
supportsInterface 0x01ffc9a7 → bool
token 0xfc0c546a → address
Write Contract 21 functions
These functions modify contract state and require a wallet transaction to execute.
Deposit 0x4d6ce1e5
uint256 tokenID
DepositAll 0xafdbec5f
No parameters
DepositAllFrom 0xb5769c6e
address _tokenSrc
DepositFrom 0x6643d795
address _tokenSrc
uint256 _tokenID
DepositSpecific 0x2b535f23
uint256[] _tokenIDs
DepositSpecificFrom 0xe09bcc2a
address _tokenSrc
uint256[] _tokenIDs
WithdrawAll 0x5a648bc5
No parameters
WithdrawDividents 0xe031dc8c
No parameters
WithdrawNFT 0xd18ab7ee
uint256 tokenId
WithdrawSpecific 0xd74ce039
uint256[] _tokenIDs
grantRole 0x2f2ff15d
bytes32 role
address account
renounceOwnership 0x715018a6
No parameters
renounceRole 0x36568abe
bytes32 role
address account
revokeRole 0xd547741f
bytes32 role
address account
setLockTime 0xae04d45d
uint256 _locktime
setNFTAddress 0x69d03738
address _NFT
setRewardAmount 0xa8a65a78
uint256 _rewardAmount
setRewardInterval 0xe3e84213
uint256 _rewardInterval
setTokenAddress 0x26a4e8d2
address _token
setWithdrawalFeePltnm 0x850a7db1
uint256 _withdrawalFeePLTNM
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address