Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0xbd277e47d0ECDd5db6c57Eda717dD8F5a329EDEC
Balance 0 ETH
Nonce 1
Code Size 11602 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

11602 bytes
0x608060405234801561001057600080fd5b506004361061035c5760003560e01c806374f9b464116101d3578063d484db7511610104578063eb9253c0116100a2578063f9cff3511161007c578063f9cff351146108fd578063fa1acb5c14610905578063fc1d230e1461090d578063ffd832c1146109ba5761035c565b8063eb9253c0146108a3578063ed6525c4146108cf578063f3a28161146108d75761035c565b8063dc099301116100de578063dc0993011461085a578063dc7ced3d14610877578063e45a98dd1461087f578063e9fad8ee1461089b5761035c565b8063d484db75146107a1578063d4e6b7a114610817578063d83e1042146108345761035c565b80639964d89011610171578063ab033ea91161014b578063ab033ea914610733578063b0718b1714610759578063c230fd111461077c578063cd3daf9d146107995761035c565b80639964d890146106f15780639a6b25a31461070e5780639f3fbd2b1461072b5761035c565b80637d6dfb7e116101ad5780637d6dfb7e1461069e57806380faa57d146106c457806382e0bfae146106cc578063927b26b9146106e95761035c565b806374f9b46414610671578063770d58f8146106795780637b4d0812146106815761035c565b806337e294d5116102ad5780635efee7971161024b5780636a343e3c116102255780636a343e3c1461061e5780636adafab51461062657806370a082311461062e57806373b2d322146106545761035c565b80635efee797146105c457806365d82b8a146105f057806368fd25cd146106165761035c565b80633d18b912116102875780633d18b91214610571578063410e66f11461057957806353364da01461059657806356728e9d1461059e5761035c565b806337e294d5146105595780633a485c23146105615780633ccfd60b146105695761035c565b8063150b7a021161031a5780631c2f3e3d116102f45780631c2f3e3d146104f957806324c5f05e1461051d578063252f7b49146105495780633572744e146105515761035c565b8063150b7a021461040657806318160ddd146104e95780631be05289146104f15761035c565b80628cc2621461036157806309813482146103995780630ba86f05146103cf578063118103c6146103ee578063121544b9146103f65780631407c664146103fe575b600080fd5b6103876004803603602081101561037757600080fd5b50356001600160a01b03166109c2565b60408051918252519081900360200190f35b6103b6600480360360208110156103af57600080fd5b5035610a48565b6040805192835260208301919091528051918290030190f35b6103ec600480360360208110156103e557600080fd5b5035610b72565b005b610387610bcd565b610387610bd3565b610387610bd9565b6104cc6004803603608081101561041c57600080fd5b6001600160a01b0382358116926020810135909116916040820135919081019060808101606082013564010000000081111561045757600080fd5b82018360208201111561046957600080fd5b8035906020019184600183028401116401000000008311171561048b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610bdf945050505050565b604080516001600160e01b03199092168252519081900360200190f35b610387610cee565b610387610cf5565b610501610cfc565b604080516001600160a01b039092168252519081900360200190f35b6103ec6004803603604081101561053357600080fd5b506001600160a01b038135169060200135610d0b565b610387610dd6565b610387610ddc565b610501610de2565b610387610df1565b6103ec610df7565b6103ec610f00565b6103876004803603602081101561058f57600080fd5b5035611297565b6103876112a9565b610387600480360360208110156105b457600080fd5b50356001600160a01b03166112af565b610387600480360360408110156105da57600080fd5b506001600160a01b0381351690602001356112c1565b6103876004803603602081101561060657600080fd5b50356001600160a01b03166112f1565b610387611303565b610501611309565b610387611318565b6103876004803603602081101561064457600080fd5b50356001600160a01b031661131e565b6103ec6004803603602081101561066a57600080fd5b5035611339565b610501611821565b610501611830565b6103ec6004803603602081101561069757600080fd5b503561183f565b610387600480360360208110156106b457600080fd5b50356001600160a01b031661189a565b6103876118ac565b6103ec600480360360208110156106e257600080fd5b50356118bf565b61038761191a565b6103ec6004803603602081101561070757600080fd5b5035611920565b6103ec6004803603602081101561072457600080fd5b5035611af5565b610387611b50565b6103ec6004803603602081101561074957600080fd5b50356001600160a01b0316611b56565b6103876004803603604081101561076f57600080fd5b5080359060200135611c67565b6103ec6004803603602081101561079257600080fd5b5035611e29565b610387612009565b6107c7600480360360208110156107b757600080fd5b50356001600160a01b031661205f565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156108035781810151838201526020016107eb565b505050509050019250505060405180910390f35b6103876004803603602081101561082d57600080fd5b50356120cb565b6103876004803603602081101561084a57600080fd5b50356001600160a01b03166120dd565b6103876004803603602081101561087057600080fd5b50356120ef565b610501612101565b610887612110565b604080519115158252519081900360200190f35b6103ec612119565b6103ec600480360360408110156108b957600080fd5b506001600160a01b03813516906020013561212b565b6103876121f3565b610387600480360360208110156108ed57600080fd5b50356001600160a01b03166121f9565b61050161220b565b61038761221a565b6103ec6004803603604081101561092357600080fd5b8135919081019060408101602082013564010000000081111561094557600080fd5b82018360208201111561095757600080fd5b8035906020019184600183028401116401000000008311171561097957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550612220945050505050565b610387612784565b6001600160a01b0381166000908152601260209081526040808320546011909252822054610a429190610a3690670de0b6b3a764000090610a2a90610a1590610a09612009565b9063ffffffff61278a16565b610a1e8861131e565b9063ffffffff6127d316565b9063ffffffff61283316565b9063ffffffff61287516565b92915050565b600080600080600080600080600260009054906101000a90046001600160a01b03166001600160a01b0316636f7549968a6040518263ffffffff1660e01b81526004018082815260200191505060e06040518083038186803b158015610aad57600080fd5b505afa158015610ac1573d6000803e3d6000fd5b505050506040513d60e0811015610ad757600080fd5b508051602082015160408301516060840151608085015160a086015160c090960151929c50939a509198509096509094509092509050861515610b5b5760408051600160e51b62461bcd0281526020600482015260116024820152600160781b70746865206765676f206e6f74206465676f02604482015290519081900360640190fd5b610b658686611c67565b9750505050505050915091565b6000546001600160a01b03163314610bc85760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b600d55565b601c5481565b600c5481565b60095481565b60145460009060ff161515610bf657506000610ce6565b7f1d823cdc8f0514a95b53538df2d2f3deaf98d1c534c6e750daa593173c27f8f08585858560405180856001600160a01b03166001600160a01b03168152602001846001600160a01b03166001600160a01b0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c8e578181015183820152602001610c76565b50505050905090810190601f168015610cbb5780820380516001836020036101000a031916815260200191505b509550505050505060405180910390a160405180602f612c8d8239602f019050604051809103902090505b949350505050565b6016545b90565b62093a8081565b6000546001600160a01b031681565b6003546001600160a01b0383811691161415610d615760408051600160e51b62461bcd02815260206004820152600a6024820152600160b01b696765676f207374616b6502604482015290519081900360640190fd5b6000805460408051600160e11b63214217070281523060048201526001600160a01b039283166024820152604481018590529051918516926342842e0e9260648084019382900301818387803b158015610dba57600080fd5b505af1158015610dce573d6000803e3d6000fd5b505050505050565b601a5481565b60165481565b6005546001600160a01b031681565b60155481565b6008544211610e3f5760408051600160e51b62461bcd0281526020600482015260096024820152600160ba1b681b9bdd081cdd185c9d02604482015290519081900360640190fd5b336000908152601d6020908152604091829020805483518184028101840190945280845260609392830182828015610e9657602002820191906000526020600020905b815481526020019060010190808311610e82575b50939450600193505050505b81518160ff161015610efc576000828260ff16815181101515610ec157fe5b906020019060200201511115610ef457610ef4828260ff16815181101515610ee557fe5b90602001906020020151611339565b600101610ea2565b5050565b33610f09612009565b600c55610f146118ac565b600b556001600160a01b03811615610f5b57610f2f816109c2565b6001600160a01b038216600090815260126020908152604080832093909355600c546011909152919020555b600954421061104557610f7f6064610a2a60326007546127d390919063ffffffff16565b600781905560015460408051600160e01b6340c10f190281523060048201526024810193909352516001600160a01b03909116916340c10f1991604480830192600092919082900301818387803b158015610fd957600080fd5b505af1158015610fed573d6000803e3d6000fd5b50506007546110089250905062093a8063ffffffff61283316565b600a5561101e4262093a8063ffffffff61287516565b6009556007546040805191825251600080516020612cbc8339815191529181900360200190a15b600854421161108d5760408051600160e51b62461bcd0281526020600482015260096024820152600160ba1b681b9bdd081cdd185c9d02604482015290519081900360640190fd5b6000611098336109c2565b90508015610efc57336000818152601260209081526040808320839055600480548251600160e01b6335380a550281529182019590955260248101869052905192936001600160a01b0316926335380a559260448084019391929182900301818787803b15801561110857600080fd5b505af115801561111c573d6000803e3d6000fd5b505050506040513d602081101561113257600080fd5b50519050801561115f5760045460015461115f916001600160a01b0391821691168363ffffffff6128d216565b600061117c600f54610a2a600d54866127d390919063ffffffff16565b905080156111a7576005546001546111a7916001600160a01b0391821691168363ffffffff6128d216565b60006111bd82610a09868663ffffffff61278a16565b6010543360009081526013602052604081205492935091014210156111fa576111f7600f54610a2a600e54856127d390919063ffffffff16565b90505b801561123657600654600154611223916001600160a01b0391821691168363ffffffff6128d216565b611233828263ffffffff61278a16565b91505b811561125957600154611259906001600160a01b0316338463ffffffff6128d216565b60408051838152905133917fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486919081900360200190a2505050505050565b60186020526000908152604090205481565b600e5481565b60136020526000908152604090205481565b601d602052816000526040600020818154811015156112dc57fe5b90600052602060002001600091509150505481565b60116020526000908152604090205481565b600a5481565b6002546001600160a01b031681565b600b5481565b6001600160a01b031660009081526017602052604090205490565b33611342612009565b600c5561134d6118ac565b600b556001600160a01b0381161561139457611368816109c2565b6001600160a01b038216600090815260126020908152604080832093909355600c546011909152919020555b600954421061147e576113b86064610a2a60326007546127d390919063ffffffff16565b600781905560015460408051600160e01b6340c10f190281523060048201526024810193909352516001600160a01b03909116916340c10f1991604480830192600092919082900301818387803b15801561141257600080fd5b505af1158015611426573d6000803e3d6000fd5b50506007546114419250905062093a8063ffffffff61283316565b600a556114574262093a8063ffffffff61287516565b6009556007546040805191825251600080516020612cbc8339815191529181900360200190a15b60085442116114c65760408051600160e51b62461bcd0281526020600482015260096024820152600160ba1b681b9bdd081cdd185c9d02604482015290519081900360640190fd5b81151561151d5760408051600160e51b62461bcd02815260206004820152601060248201527f746865206765676f4964206572726f7200000000000000000000000000000000604482015290519081900360640190fd5b336000908152601d602090815260409182902080548351818402810184019094528084526060939283018282801561157457602002820191906000526020600020905b815481526020019060010190808311611560575b5050506000868152601e60205260409020548351939450928692508491508390811061159c57fe5b60209081029091010151146115fb5760408051600160e51b62461bcd02815260206004820152601060248201527f6e6f74206765676f4964206f776e657200000000000000000000000000000000604482015290519081900360640190fd5b815160001981019060009084908390811061161257fe5b6020908102909101810151336000908152601d9092526040909120805491925082918590811061163e57fe5b6000918252602080832090910192909255338152601d9091526040812080548490811061166757fe5b6000918252602080832090910192909255338152601d90915260409020805490611695906000198301612c4f565b506000818152601e6020908152604080832086905588835280832083905560188252808320543384526017909252909120546116d7908263ffffffff61278a16565b336000908152601760205260409020556016546116fa908263ffffffff61278a16565b601655600087815260196020908152604080832054338452601b9092529091205461172b908263ffffffff61278a16565b336000908152601b6020526040902055601a5461174e908263ffffffff61278a16565b601a5560035460408051600160e11b6321421707028152306004820152336024820152604481018b905290516001600160a01b03909216916342842e0e9160648082019260009290919082900301818387803b1580156117ad57600080fd5b505af11580156117c1573d6000803e3d6000fd5b5050506000898152601960209081526040808320839055601882528083209290925581518b815291513393507fa2e0b2a3eb8072b5bdc0b2dacae0f04bccefd4604cf97c93f9e3f8a5dbcb1b199281900390910190a25050505050505050565b6001546001600160a01b031681565b6003546001600160a01b031681565b6000546001600160a01b031633146118955760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b600e55565b60126020526000908152604090205481565b60006118ba4260095461292c565b905090565b6000546001600160a01b031633146119155760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b601c55565b600f5481565b6000546001600160a01b031633146119765760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b6000611980612009565b600c5561198b6118ac565b600b556001600160a01b038116156119d2576119a6816109c2565b6001600160a01b038216600090815260126020908152604080832093909355600c546011909152919020555b60015460408051600160e01b6340c10f190281523060048201526024810185905290516001600160a01b03909216916340c10f199160448082019260009290919082900301818387803b158015611a2857600080fd5b505af1158015611a3c573d6000803e3d6000fd5b5050505060095442101515611a6657611a5e8262093a8063ffffffff61283316565b600a55611ab4565b600954600090611a7c904263ffffffff61278a16565b90506000611a95600a54836127d390919063ffffffff16565b9050611aae62093a80610a2a868463ffffffff61287516565b600a5550505b42600b819055611acd9062093a8063ffffffff61287516565b600955604080518381529051600080516020612cbc8339815191529181900360200190a15050565b6000546001600160a01b03163314611b4b5760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b601055565b60105481565b6000546001600160a01b03163314611bac5760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b6001600160a01b0381161515611c0c5760408051600160e51b62461bcd02815260206004820152601f60248201527f6e657720676f7665726e616e636520746865207a65726f206164647265737300604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f5f56bee8cffbe9a78652a74a60705edede02af10b0bbb888ca44b79a0d42ce8091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008083118015611c785750600783105b1515611cc55760408051600160e51b62461bcd0281526020600482015260116024820152600160781b70746865206765676f206e6f74206465676f02604482015290519081900360640190fd5b60006001841415611cef5750611388612710830204611ce7816201adb0612875565b915050610a42565b8360021415611d3057610bb8611d0d8461138863ffffffff61278a16565b61271002811515611d1a57fe5b049050611ce7816201d4c063ffffffff61287516565b8360031415611d71576103e8611d4e84611f4063ffffffff61278a16565b61271002811515611d5b57fe5b049050611ce7816201fbd063ffffffff61287516565b8360041415611db257610320611d8f8461232863ffffffff61278a16565b614e2002811515611d9c57fe5b049050611ce781620222e063ffffffff61287516565b8360051415611df25760b4611dcf8461264863ffffffff61278a16565b614e2002811515611ddc57fe5b049050611ce7816202710063ffffffff61287516565b6014611e06846126fc63ffffffff61278a16565b614e2002811515611e1357fe5b049050611ce7816202bf2063ffffffff61287516565b6000546001600160a01b03163314611e7f5760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b6000611e89612009565b600c55611e946118ac565b600b556001600160a01b03811615611edb57611eaf816109c2565b6001600160a01b038216600090815260126020908152604080832093909355600c546011909152919020555b60145460ff1615611f275760408051600160e51b62461bcd02815260206004820152600b6024820152600160aa1b6a1a185cc81cdd185c9d195902604482015290519081900360640190fd5b6014805460ff191660011790556008829055600754611f4f9062093a8063ffffffff61283316565b600a5560015460075460408051600160e01b6340c10f190281523060048201526024810192909252516001600160a01b03909216916340c10f199160448082019260009290919082900301818387803b158015611fab57600080fd5b505af1158015611fbf573d6000803e3d6000fd5b5050600854600b819055611fdf9250905062093a8063ffffffff61287516565b6009556007546040805191825251600080516020612cbc8339815191529181900360200190a15050565b6000612013610cee565b15156120225750600c54610cf2565b6118ba612050612030610cee565b610a2a670de0b6b3a7640000610a1e600a54610a1e600b54610a096118ac565b600c549063ffffffff61287516565b6001600160a01b0381166000908152601d60209081526040918290208054835181840281018401909452808452606093928301828280156120bf57602002820191906000526020600020905b8154815260200190600101908083116120ab575b50505050509050919050565b601e6020526000908152604090205481565b60176020526000908152604090205481565b60196020526000908152604090205481565b6006546001600160a01b031681565b60145460ff1681565b612121610df7565b612129610f00565b565b6000546001600160a01b031633146121815760408051600160e51b62461bcd02815260206004820152600e6024820152600160901b6d6e6f7420676f7665726e616e636502604482015290519081900360640190fd5b6001546001600160a01b03838116911614156121d35760408051600160e51b62461bcd0281526020600482015260066024820152600160d21b651c995dd85c9902604482015290519081900360640190fd5b600054610efc906001600160a01b0384811691168363ffffffff6128d216565b600d5481565b601b6020526000908152604090205481565b6004546001600160a01b031681565b60085481565b33612229612009565b600c556122346118ac565b600b556001600160a01b0381161561227b5761224f816109c2565b6001600160a01b038216600090815260126020908152604080832093909355600c546011909152919020555b60095442106123655761229f6064610a2a60326007546127d390919063ffffffff16565b600781905560015460408051600160e01b6340c10f190281523060048201526024810193909352516001600160a01b03909116916340c10f1991604480830192600092919082900301818387803b1580156122f957600080fd5b505af115801561230d573d6000803e3d6000fd5b50506007546123289250905062093a8063ffffffff61283316565b600a5561233e4262093a8063ffffffff61287516565b6009556007546040805191825251600080516020612cbc8339815191529181900360200190a15b60085442116123ad5760408051600160e51b62461bcd0281526020600482015260096024820152600160ba1b681b9bdd081cdd185c9d02604482015290519081900360640190fd5b336000908152601d602052604090208054151561240757805460018101825560008281526020808220909201819055808052601e9091527f65ce8396b736f5da9d881cc6fbcb11ef9721292dc41ec8c40879fd9edea5744d555b8054600181018255600082815260208082209092018690558254868252601e909252604081206000199092019091558061244086610a48565b336000908152601b6020526040812054601c54939550919350909161246b838563ffffffff61287516565b111561248957601c54612484908363ffffffff61278a16565b61248b565b825b90508015612555576015546000906124ad90610a2a878563ffffffff6127d316565b336000908152601b60205260409020549091506124d0908363ffffffff61287516565b336000908152601b60209081526040808320939093556017905220546124fc908263ffffffff61287516565b336000908152601760209081526040808320939093558b8252601981528282208590556018905220819055601a5461253a908363ffffffff61287516565b601a55601654612550908263ffffffff61287516565b601655505b60035460408051600160e11b6321421707028152336004820152306024820152604481018b905290516001600160a01b03909216916342842e0e9160648082019260009290919082900301818387803b1580156125b157600080fd5b505af11580156125c5573d6000803e3d6000fd5b50506004805460408051600160e01b63a526a92b0281523393810193909352516001600160a01b03909116935063a526a92b925060248083019260209291908290030181600087803b15801561261a57600080fd5b505af115801561262e573d6000803e3d6000fd5b505050506040513d602081101561264457600080fd5b50511515612733576004805460408051600160e01b63d66d140702815233938101848152602482019283528b5160448301528b516001600160a01b039094169463d66d14079490938d939091606490910190602085019080838360005b838110156126b95781810151838201526020016126a1565b50505050905090810190601f1680156126e65780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561270657600080fd5b505af115801561271a573d6000803e3d6000fd5b505050506040513d602081101561273057600080fd5b50505b3360008181526013602090815260409182902042905581518b815291517f887aea178b533dd5d470ccde3cd6c6c09f8fd2cedc5116fda3f88c83f55479ef9281900390910190a25050505050505050565b60075481565b60006127cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612942565b9392505050565b60008215156127e457506000610a42565b8282028284828115156127f357fe5b04146127cc57604051600160e51b62461bcd028152600401808060200182810382526021815260200180612cdc6021913960400191505060405180910390fd5b60006127cc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129dc565b6000828201838110156127cc5760408051600160e51b62461bcd02815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b0316600160e01b63a9059cbb02179052612927908490612a49565b505050565b600081831061293b57816127cc565b5090919050565b600081848411156129d457604051600160e51b62461bcd0281526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612999578181015183820152602001612981565b50505050905090810190601f1680156129c65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081831515612a3157604051600160e51b62461bcd02815260040180806020018281038252838181518152602001915080519060200190808383600083811015612999578181015183820152602001612981565b5060008385811515612a3f57fe5b0495945050505050565b612a5b826001600160a01b0316612c16565b1515612ab15760408051600160e51b62461bcd02815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310612aef5780518252601f199092019160209182019101612ad0565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612b51576040519150601f19603f3d011682016040523d82523d6000602084013e612b56565b606091505b5091509150811515612bb25760408051600160e51b62461bcd02815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115612c1057808060200190516020811015612bce57600080fd5b50511515612c1057604051600160e51b62461bcd02815260040180806020018281038252602a815260200180612cfd602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470818114801590610ce6575050151592915050565b81548183558181111561292757600083815260209020612927918101908301610cf291905b80821115612c885760008155600101612c74565b509056fe6f6e455243373231526563656976656428616464726573732c616464726573732c75696e743235362c627974657329de88a922e0d3b88b24e9623efeb464919c6bf9f66857a65e2bfcf2ce87a9433d536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a165627a7a72305820d5fac7a3e08588b0564549ba4e6f5d447559ed4757d92d1b7a28853191f3aabf0029

