Address Contract Partially Verified
Address
0xff9315c2c4c0208Edb5152F4c4eBec75e74010c5
Balance
0 ETH
Nonce
1
Code Size
21118 bytes
Creator
0xa4633cB5...fe88 at tx 0x1b964c24...d983c4
Indexed Transactions
0
Contract Bytecode
21118 bytes
0x608060405234801561001057600080fd5b50600436106102535760003560e01c8063556754ad1161014657806395d89b41116100c3578063cf7c4eb511610087578063cf7c4eb5146113cd578063d5f3948814611413578063e43107391461145d578063e575c3dc1461149f578063e985e9c51461162d578063f9df6490146116a957610253565b806395d89b4114611104578063a22cb46514611187578063a75dc333146111d7578063b88d4fde14611221578063c87b56dd1461132657610253565b80636c0360eb1161010a5780636c0360eb14610f2257806370016a6514610fa557806370a082311461104c578063822abf42146110a457806391a425e7146110e657610253565b8063556754ad14610d8157806355f804b314610ddb578063573c80fa14610e545780636352211e14610e725780636552a4c514610ee057610253565b806323b872dd116101d457806342966c681161019857806342966c6814610a465780634832a86814610a8c5780634a9c9c8314610c2e5780634f6ccce714610c98578063554c05b114610cda57610253565b806323b872dd1461081f5780632f745c591461088d578063306e4900146108ef57806332bc99271461093157806342842e0e146109d857610253565b806316059f1b1161021b57806316059f1b1461043e578063162094c41461048057806318160ddd1461050357806319021e8a14610521578063203a9a37146106b157610253565b806301ffc9a71461025857806303e553a5146102bd57806306fdde03146102ff578063081812fc14610382578063095ea7b3146103f0575b600080fd5b6102a36004803603602081101561026e57600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050611705565b604051808215151515815260200191505060405180910390f35b6102e9600480360360208110156102d357600080fd5b810190808035906020019092919050505061176c565b6040518082815260200191505060405180910390f35b61030761178c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561034757808201518184015260208101905061032c565b50505050905090810190601f1680156103745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103ae6004803603602081101561039857600080fd5b810190808035906020019092919050505061182e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61043c6004803603604081101561040657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118c9565b005b61046a6004803603602081101561045457600080fd5b8101908080359060200190929190505050611a0d565b6040518082815260200191505060405180910390f35b6105016004803603604081101561049657600080fd5b8101908080359060200190929190803590602001906401000000008111156104bd57600080fd5b8201836020820111156104cf57600080fd5b803590602001918460018302840111640100000000831117156104f157600080fd5b9091929391929390505050611a2d565b005b61050b611b0d565b6040518082815260200191505060405180910390f35b6106976004803603608081101561053757600080fd5b810190808035906020019064010000000081111561055457600080fd5b82018360208201111561056657600080fd5b8035906020019184602083028401116401000000008311171561058857600080fd5b9091929391929390803590602001906401000000008111156105a957600080fd5b8201836020820111156105bb57600080fd5b803590602001918460208302840111640100000000831117156105dd57600080fd5b9091929391929390803590602001906401000000008111156105fe57600080fd5b82018360208201111561061057600080fd5b8035906020019184602083028401116401000000008311171561063257600080fd5b90919293919293908035906020019064010000000081111561065357600080fd5b82018360208201111561066557600080fd5b8035906020019184602083028401116401000000008311171561068757600080fd5b9091929391929390505050611b1e565b604051808215151515815260200191505060405180910390f35b61080560048036036101008110156106c857600080fd5b81019080803590602001906401000000008111156106e557600080fd5b8201836020820111156106f757600080fd5b8035906020019184600183028401116401000000008311171561071957600080fd5b90919293919293908035906020019064010000000081111561073a57600080fd5b82018360208201111561074c57600080fd5b8035906020019184600183028401116401000000008311171561076e57600080fd5b90919293919293908035906020019064010000000081111561078f57600080fd5b8201836020820111156107a157600080fd5b803590602001918460018302840111640100000000831117156107c357600080fd5b90919293919293908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050611ef3565b604051808215151515815260200191505060405180910390f35b61088b6004803603606081101561083557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506120f6565b005b6108d9600480360360408110156108a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061216c565b6040518082815260200191505060405180910390f35b61091b6004803603602081101561090557600080fd5b81019080803590602001909291905050506121c7565b6040518082815260200191505060405180910390f35b61095d6004803603602081101561094757600080fd5b81019080803590602001909291905050506121e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561099d578082015181840152602081019050610982565b50505050905090810190601f1680156109ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a44600480360360608110156109ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061229f565b005b610a7260048036036020811015610a5c57600080fd5b81019080803590602001909291905050506122bf565b604051808215151515815260200191505060405180910390f35b610ab860048036036020811015610aa257600080fd5b8101908080359060200190929190505050612444565b6040518080602001806020018060200189815260200188815260200187815260200186815260200185815260200184810384528c818151815260200191508051906020019080838360005b83811015610b1e578082015181840152602081019050610b03565b50505050905090810190601f168015610b4b5780820380516001836020036101000a031916815260200191505b5084810383528b818151815260200191508051906020019080838360005b83811015610b84578082015181840152602081019050610b69565b50505050905090810190601f168015610bb15780820380516001836020036101000a031916815260200191505b5084810382528a818151815260200191508051906020019080838360005b83811015610bea578082015181840152602081019050610bcf565b50505050905090810190601f168015610c175780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390f35b610c5a60048036036020811015610c4457600080fd5b8101908080359060200190929190505050612654565b6040518082600260200280838360005b83811015610c85578082015181840152602081019050610c6a565b5050505090500191505060405180910390f35b610cc460048036036020811015610cae57600080fd5b81019080803590602001909291905050506126a4565b6040518082815260200191505060405180910390f35b610d0660048036036020811015610cf057600080fd5b81019080803590602001909291905050506126c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d46578082015181840152602081019050610d2b565b50505050905090810190601f168015610d735780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610dc160048036036060811015610d9757600080fd5b8101908080359060200190929190803590602001909291908035906020019092919050505061277f565b604051808215151515815260200191505060405180910390f35b610e5260048036036020811015610df157600080fd5b8101908080359060200190640100000000811115610e0e57600080fd5b820183602082011115610e2057600080fd5b80359060200191846001830284011164010000000083111715610e4257600080fd5b9091929391929390505050612bae565b005b610e5c612c1e565b6040518082815260200191505060405180910390f35b610e9e60048036036020811015610e8857600080fd5b8101908080359060200190929190505050612c24565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610f0c60048036036020811015610ef657600080fd5b8101908080359060200190929190505050612c5b565b6040518082815260200191505060405180910390f35b610f2a612c73565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f6a578082015181840152602081019050610f4f565b50505050905090810190601f168015610f975780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610fd160048036036020811015610fbb57600080fd5b8101908080359060200190929190505050612d16565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611011578082015181840152602081019050610ff6565b50505050905090810190601f16801561103e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61108e6004803603602081101561106257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612dce565b6040518082815260200191505060405180910390f35b6110d0600480360360208110156110ba57600080fd5b8101908080359060200190929190505050612ea3565b6040518082815260200191505060405180910390f35b6110ee612ec3565b6040518082815260200191505060405180910390f35b61110c612ec9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561114c578082015181840152602081019050611131565b50505050905090810190601f1680156111795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6111d56004803603604081101561119d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050612f6b565b005b6111df613123565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6113246004803603608081101561123757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561129e57600080fd5b8201836020820111156112b057600080fd5b803590602001918460018302840111640100000000831117156112d257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050613149565b005b6113526004803603602081101561133c57600080fd5b81019080803590602001909291905050506131c1565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015611392578082015181840152602081019050611377565b50505050905090810190601f1680156113bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6113f9600480360360208110156113e357600080fd5b81019080803590602001909291905050506134aa565b604051808215151515815260200191505060405180910390f35b61141b613516565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6114896004803603602081101561147357600080fd5b810190808035906020019092919050505061353c565b6040518082815260200191505060405180910390f35b61161360048036036101208110156114b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156114f357600080fd5b82018360208201111561150557600080fd5b8035906020019184600183028401116401000000008311171561152757600080fd5b90919293919293908035906020019064010000000081111561154857600080fd5b82018360208201111561155a57600080fd5b8035906020019184600183028401116401000000008311171561157c57600080fd5b90919293919293908035906020019064010000000081111561159d57600080fd5b8201836020820111156115af57600080fd5b803590602001918460018302840111640100000000831117156115d157600080fd5b9091929391929390803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919050505061355c565b604051808215151515815260200191505060405180910390f35b61168f6004803603604081101561164357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061384b565b604051808215151515815260200191505060405180910390f35b6116eb600480360360208110156116bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506138df565b604051808215151515815260200191505060405180910390f35b6000806000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b6000600a6000838152602001908152602001600020600501549050919050565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118245780601f106117f957610100808354040283529160200191611824565b820191906000526020600020905b81548152906001019060200180831161180757829003601f168201915b5050505050905090565b600061183982613985565b61188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180615147602c913960400191505060405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006118d482612c24565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561195b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806151f76021913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661197a6139a2565b73ffffffffffffffffffffffffffffffffffffffff1614806119a957506119a8816119a36139a2565b61384b565b5b6119fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603881526020018061509a6038913960400191505060405180910390fd5b611a0883836139aa565b505050565b6000600a6000838152602001908152602001600020600301549050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a8757600080fd5b611a9083613985565b611ae5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180615173602c913960400191505060405180910390fd5b8181600860008681526020019081526020016000209190611b07929190614dfb565b50505050565b6000611b196002613a63565b905090565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b7a57600080fd5b6000898990509050611b8a614e7b565b60008090505b82811015611ee057611bcc8c8c83818110611ba757fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16600e54613a78565b60405180610100016040528060106000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c715780601f10611c4657610100808354040283529160200191611c71565b820191906000526020600020905b815481529060010190602001808311611c5457829003601f168201915b5050505050815260200160106001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611d145780601f10611ce957610100808354040283529160200191611d14565b820191906000526020600020905b815481529060010190602001808311611cf757829003601f168201915b5050505050815260200160106002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611db75780601f10611d8c57610100808354040283529160200191611db7565b820191906000526020600020905b815481529060010190602001808311611d9a57829003601f168201915b505050505081526020018b8b84818110611dcd57fe5b90506020020135815260200160106004015481526020016010600501548152602001898984818110611dfb57fe5b905060200201358152602001878784818110611e1357fe5b90506020020135815250915081600a6000600e5481526020019081526020016000206000820151816000019080519060200190611e51929190614ec0565b506020820151816001019080519060200190611e6e929190614ec0565b506040820151816002019080519060200190611e8b929190614ec0565b50606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155905050600e600081548092919060010191905055508080600101915050611b90565b5060019250505098975050505050505050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f4f57600080fd5b6040518061010001604052808d8d8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505081526020018b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050815260200189898080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505081526020018781526020018681526020018581526020018481526020018381525060106000820151816000019080519060200190612073929190614ec0565b506020820151816001019080519060200190612090929190614ec0565b5060408201518160020190805190602001906120ad929190614ec0565b50606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155905050600190509b9a5050505050505050505050565b6121076121016139a2565b82613c1d565b61215c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806152186031913960400191505060405180910390fd5b612167838383613d11565b505050565b60006121bf82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020613f5490919063ffffffff16565b905092915050565b6000600a6000838152602001908152602001600020600701549050919050565b6060600a60008381526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122935780601f1061226857610100808354040283529160200191612293565b820191906000526020600020905b81548152906001019060200180831161227657829003601f168201915b50505050509050919050565b6122ba83838360405180602001604052806000815250613149565b505050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461231b57600080fd5b61232482613f6e565b61232c614e7b565b604051806101000160405280604051806020016040528060008152508152602001604051806020016040528060008152508152602001604051806020016040528060008152508152602001600081526020016000815260200160008152602001600081526020016000815250905080600a600085815260200190815260200160002060008201518160000190805190602001906123ca929190614ec0565b5060208201518160010190805190602001906123e7929190614ec0565b506040820151816002019080519060200190612404929190614ec0565b50606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701559050506001915050919050565b600a602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124f05780601f106124c5576101008083540402835291602001916124f0565b820191906000526020600020905b8154815290600101906020018083116124d357829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561258e5780601f106125635761010080835404028352916020019161258e565b820191906000526020600020905b81548152906001019060200180831161257157829003601f168201915b505050505090806002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561262c5780601f106126015761010080835404028352916020019161262c565b820191906000526020600020905b81548152906001019060200180831161260f57829003601f168201915b5050505050908060030154908060040154908060050154908060060154908060070154905088565b61265c614f40565b6040518060400160405280600a6000858152602001908152602001600020600601548152602001600a6000858152602001908152602001600020600701548152509050919050565b6000806126bb8360026140a890919063ffffffff16565b50905080915050919050565b6060600a60008381526020019081526020016000206002018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156127735780601f1061274857610100808354040283529160200191612773565b820191906000526020600020905b81548152906001019060200180831161275657829003601f168201915b50505050509050919050565b600061278a84612c24565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127c157600080fd5b600c54600d600086815260200190815260200160002054106127e257600080fd5b63055d4a808312801561281457507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa2b58083135b801561284e5750630aba95008212801561284d57507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5456b0082135b5b61285757600080fd5b612885600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e54613a78565b600c54600d6000600e54815260200190815260200160002081905550600d6000858152602001908152602001600020600081548092919060010191905055506128cc614e7b565b60405180610100016040528060106000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156129715780601f1061294657610100808354040283529160200191612971565b820191906000526020600020905b81548152906001019060200180831161295457829003601f168201915b5050505050815260200160106001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a145780601f106129e957610100808354040283529160200191612a14565b820191906000526020600020905b8154815290600101906020018083116129f757829003601f168201915b5050505050815260200160106002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ab75780601f10612a8c57610100808354040283529160200191612ab7565b820191906000526020600020905b815481529060010190602001808311612a9a57829003601f168201915b5050505050815260200160106003015481526020016010600401548152602001601060050154815260200185815260200184815250905080600a6000600e5481526020019081526020016000206000820151816000019080519060200190612b20929190614ec0565b506020820151816001019080519060200190612b3d929190614ec0565b506040820151816002019080519060200190612b5a929190614ec0565b50606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155905050600e6000815480929190600101919050555060019150509392505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612c0857600080fd5b818160099190612c19929190614dfb565b505050565b600e5481565b6000612c54826040518060600160405280602981526020016150fc6029913960026140d79092919063ffffffff16565b9050919050565b600d6020528060005260406000206000915090505481565b606060096040516020018082805460018160011615610100020316600290048015612cd55780601f10612cb3576101008083540402835291820191612cd5565b820191906000526020600020905b815481529060010190602001808311612cc1575b5050807f646566696c6162735f6e6674732e6a736f6e0000000000000000000000000000815250601201915050604051602081830303815290604052905090565b6060600a60008381526020019081526020016000206000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612dc25780601f10612d9757610100808354040283529160200191612dc2565b820191906000526020600020905b815481529060010190602001808311612da557829003601f168201915b50505050509050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612e55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001806150d2602a913960400191505060405180910390fd5b612e9c600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206140f6565b9050919050565b6000600a6000838152602001908152602001600020600601549050919050565b600c5481565b606060078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612f615780601f10612f3657610100808354040283529160200191612f61565b820191906000526020600020905b815481529060010190602001808311612f4457829003601f168201915b5050505050905090565b612f736139a2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613014576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f4552433732313a20617070726f766520746f2063616c6c65720000000000000081525060200191505060405180910390fd5b80600560006130216139a2565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166130ce6139a2565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051808215151515815260200191505060405180910390a35050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61315a6131546139a2565b83613c1d565b6131af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001806152186031913960400191505060405180910390fd5b6131bb8484848461410b565b50505050565b60606131cc82613985565b613221576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806151c8602f913960400191505060405180910390fd5b6060600860008481526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156132ca5780601f1061329f576101008083540402835291602001916132ca565b820191906000526020600020905b8154815290600101906020018083116132ad57829003601f168201915b505050505090506000600980546001816001161561010002031660029004905014156132f957809150506134a5565b6000815111156133d25760098160405160200180838054600181600116156101000203166002900480156133645780601f10613342576101008083540402835291820191613364565b820191906000526020600020905b815481529060010190602001808311613350575b505082805190602001908083835b602083106133955780518252602082019150602081019050602083039250613372565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529150506134a5565b60096133dd8461417d565b604051602001808380546001816001161561010002031660029004801561343b5780601f1061341957610100808354040283529182019161343b565b820191906000526020600020905b815481529060010190602001808311613427575b505082805190602001908083835b6020831061346c5780518252602082019150602081019050602083039250613449565b6001836020036101000a038019825116818451168082178552505050505050905001925050506040516020818303038152906040529150505b919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461350657600080fd5b81600c8190555060019050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a6000838152602001908152602001600020600401549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168d73ffffffffffffffffffffffffffffffffffffffff16141561359757600080fd5b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146135f157600080fd5b63055d4a808312801561362357507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa2b58083135b801561365d5750630aba95008212801561365c57507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5456b0082135b5b61366657600080fd5b6136728d600e54613a78565b61367a614e7b565b6040518061010001604052808e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505081526020018c8c8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505081526020018a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050815260200188815260200187815260200186815260200185815260200184815250905080600a6000600e54815260200190815260200160002060008201518160000190805190602001906137b4929190614ec0565b5060208201518160010190805190602001906137d1929190614ec0565b5060408201518160020190805190602001906137ee929190614ec0565b50606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e08201518160070155905050600e6000815480929190600101919050555060019150509c9b505050505050505050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461393b57600080fd5b81600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600061399b8260026142ad90919063ffffffff16565b9050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16613a1d83612c24565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000613a71826000016142c7565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613b1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4552433732313a206d696e7420746f20746865207a65726f206164647265737381525060200191505060405180910390fd5b60011515613b2882613985565b15151415613b4757600e60008154809291906001019190505550613c19565b613b53600083836142d8565b613ba481600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206142dd90919063ffffffff16565b50613bbb818360026142f79092919063ffffffff16565b50808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050565b6000613c2882613985565b613c7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c81526020018061506e602c913960400191505060405180910390fd5b6000613c8883612c24565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480613cf757508373ffffffffffffffffffffffffffffffffffffffff16613cdf8461182e565b73ffffffffffffffffffffffffffffffffffffffff16145b80613d085750613d07818561384b565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16613d3182612c24565b73ffffffffffffffffffffffffffffffffffffffff1614613d9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061519f6029913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613e23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806150246024913960400191505060405180910390fd5b613e2e8383836142d8565b613e396000826139aa565b613e8a81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061432c90919063ffffffff16565b50613edc81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206142dd90919063ffffffff16565b50613ef3818360026142f79092919063ffffffff16565b50808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000613f638360000183614346565b60001c905092915050565b6000613f7982612c24565b9050613f87816000846142d8565b613f926000836139aa565b60006008600084815260200190815260200160002080546001816001161561010002031660029004905014613fe157600860008381526020019081526020016000206000613fe09190614f62565b5b61403282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061432c90919063ffffffff16565b506140478260026143c990919063ffffffff16565b5081600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6000806000806140bb86600001866143e3565b915091508160001c8160001c8090509350935050509250929050565b60006140ea846000018460001b8461447c565b60001c90509392505050565b600061410482600001614572565b9050919050565b614116848484613d11565b61412284848484614583565b614177576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526032815260200180614ff26032913960400191505060405180910390fd5b50505050565b606060008214156141c5576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506142a8565b600082905060005b600082146141ef578080600101915050600a82816141e757fe5b0491506141cd565b6060816040519080825280601f01601f1916602001820160405280156142245781602001600182028038833980820191505090505b50905060006001830390508593505b600084146142a057600a848161424557fe5b0660300160f81b8282806001900393508151811061425f57fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a848161429857fe5b049350614233565b819450505050505b919050565b60006142bf836000018360001b6147c8565b905092915050565b600081600001805490509050919050565b505050565b60006142ef836000018360001b6147eb565b905092915050565b6000614323846000018460001b8473ffffffffffffffffffffffffffffffffffffffff1660001b61485b565b90509392505050565b600061433e836000018360001b614937565b905092915050565b6000818360000180549050116143a7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180614fd06022913960400191505060405180910390fd5b8260000182815481106143b657fe5b9060005260206000200154905092915050565b60006143db836000018360001b614a1f565b905092915050565b60008082846000018054905011614445576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806151256022913960400191505060405180910390fd5b600084600001848154811061445657fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b60008084600101600085815260200190815260200160002054905060008114158390614543576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156145085780820151818401526020810190506144ed565b50505050905090810190601f1680156145355780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5084600001600182038154811061455657fe5b9060005260206000209060020201600101549150509392505050565b600081600001805490509050919050565b60006145a48473ffffffffffffffffffffffffffffffffffffffff16614b38565b6145b157600190506147c0565b606061474763150b7a0260e01b6145c66139a2565b888787604051602401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561467657808201518184015260208101905061465b565b50505050905090810190601f1680156146a35780820380516001836020036101000a031916815260200191505b5095505050505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051806060016040528060328152602001614ff2603291398773ffffffffffffffffffffffffffffffffffffffff16614b4b9092919063ffffffff16565b9050600081806020019051602081101561476057600080fd5b8101908080519060200190929190505050905063150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614925050505b949350505050565b600080836001016000848152602001908152602001600020541415905092915050565b60006147f78383614b63565b614850578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050614855565b600090505b92915050565b600080846001016000858152602001908152602001600020549050600081141561490257846000016040518060400160405280868152602001858152509080600181540180825580915050600190039060005260206000209060020201600090919091909150600082015181600001556020820151816001015550508460000180549050856001016000868152602001908152602001600020819055506001915050614930565b8285600001600183038154811061491557fe5b90600052602060002090600202016001018190555060009150505b9392505050565b60008083600101600084815260200190815260200160002054905060008114614a13576000600182039050600060018660000180549050039050600086600001828154811061498257fe5b906000526020600020015490508087600001848154811061499f57fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806149d757fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050614a19565b60009150505b92915050565b60008083600101600084815260200190815260200160002054905060008114614b2c5760006001820390506000600186600001805490500390506000866000018281548110614a6a57fe5b9060005260206000209060020201905080876000018481548110614a8a57fe5b9060005260206000209060020201600082015481600001556001820154816001015590505060018301876001016000836000015481526020019081526020016000208190555086600001805480614add57fe5b6001900381819060005260206000209060020201600080820160009055600182016000905550509055866001016000878152602001908152602001600020600090556001945050505050614b32565b60009150505b92915050565b600080823b905060008111915050919050565b6060614b5a8484600085614b86565b90509392505050565b600080836001016000848152602001908152602001600020541415905092915050565b606082471015614be1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806150486026913960400191505060405180910390fd5b614bea85614b38565b614c5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081525060200191505060405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff1685876040518082805190602001908083835b60208310614cac5780518252602082019150602081019050602083039250614c89565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114614d0e576040519150601f19603f3d011682016040523d82523d6000602084013e614d13565b606091505b5091509150614d23828286614d2f565b92505050949350505050565b60608315614d3f57829050614df4565b600083511115614d525782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015614db9578082015181840152602081019050614d9e565b50505050905090810190601f168015614de65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10614e3c57803560ff1916838001178555614e6a565b82800160010185558215614e6a579182015b82811115614e69578235825591602001919060010190614e4e565b5b509050614e779190614faa565b5090565b60405180610100016040528060608152602001606081526020016060815260200160008152602001600081526020016000815260200160008152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10614f0157805160ff1916838001178555614f2f565b82800160010185558215614f2f579182015b82811115614f2e578251825591602001919060010190614f13565b5b509050614f3c9190614faa565b5090565b6040518060400160405280600290602082028038833980820191505090505090565b50805460018160011615610100020316600290046000825580601f10614f885750614fa7565b601f016020900490600052602060002090810190614fa69190614faa565b5b50565b614fcc91905b80821115614fc8576000816000905550600101614fb0565b5090565b9056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a207472616e7366657220746f20746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c4552433732313a206f70657261746f7220717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76652063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f76656420666f7220616c6c4552433732313a2062616c616e636520717565727920666f7220746865207a65726f20616464726573734552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656e456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e64734552433732313a20617070726f76656420717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732314d657461646174613a2055524920736574206f66206e6f6e6578697374656e7420746f6b656e4552433732313a207472616e73666572206f6620746f6b656e2074686174206973206e6f74206f776e4552433732314d657461646174613a2055524920717565727920666f72206e6f6e6578697374656e7420746f6b656e4552433732313a20617070726f76616c20746f2063757272656e74206f776e65724552433732313a207472616e736665722063616c6c6572206973206e6f74206f776e6572206e6f7220617070726f766564a2646970667358221220d8a4678a34a3286c8ab8f3cb8597a3e601ef52c9f3ce3f62275bab0e05258c8e64736f6c63430006020033
Verified Source Code Partial Match
Compiler: v0.6.2+commit.bacdbe57
EVM: istanbul
Optimization: No
DeFiLABS.sol 742 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.6.2;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
interface 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);
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) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface IERC721Enumerable is IERC721 {
function totalSupply() external view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
function tokenByIndex(uint256 index) external view returns (uint256);
}
interface IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
contract ERC165 is IERC165 {
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () internal {
_registerInterface(_INTERFACE_ID_ERC165);
}
function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
return _supportedInterfaces[interfaceId];
}
function _registerInterface(bytes4 interfaceId) internal virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
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] = toDeleteIndex + 1;
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(value)));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(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(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 EnumerableMap {
struct MapEntry {
bytes32 _key;
bytes32 _value;
}
struct Map {
MapEntry[] _entries;
mapping (bytes32 => uint256) _indexes;
}
function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) {
map._entries.push(MapEntry({ _key: key, _value: value }));
map._indexes[key] = map._entries.length;
return true;
} else {
map._entries[keyIndex - 1]._value = value;
return false;
}
}
function _remove(Map storage map, bytes32 key) private returns (bool) {
uint256 keyIndex = map._indexes[key];
if (keyIndex != 0) {
uint256 toDeleteIndex = keyIndex - 1;
uint256 lastIndex = map._entries.length - 1;
MapEntry storage lastEntry = map._entries[lastIndex];
map._entries[toDeleteIndex] = lastEntry;
map._indexes[lastEntry._key] = toDeleteIndex + 1;
map._entries.pop();
delete map._indexes[key];
return true;
} else {
return false;
}
}
function _contains(Map storage map, bytes32 key) private view returns (bool) {
return map._indexes[key] != 0;
}
function _length(Map storage map) private view returns (uint256) {
return map._entries.length;
}
function _at(Map storage map, uint256 index) private view returns (bytes32, bytes32) {
require(map._entries.length > index, "EnumerableMap: index out of bounds");
MapEntry storage entry = map._entries[index];
return (entry._key, entry._value);
}
function _get(Map storage map, bytes32 key) private view returns (bytes32) {
return _get(map, key, "EnumerableMap: nonexistent key");
}
function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, errorMessage);
return map._entries[keyIndex - 1]._value;
}
struct UintToAddressMap {
Map _inner;
}
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(value)));
}
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return _remove(map._inner, bytes32(key));
}
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return _contains(map._inner, bytes32(key));
}
function length(UintToAddressMap storage map) internal view returns (uint256) {
return _length(map._inner);
}
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint256(value)));
}
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint256(_get(map._inner, bytes32(key))));
}
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
return address(uint256(_get(map._inner, bytes32(key), errorMessage)));
}
}
library Strings {
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = byte(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
}
contract DeFiLABS is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable {
using SafeMath for uint256;
using Address for address;
using EnumerableSet for EnumerableSet.UintSet;
using EnumerableMap for EnumerableMap.UintToAddressMap;
using Strings for uint256;
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
mapping (address => EnumerableSet.UintSet) private _holderTokens;
EnumerableMap.UintToAddressMap private _tokenOwners;
mapping (uint256 => address) private _tokenApprovals;
mapping (address => mapping (address => bool)) private _operatorApprovals;
string private _name;
string private _symbol;
mapping (uint256 => string) private _tokenURIs;
string private _baseURI;
struct nft_properties {
string name;
string thumbnail;
string model_url;
uint256 coef_1;
uint256 coef_2;
uint256 coef_3;
int256 latitude;
int256 longitude;
}
mapping (uint256 => nft_properties) public arAsset;
address public deployer;
uint256 public spawnlimit;
mapping (uint256 => uint256) public spawnCount;
uint256 public mintTicket;
address public geoplacer;
nft_properties spawnerData;
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
deployer = msg.sender;
geoplacer = deployer;
spawnlimit = 0;
mintTicket = 0;
_registerInterface(_INTERFACE_ID_ERC721);
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
function arAsset_name(uint256 tokenId) external view returns(string memory) {
return arAsset[tokenId].name;
}
function arAsset_thumbnail(uint256 tokenId) external view returns(string memory) {
return arAsset[tokenId].thumbnail;
}
function arAsset_contents(uint256 tokenId) external view returns(string memory) {
return arAsset[tokenId].model_url;
}
function arAsset_coef1(uint256 tokenId) external view returns(uint256) {
return arAsset[tokenId].coef_1;
}
function arAsset_coef2(uint256 tokenId) external view returns(uint256) {
return arAsset[tokenId].coef_2;
}
function arAsset_coef3(uint256 tokenId) external view returns(uint256) {
return arAsset[tokenId].coef_3;
}
function arAsset_latitude(uint256 tokenId) external view returns(int256) {
return arAsset[tokenId].latitude;
}
function arAsset_longitude(uint256 tokenId) external view returns(int256) {
return arAsset[tokenId].longitude;
}
function arAsset_coords(uint256 tokenId) external view returns(int256[2] memory coords) {
return [arAsset[tokenId].latitude, arAsset[tokenId].longitude];
}
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _holderTokens[owner].length();
}
function ownerOf(uint256 tokenId) public view override returns (address) {
return _tokenOwners.get(tokenId, "ERC721: owner query for nonexistent token");
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function setSpawnLimit(uint256 limit) external returns(bool) {
require(msg.sender == deployer);
spawnlimit = limit;
return true;
}
function setSpawnerData(string calldata nft_name, string calldata image, string calldata url, uint256 coef1, uint256 coef2, uint256 coef3, int256 lat, int256 long) external returns(bool) {
require (msg.sender == deployer);
spawnerData = nft_properties(nft_name, image, url, coef1, coef2, coef3, lat, long);
return true;
}
function setGeoPlacer(address _geoplacer) external returns(bool) {
require(msg.sender == deployer);
geoplacer = _geoplacer;
return true;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory _tokenURI = _tokenURIs[tokenId];
if (bytes(_baseURI).length == 0) {
return _tokenURI;
}
if (bytes(_tokenURI).length > 0) {
return string(abi.encodePacked(_baseURI, _tokenURI));
}
return string(abi.encodePacked(_baseURI, tokenId.toString()));
}
function baseURI() public view returns (string memory) {
return string(abi.encodePacked(_baseURI, "defilabs_nfts.json"));
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view override returns (uint256) {
return _holderTokens[owner].at(index);
}
function totalSupply() public view override returns (uint256) {
return _tokenOwners.length();
}
function tokenByIndex(uint256 index) public view override returns (uint256) {
(uint256 tokenId, ) = _tokenOwners.at(index);
return tokenId;
}
function approve(address to, uint256 tokenId) public virtual override {
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"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view returns (bool) {
return _tokenOwners.contains(tokenId);
}
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));
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
if (_exists(tokenId) == true) {
mintTicket++;
} else {
_beforeTokenTransfer(address(0), to, tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(address(0), to, tokenId);
}
}
function mint(address to, string calldata nft_name, string calldata image, string calldata url, uint256 coef1, uint256 coef2, uint256 coef3, int256 lat, int256 long) external returns(bool) {
require (to != address(0));
require (msg.sender == deployer);
require ((lat < 90000000 && lat > -90000000) && (long < 180000000 && long > -180000000));
_mint(to, mintTicket);
nft_properties memory nft;
nft = nft_properties(nft_name, image, url, coef1, coef2, coef3, lat, long);
arAsset[mintTicket] = nft;
mintTicket++;
return true;
}
function bulkmint(address[] calldata to, uint256[] calldata coef1, int256[] calldata lat, int256[] calldata long) external returns(bool) {
require (msg.sender == deployer);
uint listsize = to.length;
nft_properties memory nft;
for (uint i = 0; i < listsize; i++) {
_mint(to[i], mintTicket);
nft = nft_properties(spawnerData.name, spawnerData.thumbnail, spawnerData.model_url, coef1[i], spawnerData.coef_2, spawnerData.coef_3, lat[i], long[i]);
arAsset[mintTicket] = nft;
mintTicket++;
}
return true;
}
function _burn(uint256 tokenId) internal virtual {
address owner = ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
_holderTokens[owner].remove(tokenId);
_tokenOwners.remove(tokenId);
emit Transfer(owner, address(0), tokenId);
}
function burn(uint256 tokenId) external returns(bool) {
require (msg.sender == deployer);
_burn(tokenId);
nft_properties memory nft;
nft = nft_properties("", "", "", 0, 0, 0, 0, 0);
arAsset[tokenId] = nft;
return true;
}
function spawn(uint256 _SpawnerTokenId, int256 _latitude, int256 _longitude) external returns(bool) {
require(msg.sender == ownerOf(_SpawnerTokenId));
require(spawnCount[_SpawnerTokenId] < spawnlimit);
require ((_latitude < 90000000 && _latitude > -90000000) && (_longitude < 180000000 && _longitude > -180000000));
_mint(geoplacer, mintTicket);
spawnCount[mintTicket] = spawnlimit;
spawnCount[_SpawnerTokenId]++;
nft_properties memory nft;
nft = nft_properties(spawnerData.name, spawnerData.thumbnail, spawnerData.model_url, spawnerData.coef_1, spawnerData.coef_2, spawnerData.coef_3, _latitude, _longitude);
arAsset[mintTicket] = nft;
mintTicket++;
return true;
}
function _transfer(address from, address to, uint256 tokenId) internal virtual {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_holderTokens[from].remove(tokenId);
_holderTokens[to].add(tokenId);
_tokenOwners.set(tokenId, to);
emit Transfer(from, to, tokenId);
}
function setTokenURI(uint256 tokenId, string calldata _tokenURI) external {
require (msg.sender == deployer);
require(_exists(tokenId), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = _tokenURI;
}
function setBaseURI(string calldata baseURI_) external {
require (msg.sender == deployer);
_baseURI = baseURI_;
}
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
private returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes memory returndata = to.functionCall(abi.encodeWithSelector(
IERC721Receiver(to).onERC721Received.selector,
_msgSender(),
from,
tokenId,
_data
), "ERC721: transfer to non ERC721Receiver implementer");
bytes4 retval = abi.decode(returndata, (bytes4));
return (retval == _ERC721_RECEIVED);
}
function _approve(address to, uint256 tokenId) private {
_tokenApprovals[tokenId] = to;
emit Approval(ownerOf(tokenId), to, tokenId);
}
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { }
}
Read Contract
arAsset 0x4832a868 → string, string, string, uint256, uint256, uint256, int256, int256
arAsset_coef1 0x16059f1b → uint256
arAsset_coef2 0xe4310739 → uint256
arAsset_coef3 0x03e553a5 → uint256
arAsset_contents 0x554c05b1 → string
arAsset_coords 0x4a9c9c83 → int256[2]
arAsset_latitude 0x822abf42 → int256
arAsset_longitude 0x306e4900 → int256
arAsset_name 0x70016a65 → string
arAsset_thumbnail 0x32bc9927 → string
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
deployer 0xd5f39488 → address
geoplacer 0xa75dc333 → address
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
mintTicket 0x573c80fa → uint256
name 0x06fdde03 → string
ownerOf 0x6352211e → address
spawnCount 0x6552a4c5 → uint256
spawnlimit 0x91a425e7 → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 14 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
bulkmint 0x19021e8a
address[] to
uint256[] coef1
int256[] lat
int256[] long
returns: bool
burn 0x42966c68
uint256 tokenId
returns: bool
mint 0xe575c3dc
address to
string nft_name
string image
string url
uint256 coef1
uint256 coef2
uint256 coef3
int256 lat
int256 long
returns: bool
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string baseURI_
setGeoPlacer 0xf9df6490
address _geoplacer
returns: bool
setSpawnLimit 0xcf7c4eb5
uint256 limit
returns: bool
setSpawnerData 0x203a9a37
string nft_name
string image
string url
uint256 coef1
uint256 coef2
uint256 coef3
int256 lat
int256 long
returns: bool
setTokenURI 0x162094c4
uint256 tokenId
string _tokenURI
spawn 0x556754ad
uint256 _SpawnerTokenId
int256 _latitude
int256 _longitude
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
Recent Transactions
No transactions found for this address