Address Contract Partially Verified
Address
0x40D1587cB0BD9E2BCF7ab16c857D9A9FD881d445
Balance
0 ETH
Nonce
1
Code Size
21263 bytes
Creator
0x19Fde224...2aDc at tx 0x36f3bb1c...0a7e07
Indexed Transactions
0
Contract Bytecode
21263 bytes
0x6080604052600436106102455760003560e01c80636352211e11610139578063b09904b5116100b6578063e0c0c0771161007a578063e0c0c07714610892578063e985e9c5146108bd578063eb8d2444146108fa578063f2fde38b14610925578063f5da38651461094e578063fc2eb74a1461097957610245565b8063b09904b5146107af578063b88d4fde146107d8578063bf4702fc14610801578063c87b56dd14610818578063d9b137b21461085557610245565b8063892aae4f116100fd578063892aae4f146106da5780638da5cb5b1461070557806395d89b41146107305780639c3e72bd1461075b578063a22cb4651461078657610245565b80636352211e146105e15780636c0360eb1461061e57806370a0823114610649578063715018a6146106865780638462151c1461069d57610245565b806323b872dd116101c757806342842e0e1161018b57806342842e0e146104ec5780634c3d2205146105155780634f6ccce71461055257806355f804b31461058f5780635d44ae28146105b857610245565b806323b872dd1461041b5780632f745c591461044457806334918dfd146104815780633ccfd60b146104985780633d524a7f146104af57610245565b8063109695231161020e5780631096952314610343578063141f3de21461036c57806318160ddd146103885780631f03396f146103b357806320cdf027146103f057610245565b80628948161461024a57806301ffc9a71461027557806306fdde03146102b2578063081812fc146102dd578063095ea7b31461031a575b600080fd5b34801561025657600080fd5b5061025f6109a2565b60405161026c9190614f57565b60405180910390f35b34801561028157600080fd5b5061029c60048036038101906102979190613a6c565b6109ad565b6040516102a99190614b18565b60405180910390f35b3480156102be57600080fd5b506102c7610a14565b6040516102d49190614b33565b60405180910390f35b3480156102e957600080fd5b5061030460048036038101906102ff9190613aff565b610ab6565b6040516103119190614a2f565b60405180910390f35b34801561032657600080fd5b50610341600480360381019061033c9190613a07565b610b3b565b005b34801561034f57600080fd5b5061036a60048036038101906103659190613abe565b610c53565b005b61038660048036038101906103819190613aff565b610ce9565b005b34801561039457600080fd5b5061039d610e87565b6040516103aa9190614f57565b60405180910390f35b3480156103bf57600080fd5b506103da60048036038101906103d5919061389c565b610e98565b6040516103e79190614ad4565b60405180910390f35b3480156103fc57600080fd5b50610405611045565b6040516104129190614f57565b60405180910390f35b34801561042757600080fd5b50610442600480360381019061043d9190613901565b61104b565b005b34801561045057600080fd5b5061046b60048036038101906104669190613a07565b6110ab565b6040516104789190614f57565b60405180910390f35b34801561048d57600080fd5b50610496611106565b005b3480156104a457600080fd5b506104ad6111ae565b005b3480156104bb57600080fd5b506104d660048036038101906104d19190613aff565b611279565b6040516104e39190614b33565b60405180910390f35b3480156104f857600080fd5b50610513600480360381019061050e9190613901565b611377565b005b34801561052157600080fd5b5061053c60048036038101906105379190613aff565b611397565b6040516105499190614b33565b60405180910390f35b34801561055e57600080fd5b5061057960048036038101906105749190613aff565b611447565b6040516105869190614f57565b60405180910390f35b34801561059b57600080fd5b506105b660048036038101906105b19190613abe565b61146a565b005b3480156105c457600080fd5b506105df60048036038101906105da9190613b28565b6114f2565b005b3480156105ed57600080fd5b5061060860048036038101906106039190613aff565b61168c565b6040516106159190614a2f565b60405180910390f35b34801561062a57600080fd5b506106336116c3565b6040516106409190614b33565b60405180910390f35b34801561065557600080fd5b50610670600480360381019061066b919061389c565b611765565b60405161067d9190614f57565b60405180910390f35b34801561069257600080fd5b5061069b611824565b005b3480156106a957600080fd5b506106c460048036038101906106bf919061389c565b611961565b6040516106d19190614af6565b60405180910390f35b3480156106e657600080fd5b506106ef611a5a565b6040516106fc9190614f57565b60405180910390f35b34801561071157600080fd5b5061071a611a60565b6040516107279190614a2f565b60405180910390f35b34801561073c57600080fd5b50610745611a8a565b6040516107529190614b33565b60405180910390f35b34801561076757600080fd5b50610770611b2c565b60405161077d9190614b33565b60405180910390f35b34801561079257600080fd5b506107ad60048036038101906107a891906139cb565b611bca565b005b3480156107bb57600080fd5b506107d660048036038101906107d19190613abe565b611d4b565b005b3480156107e457600080fd5b506107ff60048036038101906107fa9190613950565b611e37565b005b34801561080d57600080fd5b50610816611e99565b005b34801561082457600080fd5b5061083f600480360381019061083a9190613aff565b611f6a565b60405161084c9190614b33565b60405180910390f35b34801561086157600080fd5b5061087c60048036038101906108779190613aff565b6120ed565b6040516108899190614b33565b60405180910390f35b34801561089e57600080fd5b506108a76121da565b6040516108b49190614f57565b60405180910390f35b3480156108c957600080fd5b506108e460048036038101906108df91906138c5565b6121df565b6040516108f19190614b18565b60405180910390f35b34801561090657600080fd5b5061090f612273565b60405161091c9190614b18565b60405180910390f35b34801561093157600080fd5b5061094c6004803603810190610947919061389c565b612286565b005b34801561095a57600080fd5b50610963612432565b6040516109709190614b33565b60405180910390f35b34801561098557600080fd5b506109a0600480360381019061099b9190613a07565b6124d0565b005b66470de4df82000081565b6000806000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610aac5780601f10610a8157610100808354040283529160200191610aac565b820191906000526020600020905b815481529060010190602001808311610a8f57829003601f168201915b5050505050905090565b6000610ac1826125ee565b610b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af790614dd7565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610b468261168c565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bb7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bae90614e77565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610bd661260b565b73ffffffffffffffffffffffffffffffffffffffff161480610c055750610c0481610bff61260b565b6121df565b5b610c44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3b90614d17565b60405180910390fd5b610c4e8383612613565b505050565b610c5b61260b565b73ffffffffffffffffffffffffffffffffffffffff16610c79611a60565b73ffffffffffffffffffffffffffffffffffffffff1614610ccf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cc690614df7565b60405180910390fd5b80600b9080519060200190610ce59291906136d9565b5050565b600d60009054906101000a900460ff16610d38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2f90614c77565b60405180910390fd5b600081118015610d495750600a8111155b610d88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7f90614e57565b60405180910390fd5b612710610da582610d97610e87565b6126cc90919063ffffffff16565b1115610de6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ddd90614d57565b60405180910390fd5b610e008166470de4df82000061272190919063ffffffff16565b341015610e42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3990614ef7565b60405180910390fd5b60005b81811015610e83576000610e57610e87565b9050612710610e64610e87565b1015610e7557610e743382612791565b5b508080600101915050610e45565b5050565b6000610e9360026127af565b905090565b60606000610ea583611765565b90506000811415610f0557600067ffffffffffffffff81118015610ec857600080fd5b50604051908082528060200260200182016040528015610efc57816020015b6060815260200190600190039081610ee75790505b50915050611040565b60608167ffffffffffffffff81118015610f1e57600080fd5b50604051908082528060200260200182016040528015610f5257816020015b6060815260200190600190039081610f3d5790505b50905060005b8281101561103957600e6000610f6e87846110ab565b81526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110105780601f10610fe557610100808354040283529160200191611010565b820191906000526020600020905b815481529060010190602001808311610ff357829003601f168201915b505050505082828151811061102157fe5b60200260200101819052508080600101915050610f58565b5080925050505b919050565b600f5481565b61105c61105661260b565b826127c4565b61109b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109290614eb7565b60405180910390fd5b6110a68383836128a2565b505050565b60006110fe82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612ab990919063ffffffff16565b905092915050565b61110e61260b565b73ffffffffffffffffffffffffffffffffffffffff1661112c611a60565b73ffffffffffffffffffffffffffffffffffffffff1614611182576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117990614df7565b60405180910390fd5b600d60009054906101000a900460ff1615600d60006101000a81548160ff021916908315150217905550565b6111b661260b565b73ffffffffffffffffffffffffffffffffffffffff166111d4611a60565b73ffffffffffffffffffffffffffffffffffffffff161461122a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122190614df7565b60405180910390fd5b60004790503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611275573d6000803e3d6000fd5b5050565b6060611283610e87565b82106112c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112bb90614e97565b60405180910390fd5b600e60008381526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561136b5780601f106113405761010080835404028352916020019161136b565b820191906000526020600020905b81548152906001019060200180831161134e57829003601f168201915b50505050509050919050565b61139283838360405180602001604052806000815250611e37565b505050565b600e6020528060005260406000206000915090508054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561143f5780601f106114145761010080835404028352916020019161143f565b820191906000526020600020905b81548152906001019060200180831161142257829003601f168201915b505050505081565b60008061145e836002612ad390919063ffffffff16565b50905080915050919050565b61147261260b565b73ffffffffffffffffffffffffffffffffffffffff16611490611a60565b73ffffffffffffffffffffffffffffffffffffffff16146114e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114dd90614df7565b60405180910390fd5b6114ef81612aff565b50565b3373ffffffffffffffffffffffffffffffffffffffff166115128361168c565b73ffffffffffffffffffffffffffffffffffffffff1614611568576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155f90614f37565b60405180910390fd5b6002600e600084815260200190815260200160002060405161158a91906149f4565b602060405180830381855afa1580156115a7573d6000803e3d6000fd5b5050506040513d601f19601f820116820180604052508101906115ca9190613a43565b6002826040516115da91906149dd565b602060405180830381855afa1580156115f7573d6000803e3d6000fd5b5050506040513d601f19601f8201168201806040525081019061161a9190613a43565b141561162557600080fd5b80600e6000848152602001908152602001600020908051906020019061164c9291906136d9565b507fa89cd37603395331c54473a84dacc4f5f5182a6dbeee09085150019a2b7752e733838360405161168093929190614a96565b60405180910390a15050565b60006116bc826040518060600160405280602981526020016152b1602991396002612b199092919063ffffffff16565b9050919050565b606060098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561175b5780601f106117305761010080835404028352916020019161175b565b820191906000526020600020905b81548152906001019060200180831161173e57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156117d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117cd90614d37565b60405180910390fd5b61181d600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612b38565b9050919050565b61182c61260b565b73ffffffffffffffffffffffffffffffffffffffff1661184a611a60565b73ffffffffffffffffffffffffffffffffffffffff16146118a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189790614df7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6060600061196e83611765565b905060008114156119c957600067ffffffffffffffff8111801561199157600080fd5b506040519080825280602002602001820160405280156119c05781602001602082028036833780820191505090505b50915050611a55565b60608167ffffffffffffffff811180156119e257600080fd5b50604051908082528060200260200182016040528015611a115781602001602082028036833780820191505090505b50905060005b82811015611a4e57611a2985826110ab565b828281518110611a3557fe5b6020026020010181815250508080600101915050611a17565b8193505050505b919050565b61271081565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b225780601f10611af757610100808354040283529160200191611b22565b820191906000526020600020905b815481529060010190602001808311611b0557829003601f168201915b5050505050905090565b600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611bc25780601f10611b9757610100808354040283529160200191611bc2565b820191906000526020600020905b815481529060010190602001808311611ba557829003601f168201915b505050505081565b611bd261260b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3790614c57565b60405180910390fd5b8060056000611c4d61260b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff16611cfa61260b565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611d3f9190614b18565b60405180910390a35050565b611d5361260b565b73ffffffffffffffffffffffffffffffffffffffff16611d71611a60565b73ffffffffffffffffffffffffffffffffffffffff1614611dc7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dbe90614df7565b60405180910390fd5b60001515600d60019054906101000a900460ff16151514611e1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1490614f17565b60405180910390fd5b80600c9080519060200190611e339291906136d9565b5050565b611e48611e4261260b565b836127c4565b611e87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7e90614eb7565b60405180910390fd5b611e9384848484612b4d565b50505050565b611ea161260b565b73ffffffffffffffffffffffffffffffffffffffff16611ebf611a60565b73ffffffffffffffffffffffffffffffffffffffff1614611f15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f0c90614df7565b60405180910390fd5b6001600d60016101000a81548160ff0219169083151502179055507ff27a6fa5c2c9783f2c131f659c2119106077b81db9f21c76357aa819ad314f7e600c604051611f609190614b55565b60405180910390a1565b6060611f75826125ee565b611fb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fab90614e37565b60405180910390fd5b6060600860008481526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561205d5780601f106120325761010080835404028352916020019161205d565b820191906000526020600020905b81548152906001019060200180831161204057829003601f168201915b50505050509050606061206e6116c3565b90506000815114156120845781925050506120e8565b6000825111156120b95780826040516020016120a1929190614a0b565b604051602081830303815290604052925050506120e8565b806120c385612ba9565b6040516020016120d4929190614a0b565b604051602081830303815290604052925050505b919050565b60606120f7610e87565b8210612138576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212f90614cf7565b60405180910390fd5b600c8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121ce5780601f106121a3576101008083540402835291602001916121ce565b820191906000526020600020905b8154815290600101906020018083116121b157829003601f168201915b50505050509050919050565b600a81565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600d60009054906101000a900460ff1681565b61228e61260b565b73ffffffffffffffffffffffffffffffffffffffff166122ac611a60565b73ffffffffffffffffffffffffffffffffffffffff1614612302576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f990614df7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612372576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236990614bd7565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124c85780601f1061249d576101008083540402835291602001916124c8565b820191906000526020600020905b8154815290600101906020018083116124ab57829003601f168201915b505050505081565b6124d861260b565b73ffffffffffffffffffffffffffffffffffffffff166124f6611a60565b73ffffffffffffffffffffffffffffffffffffffff161461254c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254390614df7565b60405180910390fd5b6000612556610e87565b905060008211801561256a5750600f548211155b6125a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125a090614b97565b60405180910390fd5b60005b828110156125cd576125c084828401612791565b80806001019150506125ac565b506125e382600f54612cf090919063ffffffff16565b600f81905550505050565b6000612604826002612d4090919063ffffffff16565b9050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166126868361168c565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080828401905083811015612717576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270e90614c17565b60405180910390fd5b8091505092915050565b600080831415612734576000905061278b565b600082840290508284828161274557fe5b0414612786576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161277d90614db7565b60405180910390fd5b809150505b92915050565b6127ab828260405180602001604052806000815250612d5a565b5050565b60006127bd82600001612db5565b9050919050565b60006127cf826125ee565b61280e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161280590614cd7565b60405180910390fd5b60006128198361168c565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061288857508373ffffffffffffffffffffffffffffffffffffffff1661287084610ab6565b73ffffffffffffffffffffffffffffffffffffffff16145b80612899575061289881856121df565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166128c28261168c565b73ffffffffffffffffffffffffffffffffffffffff1614612918576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290f90614e17565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612988576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161297f90614c37565b60405180910390fd5b612993838383612dc6565b61299e600082612613565b6129ef81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612dcb90919063ffffffff16565b50612a4181600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612de590919063ffffffff16565b50612a5881836002612dff9092919063ffffffff16565b50808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000612ac88360000183612e34565b60001c905092915050565b600080600080612ae68660000186612ea1565b915091508160001c8160001c9350935050509250929050565b8060099080519060200190612b159291906136d9565b5050565b6000612b2c846000018460001b84612f24565b60001c90509392505050565b6000612b4682600001612fb5565b9050919050565b612b588484846128a2565b612b6484848484612fc6565b612ba3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b9a90614bb7565b60405180910390fd5b50505050565b60606000821415612bf1576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612ceb565b600082905060005b60008214612c1b578080600101915050600a8281612c1357fe5b049150612bf9565b60608167ffffffffffffffff81118015612c3457600080fd5b506040519080825280601f01601f191660200182016040528015612c675781602001600182028036833780820191505090505b50905060006001830390508593505b60008414612ce357600a8481612c8857fe5b0660300160f81b82828060019003935081518110612ca257fe5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8481612cdb57fe5b049350612c76565b819450505050505b919050565b600082821115612d35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d2c90614c97565b60405180910390fd5b818303905092915050565b6000612d52836000018360001b61312a565b905092915050565b612d64838361314d565b612d716000848484612fc6565b612db0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612da790614bb7565b60405180910390fd5b505050565b600081600001805490509050919050565b505050565b6000612ddd836000018360001b6132db565b905092915050565b6000612df7836000018360001b6133c3565b905092915050565b6000612e2b846000018460001b8473ffffffffffffffffffffffffffffffffffffffff1660001b613433565b90509392505050565b600081836000018054905011612e7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e7690614b77565b60405180910390fd5b826000018281548110612e8e57fe5b9060005260206000200154905092915050565b60008082846000018054905011612eed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ee490614d77565b60405180910390fd5b6000846000018481548110612efe57fe5b906000526020600020906002020190508060000154816001015492509250509250929050565b60008084600101600085815260200190815260200160002054905060008114158390612f86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f7d9190614b33565b60405180910390fd5b50846000016001820381548110612f9957fe5b9060005260206000209060020201600101549150509392505050565b600081600001805490509050919050565b6000612fe78473ffffffffffffffffffffffffffffffffffffffff1661350f565b612ff45760019050613122565b60606130bb63150b7a0260e01b61300961260b565b88878760405160240161301f9493929190614a4a565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405180606001604052806032815260200161527f603291398773ffffffffffffffffffffffffffffffffffffffff166135229092919063ffffffff16565b90506000818060200190518101906130d39190613a95565b905063150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614925050505b949350505050565b600080836001016000848152602001908152602001600020541415905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156131bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131b490614d97565b60405180910390fd5b6131c6816125ee565b15613206576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131fd90614bf7565b60405180910390fd5b61321260008383612dc6565b61326381600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020612de590919063ffffffff16565b5061327a81836002612dff9092919063ffffffff16565b50808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b600080836001016000848152602001908152602001600020549050600081146133b7576000600182039050600060018660000180549050039050600086600001828154811061332657fe5b906000526020600020015490508087600001848154811061334357fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061337b57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506133bd565b60009150505b92915050565b60006133cf838361353a565b61342857826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061342d565b600090505b92915050565b60008084600101600085815260200190815260200160002054905060008114156134da57846000016040518060400160405280868152602001858152509080600181540180825580915050600190039060005260206000209060020201600090919091909150600082015181600001556020820151816001015550508460000180549050856001016000868152602001908152602001600020819055506001915050613508565b828560000160018303815481106134ed57fe5b90600052602060002090600202016001018190555060009150505b9392505050565b600080823b905060008111915050919050565b6060613531848460008561355d565b90509392505050565b600080836001016000848152602001908152602001600020541415905092915050565b6060824710156135a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161359990614cb7565b60405180910390fd5b6135ab8561350f565b6135ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016135e190614ed7565b60405180910390fd5b600060608673ffffffffffffffffffffffffffffffffffffffff16858760405161361491906149dd565b60006040518083038185875af1925050503d8060008114613651576040519150601f19603f3d011682016040523d82523d6000602084013e613656565b606091505b5091509150613666828286613672565b92505050949350505050565b60608315613682578290506136d2565b6000835111156136955782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136c99190614b33565b60405180910390fd5b9392505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061371a57805160ff1916838001178555613748565b82800160010185558215613748579182015b8281111561374757825182559160200191906001019061372c565b5b5090506137559190613759565b5090565b5b8082111561377257600081600090555060010161375a565b5090565b6000813590506137858161520b565b92915050565b60008135905061379a81615222565b92915050565b6000815190506137af81615239565b92915050565b6000813590506137c481615250565b92915050565b6000815190506137d981615250565b92915050565b600082601f8301126137f057600080fd5b81356138036137fe82614f9f565b614f72565b9150808252602083016020830185838301111561381f57600080fd5b61382a8382846151b8565b50505092915050565b600082601f83011261384457600080fd5b813561385761385282614fcb565b614f72565b9150808252602083016020830185838301111561387357600080fd5b61387e8382846151b8565b50505092915050565b60008135905061389681615267565b92915050565b6000602082840312156138ae57600080fd5b60006138bc84828501613776565b91505092915050565b600080604083850312156138d857600080fd5b60006138e685828601613776565b92505060206138f785828601613776565b9150509250929050565b60008060006060848603121561391657600080fd5b600061392486828701613776565b935050602061393586828701613776565b925050604061394686828701613887565b9150509250925092565b6000806000806080858703121561396657600080fd5b600061397487828801613776565b945050602061398587828801613776565b935050604061399687828801613887565b925050606085013567ffffffffffffffff8111156139b357600080fd5b6139bf878288016137df565b91505092959194509250565b600080604083850312156139de57600080fd5b60006139ec85828601613776565b92505060206139fd8582860161378b565b9150509250929050565b60008060408385031215613a1a57600080fd5b6000613a2885828601613776565b9250506020613a3985828601613887565b9150509250929050565b600060208284031215613a5557600080fd5b6000613a63848285016137a0565b91505092915050565b600060208284031215613a7e57600080fd5b6000613a8c848285016137b5565b91505092915050565b600060208284031215613aa757600080fd5b6000613ab5848285016137ca565b91505092915050565b600060208284031215613ad057600080fd5b600082013567ffffffffffffffff811115613aea57600080fd5b613af684828501613833565b91505092915050565b600060208284031215613b1157600080fd5b6000613b1f84828501613887565b91505092915050565b60008060408385031215613b3b57600080fd5b6000613b4985828601613887565b925050602083013567ffffffffffffffff811115613b6657600080fd5b613b7285828601613833565b9150509250929050565b6000613b888383613daf565b905092915050565b6000613b9c83836149bf565b60208301905092915050565b613bb181615182565b82525050565b613bc081615104565b82525050565b613bcf816150f2565b82525050565b6000613be082615041565b613bea8185615087565b935083602082028501613bfc85614ff7565b8060005b85811015613c385784840389528151613c198582613b7c565b9450613c248361506d565b925060208a01995050600181019050613c00565b50829750879550505050505092915050565b6000613c558261504c565b613c5f8185615098565b9350613c6a83615007565b8060005b83811015613c9b578151613c828882613b90565b9750613c8d8361507a565b925050600181019050613c6e565b5085935050505092915050565b613cb181615116565b82525050565b6000613cc282615057565b613ccc81856150a9565b9350613cdc8185602086016151c7565b613ce5816151fa565b840191505092915050565b6000613cfb82615057565b613d0581856150ba565b9350613d158185602086016151c7565b80840191505092915050565b600081546001811660008114613d3e5760018114613d6357613da7565b607f6002830416613d4f81876150ba565b955060ff1983168652808601935050613da7565b60028204613d7181876150ba565b9550613d7c85615017565b60005b82811015613d9e57815481890152600182019150602081019050613d7f565b82880195505050505b505092915050565b6000613dba82615062565b613dc481856150c5565b9350613dd48185602086016151c7565b613ddd816151fa565b840191505092915050565b6000613df382615062565b613dfd81856150d6565b9350613e0d8185602086016151c7565b613e16816151fa565b840191505092915050565b6000613e2c82615062565b613e3681856150e7565b9350613e468185602086016151c7565b80840191505092915050565b600081546001811660008114613e6f5760018114613e9557613ed9565b607f6002830416613e8081876150d6565b955060ff198316865260208601935050613ed9565b60028204613ea381876150d6565b9550613eae8561502c565b60005b82811015613ed057815481890152600182019150602081019050613eb1565b80880195505050505b505092915050565b6000613eee6022836150d6565b91507f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613f546024836150d6565b91507f4e6f7420656e6f7567682072657365727665206c65667420666f72207468652060008301527f7465616d000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613fba6032836150d6565b91507f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008301527f63656976657220696d706c656d656e74657200000000000000000000000000006020830152604082019050919050565b60006140206026836150d6565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614086601c836150d6565b91507f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006000830152602082019050919050565b60006140c6601b836150d6565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006141066024836150d6565b91507f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061416c6019836150d6565b91507f4552433732313a20617070726f766520746f2063616c6c6572000000000000006000830152602082019050919050565b60006141ac6024836150d6565b91507f53616c65206d7573742062652061637469766520746f206d696e74206a6f696e60008301527f742e2e2e000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614212601e836150d6565b91507f536166654d6174683a207375627472616374696f6e206f766572666c6f7700006000830152602082019050919050565b60006142526026836150d6565b91507f416464726573733a20696e73756666696369656e742062616c616e636520666f60008301527f722063616c6c00000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006142b8602c836150d6565b91507f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b600061431e601c836150d6565b91507f43686f6f73652061206a6f696e742077697468696e2072616e676521000000006000830152602082019050919050565b600061435e6038836150d6565b91507f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008301527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006020830152604082019050919050565b60006143c4602a836150d6565b91507f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008301527f726f2061646472657373000000000000000000000000000000000000000000006020830152604082019050919050565b600061442a602a836150d6565b91507f4e6f7420656e6f75676820746f6b656e7320617661696c61626c6520666f722060008301527f6d696e74696e672e2e2e000000000000000000000000000000000000000000006020830152604082019050919050565b60006144906022836150d6565b91507f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e60008301527f64730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006144f66020836150d6565b91507f4552433732313a206d696e7420746f20746865207a65726f20616464726573736000830152602082019050919050565b60006145366021836150d6565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061459c602c836150d6565b91507f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008301527f697374656e7420746f6b656e00000000000000000000000000000000000000006020830152604082019050919050565b60006146026020836150d6565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b60006146426029836150d6565b91507f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008301527f73206e6f74206f776e00000000000000000000000000000000000000000000006020830152604082019050919050565b60006146a8602f836150d6565b91507f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008301527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006020830152604082019050919050565b600061470e6022836150d6565b91507f43616e206f6e6c79206d696e7420313020746f6b656e7320617420612074696d60008301527f65210000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006147746021836150d6565b91507f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008301527f72000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006147da601c836150d6565b91507f43686f6f73652061206a6f696e742077697468696e2072616e67652e000000006000830152602082019050919050565b600061481a6031836150d6565b91507f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008301527f776e6572206e6f7220617070726f7665640000000000000000000000000000006020830152604082019050919050565b6000614880601d836150d6565b91507f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006000830152602082019050919050565b60006148c06021836150d6565b91507f45746865722076616c75652073656e74206973206e6f7420656e6f7567682e2e60008301527f2e000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006149266017836150d6565b91507f4c6963656e736520616c7265616479206c6f636b6564210000000000000000006000830152602082019050919050565b60006149666028836150d6565b91507f4865792c20796f75722077616c6c657420646f65736e2774206f776e2074686960008301527f73206a6f696e74210000000000000000000000000000000000000000000000006020830152604082019050919050565b6149c881615178565b82525050565b6149d781615178565b82525050565b60006149e98284613cf0565b915081905092915050565b6000614a008284613d21565b915081905092915050565b6000614a178285613e21565b9150614a238284613e21565b91508190509392505050565b6000602082019050614a446000830184613bc6565b92915050565b6000608082019050614a5f6000830187613bb7565b614a6c6020830186613bc6565b614a7960408301856149ce565b8181036060830152614a8b8184613cb7565b905095945050505050565b6000606082019050614aab6000830186613ba8565b614ab860208301856149ce565b8181036040830152614aca8184613de8565b9050949350505050565b60006020820190508181036000830152614aee8184613bd5565b905092915050565b60006020820190508181036000830152614b108184613c4a565b905092915050565b6000602082019050614b2d6000830184613ca8565b92915050565b60006020820190508181036000830152614b4d8184613de8565b905092915050565b60006020820190508181036000830152614b6f8184613e52565b905092915050565b60006020820190508181036000830152614b9081613ee1565b9050919050565b60006020820190508181036000830152614bb081613f47565b9050919050565b60006020820190508181036000830152614bd081613fad565b9050919050565b60006020820190508181036000830152614bf081614013565b9050919050565b60006020820190508181036000830152614c1081614079565b9050919050565b60006020820190508181036000830152614c30816140b9565b9050919050565b60006020820190508181036000830152614c50816140f9565b9050919050565b60006020820190508181036000830152614c708161415f565b9050919050565b60006020820190508181036000830152614c908161419f565b9050919050565b60006020820190508181036000830152614cb081614205565b9050919050565b60006020820190508181036000830152614cd081614245565b9050919050565b60006020820190508181036000830152614cf0816142ab565b9050919050565b60006020820190508181036000830152614d1081614311565b9050919050565b60006020820190508181036000830152614d3081614351565b9050919050565b60006020820190508181036000830152614d50816143b7565b9050919050565b60006020820190508181036000830152614d708161441d565b9050919050565b60006020820190508181036000830152614d9081614483565b9050919050565b60006020820190508181036000830152614db0816144e9565b9050919050565b60006020820190508181036000830152614dd081614529565b9050919050565b60006020820190508181036000830152614df08161458f565b9050919050565b60006020820190508181036000830152614e10816145f5565b9050919050565b60006020820190508181036000830152614e3081614635565b9050919050565b60006020820190508181036000830152614e508161469b565b9050919050565b60006020820190508181036000830152614e7081614701565b9050919050565b60006020820190508181036000830152614e9081614767565b9050919050565b60006020820190508181036000830152614eb0816147cd565b9050919050565b60006020820190508181036000830152614ed08161480d565b9050919050565b60006020820190508181036000830152614ef081614873565b9050919050565b60006020820190508181036000830152614f10816148b3565b9050919050565b60006020820190508181036000830152614f3081614919565b9050919050565b60006020820190508181036000830152614f5081614959565b9050919050565b6000602082019050614f6c60008301846149ce565b92915050565b6000604051905081810181811067ffffffffffffffff82111715614f9557600080fd5b8060405250919050565b600067ffffffffffffffff821115614fb657600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff821115614fe257600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006150fd82615158565b9050919050565b600061510f82615158565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600061518d82615194565b9050919050565b600061519f826151a6565b9050919050565b60006151b182615158565b9050919050565b82818337600083830152505050565b60005b838110156151e55780820151818401526020810190506151ca565b838111156151f4576000848401525b50505050565b6000601f19601f8301169050919050565b615214816150f2565b811461521f57600080fd5b50565b61522b81615116565b811461523657600080fd5b50565b61524281615122565b811461524d57600080fd5b50565b6152598161512c565b811461526457600080fd5b50565b61527081615178565b811461527b57600080fd5b5056fe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e7465724552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea264697066735822122039f06b0ccf9d4f0fee65e3a578992573b0702cedeebb496cfc92043eb931281964736f6c634300060c0033
Verified Source Code Partial Match
Compiler: v0.6.12+commit.27d51765
EVM: istanbul
Optimization: No
HighClub.sol 2011 lines
// SPDX-License-Identifier: MIT
// GO TO LINE 1885 TO SEE WHERE THE BANANA CONTRACT STARTS
// File: @openzeppelin/contracts/utils/Context.sol
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with 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.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual 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/introspection/IERC165.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Metadata.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Enumerable.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4);
}
// File: @openzeppelin/contracts/introspection/ERC165.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts may inherit from this and call {_registerInterface} to declare
* their support of an interface.
*/
abstract 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) public view virtual override 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 virtual {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity >=0.6.0 <0.8.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, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @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) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @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) {
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, reverting 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) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting 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) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* 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, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
pragma solidity >=0.6.2 <0.8.0;
/**
* @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) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(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 {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/utils/EnumerableSet.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {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];
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
// File: @openzeppelin/contracts/utils/EnumerableMap.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Library for managing an enumerable variant of Solidity's
* https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
* type.
*
* Maps have the following properties:
*
* - Entries are added, removed, and checked for existence in constant time
* (O(1)).
* - Entries are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableMap for EnumerableMap.UintToAddressMap;
*
* // Declare a set state variable
* EnumerableMap.UintToAddressMap private myMap;
* }
* ```
*
* As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
* supported.
*/
library EnumerableMap {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Map type with
// bytes32 keys and values.
// The Map implementation uses private functions, and user-facing
// implementations (such as Uint256ToAddressMap) are just wrappers around
// the underlying Map.
// This means that we can only create new EnumerableMaps for types that fit
// in bytes32.
struct MapEntry {
bytes32 _key;
bytes32 _value;
}
struct Map {
// Storage of map keys and values
MapEntry[] _entries;
// Position of the entry defined by a key in the `entries` array, plus 1
// because index 0 means a key is not in the map.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function _set(Map storage map, bytes32 key, bytes32 value) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) { // Equivalent to !contains(map, key)
map._entries.push(MapEntry({ _key: key, _value: value }));
// The entry is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
map._indexes[key] = map._entries.length;
return true;
} else {
map._entries[keyIndex - 1]._value = value;
return false;
}
}
/**
* @dev Removes a key-value pair from a map. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function _remove(Map storage map, bytes32 key) private returns (bool) {
// We read and store the key's index to prevent multiple reads from the same storage slot
uint256 keyIndex = map._indexes[key];
if (keyIndex != 0) { // Equivalent to contains(map, key)
// To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
// in the array, and then remove the last entry (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = keyIndex - 1;
uint256 lastIndex = map._entries.length - 1;
// When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
MapEntry storage lastEntry = map._entries[lastIndex];
// Move the last entry to the index where the entry to delete is
map._entries[toDeleteIndex] = lastEntry;
// Update the index for the moved entry
map._indexes[lastEntry._key] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved entry was stored
map._entries.pop();
// Delete the index for the deleted slot
delete map._indexes[key];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function _contains(Map storage map, bytes32 key) private view returns (bool) {
return map._indexes[key] != 0;
}
/**
* @dev Returns the number of key-value pairs in the map. O(1).
*/
function _length(Map storage map) private view returns (uint256) {
return map._entries.length;
}
/**
* @dev Returns the key-value pair stored at position `index` in the map. O(1).
*
* Note that there are no guarantees on the ordering of entries inside the
* array, and it may change when more entries are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {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);
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*/
function _tryGet(Map storage map, bytes32 key) private view returns (bool, bytes32) {
uint256 keyIndex = map._indexes[key];
if (keyIndex == 0) return (false, 0); // Equivalent to contains(map, key)
return (true, map._entries[keyIndex - 1]._value); // All indexes are 1-based
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function _get(Map storage map, bytes32 key) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, "EnumerableMap: nonexistent key"); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
/**
* @dev Same as {_get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {_tryGet}.
*/
function _get(Map storage map, bytes32 key, string memory errorMessage) private view returns (bytes32) {
uint256 keyIndex = map._indexes[key];
require(keyIndex != 0, errorMessage); // Equivalent to contains(map, key)
return map._entries[keyIndex - 1]._value; // All indexes are 1-based
}
// UintToAddressMap
struct UintToAddressMap {
Map _inner;
}
/**
* @dev Adds a key-value pair to a map, or updates the value for an existing
* key. O(1).
*
* Returns true if the key was added to the map, that is if it was not
* already present.
*/
function set(UintToAddressMap storage map, uint256 key, address value) internal returns (bool) {
return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the key was removed from the map, that is if it was present.
*/
function remove(UintToAddressMap storage map, uint256 key) internal returns (bool) {
return _remove(map._inner, bytes32(key));
}
/**
* @dev Returns true if the key is in the map. O(1).
*/
function contains(UintToAddressMap storage map, uint256 key) internal view returns (bool) {
return _contains(map._inner, bytes32(key));
}
/**
* @dev Returns the number of elements in the map. O(1).
*/
function length(UintToAddressMap storage map) internal view returns (uint256) {
return _length(map._inner);
}
/**
* @dev Returns the element stored at position `index` in the set. O(1).
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintToAddressMap storage map, uint256 index) internal view returns (uint256, address) {
(bytes32 key, bytes32 value) = _at(map._inner, index);
return (uint256(key), address(uint160(uint256(value))));
}
/**
* @dev Tries to returns the value associated with `key`. O(1).
* Does not revert if `key` is not in the map.
*
* _Available since v3.4._
*/
function tryGet(UintToAddressMap storage map, uint256 key) internal view returns (bool, address) {
(bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
return (success, address(uint160(uint256(value))));
}
/**
* @dev Returns the value associated with `key`. O(1).
*
* Requirements:
*
* - `key` must be in the map.
*/
function get(UintToAddressMap storage map, uint256 key) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key)))));
}
/**
* @dev Same as {get}, with a custom error message when `key` is not in the map.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryGet}.
*/
function get(UintToAddressMap storage map, uint256 key, string memory errorMessage) internal view returns (address) {
return address(uint160(uint256(_get(map._inner, bytes32(key), errorMessage))));
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev String operations.
*/
library Strings {
/**
* @dev Converts a `uint256` to its ASCII `string` representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
uint256 index = digits - 1;
temp = value;
while (temp != 0) {
buffer[index--] = bytes1(uint8(48 + temp % 10));
temp /= 10;
}
return string(buffer);
}
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
pragma solidity >=0.6.0 <0.8.0;
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 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;
// 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 holder address to their (enumerable) set of owned tokens
mapping (address => EnumerableSet.UintSet) private _holderTokens;
// Enumerable mapping from token ids to their owners
EnumerableMap.UintToAddressMap private _tokenOwners;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Optional mapping for token URIs
mapping (uint256 => string) private _tokenURIs;
// Base URI
string private _baseURI;
/*
* 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 ^ 0xe985e9c5 ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*
* => 0x06fdde03 ^ 0x95d89b41...
// [truncated — 71319 bytes total]
Read Contract
JOINT_PROVENANCE 0xf5da3865 → string
LICENSE_TEXT 0x9c3e72bd → string
MAX_JOINTS 0x892aae4f → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
jointNames 0x4c3d2205 → string
jointNamesOfOwner 0x1f03396f → string[]
jointPrice 0x00894816 → uint256
jointReserve 0x20cdf027 → uint256
maxJointPurchase 0xe0c0c077 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
saleIsActive 0xeb8d2444 → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenLicense 0xd9b137b2 → string
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256
viewJointName 0x3d524a7f → string
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
changeJointName 0x5d44ae28
uint256 _tokenId
string _name
changeLicense 0xb09904b5
string _license
flipSaleState 0x34918dfd
No parameters
lockLicense 0xbf4702fc
No parameters
mintJoint 0x141f3de2
uint256 _numberOfTokens
renounceOwnership 0x715018a6
No parameters
reserverJoints 0xfc2eb74a
address _to
uint256 _reserveAmount
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
setProvenanceHash 0x10969523
string _provenanceHash
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address