Verified Source Code Partial Match

Compiler: v0.5.5+commit.47a71e8f EVM: petersburg Optimization: Yes (200 runs)
NFTReward.sol 1856 lines
/***
 *    ██████╗ ███████╗ ██████╗  ██████╗ 
 *    ██╔══██╗██╔════╝██╔════╝ ██╔═══██╗
 *    ██║  ██║█████╗  ██║  ███╗██║   ██║
 *    ██║  ██║██╔══╝  ██║   ██║██║   ██║
 *    ██████╔╝███████╗╚██████╔╝╚██████╔╝
 *    ╚═════╝ ╚══════╝ ╚═════╝  ╚═════╝ 
 *    
 * https://dego.finance
                                  
* MIT License
* ===========
*
* Copyright (c) 2020 dego
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/
// File: @openzeppelin/contracts/math/Math.sol

pragma solidity ^0.5.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

// File: @openzeppelin/contracts/math/SafeMath.sol

pragma solidity ^0.5.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot overflow.
     *
     * _Available since v2.4.0._
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        // Solidity only automatically asserts when dividing by 0
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     * - The divisor cannot be zero.
     *
     * _Available since v2.4.0._
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

// File: @openzeppelin/contracts/GSN/Context.sol

pragma solidity ^0.5.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 GSN 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.
 */
contract Context {
    // Empty internal constructor, to prevent people from mistakenly deploying
    // an instance of this contract, which should be used via inheritance.
    constructor () internal { }
    // solhint-disable-previous-line no-empty-blocks

    function _msgSender() internal view returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File: @openzeppelin/contracts/ownership/Ownable.sol

pragma solidity ^0.5.0;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(isOwner(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Returns true if the caller is the current owner.
     */
    function isOwner() public view returns (bool) {
        return _msgSender() == _owner;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File: @openzeppelin/contracts/introspection/IERC165.sol

pragma solidity ^0.5.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);
}

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol

pragma solidity ^0.5.0;


/**
 * @dev Required interface of an ERC721 compliant contract.
 */
contract IERC721 is IERC165 {
    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);

    /**
     * @dev Returns the number of NFTs in `owner`'s account.
     */
    function balanceOf(address owner) public view returns (uint256 balance);

    /**
     * @dev Returns the owner of the NFT specified by `tokenId`.
     */
    function ownerOf(uint256 tokenId) public view returns (address owner);

    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     *
     *
     * Requirements:
     * - `from`, `to` cannot be zero.
     * - `tokenId` must be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this
     * NFT by either {approve} or {setApprovalForAll}.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public;
    /**
     * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
     * another (`to`).
     *
     * Requirements:
     * - If the caller is not `from`, it must be approved to move this NFT by
     * either {approve} or {setApprovalForAll}.
     */
    function transferFrom(address from, address to, uint256 tokenId) public;
    function approve(address to, uint256 tokenId) public;
    function getApproved(uint256 tokenId) public view returns (address operator);

    function setApprovalForAll(address operator, bool _approved) public;
    function isApprovedForAll(address owner, address operator) public view returns (bool);


    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}

// File: @openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol

pragma solidity ^0.5.0;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract IERC721Enumerable is IERC721 {
    function totalSupply() public view returns (uint256);
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);

    function tokenByIndex(uint256 index) public view returns (uint256);
}

// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol

pragma solidity ^0.5.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
contract IERC721Receiver {
    /**
     * @notice Handle the receipt of an NFT
     * @dev The ERC721 smart contract calls this function on the recipient
     * after a {IERC721-safeTransferFrom}. This function MUST return the function selector,
     * otherwise the caller will revert the transaction. The selector to be
     * returned can be obtained as `this.onERC721Received.selector`. This
     * function MAY throw to revert and reject the transfer.
     * Note: the ERC721 contract address is always the message sender.
     * @param operator The address which called `safeTransferFrom` function
     * @param from The address which previously owned the token
     * @param tokenId The NFT identifier which is being transferred
     * @param data Additional data with no specified format
     * @return bytes4 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
     */
    function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
    public returns (bytes4);
}

// File: @openzeppelin/contracts/utils/Address.sol

pragma solidity ^0.5.5;

/**
 * @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
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // According to EIP-1052, 0x0 is the value returned for not-yet created accounts
        // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
        // for accounts without code, i.e. `keccak256('')`
        bytes32 codehash;
        bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
        // solhint-disable-next-line no-inline-assembly
        assembly { codehash := extcodehash(account) }
        return (codehash != accountHash && codehash != 0x0);
    }

    /**
     * @dev Converts an `address` into `address payable`. Note that this is
     * simply a type cast: the actual underlying value is not changed.
     *
     * _Available since v2.4.0._
     */
    function toPayable(address account) internal pure returns (address payable) {
        return address(uint160(account));
    }

    /**
     * @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].
     *
     * _Available since v2.4.0._
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-call-value
        (bool success, ) = recipient.call.value(amount)("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }
}

// File: @openzeppelin/contracts/drafts/Counters.sol

pragma solidity ^0.5.0;


/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}
 * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
 * directly accessed.
 */
library Counters {
    using SafeMath for uint256;

    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        // The {SafeMath} overflow check can be skipped here, see the comment at the top
        counter._value += 1;
    }

    function decrement(Counter storage counter) internal {
        counter._value = counter._value.sub(1);
    }
}

// File: @openzeppelin/contracts/introspection/ERC165.sol

pragma solidity ^0.5.0;


/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
contract ERC165 is IERC165 {
    /*
     * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
     */
    bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;

    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor () internal {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(_INTERFACE_ID_ERC165);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool) {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

// File: @openzeppelin/contracts/token/ERC721/ERC721.sol

pragma solidity ^0.5.0;








/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is Context, ERC165, IERC721 {
    using SafeMath for uint256;
    using Address for address;
    using Counters for Counters.Counter;

    // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
    // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
    bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;

    // Mapping from token ID to owner
    mapping (uint256 => address) private _tokenOwner;

    // Mapping from token ID to approved address
    mapping (uint256 => address) private _tokenApprovals;

    // Mapping from owner to number of owned token
    mapping (address => Counters.Counter) private _ownedTokensCount;

    // Mapping from owner to operator approvals
    mapping (address => mapping (address => bool)) private _operatorApprovals;

    /*
     *     bytes4(keccak256('balanceOf(address)')) == 0x70a08231
     *     bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
     *     bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
     *     bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
     *     bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
     *     bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c5
     *     bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
     *     bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
     *
     *     => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
     *        0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
     */
    bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;

    constructor () public {
        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(_INTERFACE_ID_ERC721);
    }

    /**
     * @dev Gets the balance of the specified address.
     * @param owner address to query the balance of
     * @return uint256 representing the amount owned by the passed address
     */
    function balanceOf(address owner) public view returns (uint256) {
        require(owner != address(0), "ERC721: balance query for the zero address");

        return _ownedTokensCount[owner].current();
    }

    /**
     * @dev Gets the owner of the specified token ID.
     * @param tokenId uint256 ID of the token to query the owner of
     * @return address currently marked as the owner of the given token ID
     */
    function ownerOf(uint256 tokenId) public view returns (address) {
        address owner = _tokenOwner[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");

        return owner;
    }

    /**
     * @dev Approves another address to transfer the given token ID
     * The zero address indicates there is no approved address.
     * There can only be one approved address per token at a given time.
     * Can only be called by the token owner or an approved operator.
     * @param to address to be approved for the given token ID
     * @param tokenId uint256 ID of the token to be approved
     */
    function approve(address to, uint256 tokenId) public {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Gets the approved address for a token ID, or zero if no address set
     * Reverts if the token ID does not exist.
     * @param tokenId uint256 ID of the token to query the approval of
     * @return address currently approved for the given token ID
     */
    function getApproved(uint256 tokenId) public view returns (address) {
        require(_exists(tokenId), "ERC721: approved query for nonexistent token");

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev Sets or unsets the approval of a given operator
     * An operator is allowed to transfer all tokens of the sender on their behalf.
     * @param to operator address to set the approval
     * @param approved representing the status of the approval to be set
     */
    function setApprovalForAll(address to, bool approved) public {
        require(to != _msgSender(), "ERC721: approve to caller");

        _operatorApprovals[_msgSender()][to] = approved;
        emit ApprovalForAll(_msgSender(), to, approved);
    }

    /**
     * @dev Tells whether an operator is approved by a given owner.
     * @param owner owner address which you want to query the approval of
     * @param operator operator address which you want to query the approval of
     * @return bool whether the given operator is approved by the given owner
     */
    function isApprovedForAll(address owner, address operator) public view returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Transfers the ownership of a given token ID to another address.
     * Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     * Requires the msg.sender to be the owner, approved, or operator.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function transferFrom(address from, address to, uint256 tokenId) public {
        //solhint-disable-next-line max-line-length
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");

        _transferFrom(from, to, tokenId);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg.sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) public {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement {IERC721Receiver-onERC721Received},
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the _msgSender() to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
        require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
        _safeTransferFrom(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers the ownership of a given token ID to another address
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * Requires the msg.sender to be the owner, approved, or operator
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) internal {
        _transferFrom(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Returns whether the specified token exists.
     * @param tokenId uint256 ID of the token to query the existence of
     * @return bool whether the token exists
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        address owner = _tokenOwner[tokenId];
        return owner != address(0);
    }

    /**
     * @dev Returns whether the given spender can transfer a given token ID.
     * @param spender address of the spender to query
     * @param tokenId uint256 ID of the token to be transferred
     * @return bool whether the msg.sender is approved for the given token ID,
     * is an operator of the owner, or is the owner of the token
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
        require(_exists(tokenId), "ERC721: operator query for nonexistent token");
        address owner = ownerOf(tokenId);
        return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _safeMint(address to, uint256 tokenId) internal {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Internal function to safely mint a new token.
     * Reverts if the given token ID already exists.
     * If the target address is a contract, it must implement `onERC721Received`,
     * which is called upon a safe transfer, and return the magic value
     * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
     * the transfer is reverted.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     * @param _data bytes data to send along with a safe transfer check
     */
    function _safeMint(address to, uint256 tokenId, bytes memory _data) internal {
        _mint(to, tokenId);
        require(_checkOnERC721Received(address(0), to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

    /**
     * @dev Internal function to mint a new token.
     * Reverts if the given token ID already exists.
     * @param to The address that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _tokenOwner[tokenId] = to;
        _ownedTokensCount[to].increment();

        emit Transfer(address(0), to, tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use {_burn} instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");

        _clearApproval(tokenId);

        _ownedTokensCount[owner].decrement();
        _tokenOwner[tokenId] = address(0);

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(uint256 tokenId) internal {
        _burn(ownerOf(tokenId), tokenId);
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
        require(to != address(0), "ERC721: transfer to the zero address");

        _clearApproval(tokenId);

        _ownedTokensCount[from].decrement();
        _ownedTokensCount[to].increment();

        _tokenOwner[tokenId] = to;

        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * This is an internal detail of the `ERC721` contract and its use is deprecated.
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
        internal returns (bool)
    {
        if (!to.isContract()) {
            return true;
        }
        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = to.call(abi.encodeWithSelector(
            IERC721Receiver(to).onERC721Received.selector,
            _msgSender(),
            from,
            tokenId,
            _data
        ));
        if (!success) {
            if (returndata.length > 0) {
                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert("ERC721: transfer to non ERC721Receiver implementer");
            }
        } else {
            bytes4 retval = abi.decode(returndata, (bytes4));
            return (retval == _ERC721_RECEIVED);
        }
    }

    /**
     * @dev Private function to clear current approval of a given token ID.
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _clearApproval(uint256 tokenId) private {
        if (_tokenApprovals[tokenId] != address(0)) {
            _tokenApprovals[tokenId] = address(0);
        }
    }
}

// File: @openzeppelin/contracts/token/ERC721/ERC721Enumerable.sol

pragma solidity ^0.5.0;





/**
 * @title ERC-721 Non-Fungible Token with optional enumeration extension logic
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721Enumerable is Context, ERC165, ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => uint256[]) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

    /*
     *     bytes4(keccak256('totalSupply()')) == 0x18160ddd
     *     bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
     *     bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
     *
     *     => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
     */
    bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;

    /**
     * @dev Constructor function.
     */
    constructor () public {
        // register the supported interface to conform to ERC721Enumerable via ERC165
        _registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
    }

    /**
     * @dev Gets the token ID at a given index of the tokens list of the requested owner.
     * @param owner address owning the tokens list to be accessed
     * @param index uint256 representing the index to be accessed of the requested tokens list
     * @return uint256 token ID at the given index of the tokens list owned by the requested address
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
        require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

    /**
     * @dev Gets the total amount of tokens stored by the contract.
     * @return uint256 representing the total amount of tokens
     */
    function totalSupply() public view returns (uint256) {
        return _allTokens.length;
    }

    /**
     * @dev Gets the token ID at a given index of all the tokens in this contract
     * Reverts if the index is greater or equal to the total number of tokens.
     * @param index uint256 representing the index to be accessed of the tokens list
     * @return uint256 token ID at the given index of the tokens list
     */
    function tokenByIndex(uint256 index) public view returns (uint256) {
        require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev Internal function to transfer ownership of a given token ID to another address.
     * As opposed to transferFrom, this imposes no restrictions on msg.sender.
     * @param from current owner of the token
     * @param to address to receive the ownership of the given token ID
     * @param tokenId uint256 ID of the token to be transferred
     */
    function _transferFrom(address from, address to, uint256 tokenId) internal {
        super._transferFrom(from, to, tokenId);

        _removeTokenFromOwnerEnumeration(from, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);
    }

    /**
     * @dev Internal function to mint a new token.
     * Reverts if the given token ID already exists.
     * @param to address the beneficiary that will own the minted token
     * @param tokenId uint256 ID of the token to be minted
     */
    function _mint(address to, uint256 tokenId) internal {
        super._mint(to, tokenId);

        _addTokenToOwnerEnumeration(to, tokenId);

        _addTokenToAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Internal function to burn a specific token.
     * Reverts if the token does not exist.
     * Deprecated, use {ERC721-_burn} instead.
     * @param owner owner of the token to burn
     * @param tokenId uint256 ID of the token being burned
     */
    function _burn(address owner, uint256 tokenId) internal {
        super._burn(owner, tokenId);

        _removeTokenFromOwnerEnumeration(owner, tokenId);
        // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund
        _ownedTokensIndex[tokenId] = 0;

        _removeTokenFromAllTokensEnumeration(tokenId);
    }

    /**
     * @dev Gets the list of token IDs of the requested owner.
     * @param owner address owning the tokens
     * @return uint256[] List of token IDs owned by the requested address
     */
    function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
        return _ownedTokens[owner];
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        _ownedTokensIndex[tokenId] = _ownedTokens[to].length;
        _ownedTokens[to].push(tokenId);
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        _ownedTokens[from].length--;

        // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by
        // lastTokenId, or just over the end of the array if the token was the last one).
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length.sub(1);
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        _allTokens.length--;
        _allTokensIndex[tokenId] = 0;
    }
}

// File: contracts/interface/IERC20.sol

pragma solidity ^0.5.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP. Does not include
 * the optional functions; to access them see {ERC20Detailed}.
 */
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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);
    function mint(address account, uint amount) external;
    /**
     * @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 `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean...

// [truncated — 69987 bytes total]

Read Contract

DURATION 0x1be05289 → uint256
_baseRate 0x927b26b9 → uint256
_dego 0x74f9b464 → address
_degoBalances 0xf3a28161 → uint256
_fixRateBase 0x3a485c23 → uint256
_gegoFactory 0x6a343e3c → address
_gegoMapIndex 0xd4e6b7a1 → uint256
_gegoToken 0x770d58f8 → address
_governance 0x1c2f3e3d → address
_hasStart 0xe45a98dd → bool
_initReward 0xffd832c1 → uint256
_lastStakedTime 0x56728e9d → uint256
_lastUpdateTime 0x6adafab5 → uint256
_maxStakedDego 0x118103c6 → uint256
_periodFinish 0x1407c664 → uint256
_playerBook 0xf9cff351 → address
_playerGego 0x5efee797 → uint256
_poolRewardRate 0x53364da0 → uint256
_punishTime 0x9f3fbd2b → uint256
_rewardPerTokenStored 0x121544b9 → uint256
_rewardPool 0xdc7ced3d → address
_rewardRate 0x68fd25cd → uint256
_rewards 0x7d6dfb7e → uint256
_stakeBalances 0xdc099301 → uint256
_stakeWeightes 0x410e66f1 → uint256
_startTime 0xfa1acb5c → uint256
_teamRewardRate 0xed6525c4 → uint256
_teamWallet 0x37e294d5 → address
_totalBalance 0x252f7b49 → uint256
_totalWeight 0x3572744e → uint256
_userRewardPerTokenPaid 0x65d82b8a → uint256
_weightBalances 0xd83e1042 → uint256
balanceOf 0x70a08231 → uint256
earned 0x008cc262 → uint256
getFixRate 0xb0718b17 → uint256
getPlayerIds 0xd484db75 → uint256[]
getStakeInfo 0x09813482 → uint256, uint256
lastTimeRewardApplicable 0x80faa57d → uint256
rewardPerToken 0xcd3daf9d → uint256
totalSupply 0x18160ddd → uint256

Write Contract 15 functions

These functions modify contract state and require a wallet transaction to execute.

exit 0xe9fad8ee
No parameters
getReward 0x3d18b912
No parameters
notifyMintAmount 0x9964d890
uint256 reward
onERC721Received 0x150b7a02
address operator
address from
uint256 tokenId
bytes data
returns: bytes4
seize 0xeb9253c0
address token
uint256 amount
seizeErc721 0x24c5f05e
address token
uint256 tokenId
setGovernance 0xab033ea9
address governance
setMaxStakedDego 0x82e0bfae
uint256 amount
setPoolRewardRate 0x7b4d0812
uint256 poolRewardRate
setTeamRewardRate 0x0ba86f05
uint256 teamRewardRate
setWithDrawPunishTime 0x9a6b25a3
uint256 punishTime
stakeGego 0xfc1d230e
uint256 gegoId
string affCode
startNFTReward 0xc230fd11
uint256 startTime
withdraw 0x3ccfd60b
No parameters
withdrawGego 0x73b2d322
uint256 gegoId

Recent Transactions

No transactions found for this address