Address Contract Verified
Address
0xcEa277Cf0a74eFb55811e9190Fe0a813C74751AD
Balance
0 ETH
Nonce
1
Code Size
24069 bytes
Creator
0x2F4F9216...8282 at tx 0x07dcc074...03913b
Indexed Transactions
0 (1 on-chain, 1.2% indexed)
Contract Bytecode
24069 bytes
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063931688cb11610125578063b8e0bdf9116100ad578063d547741f1161007c578063d547741f14610645578063e5ef873d14610661578063e985e9c51461067d578063eb4e7326146106ad578063f8b16cfb146106c957610211565b8063b8e0bdf9146105c1578063c518e1bd146105dd578063c87b56dd146105f9578063cc8c241a1461062957610211565b8063a304970c116100f4578063a304970c1461050b578063a4650a1414610529578063aa11f84814610545578063b21fd34e14610575578063b88d4fde146105a557610211565b8063931688cb1461049757806395d89b41146104b3578063a217fddf146104d1578063a22cb465146104ef57610211565b806336568abe116101a85780636352211e116101775780636352211e146103cd57806363c371bd146103fd57806370a082311461042d5780638129fc1c1461045d57806391d148541461046757610211565b806336568abe1461034957806342842e0e146103655780634e429f131461038157806359ea929f1461039d57610211565b806323b872dd116101e457806323b872dd146102b0578063248a9ca3146102cc5780632a55205a146102fc5780632f2ff15d1461032d57610211565b806301ffc9a71461021657806306fdde0314610246578063081812fc14610264578063095ea7b314610294575b600080fd5b610230600480360381019061022b9190613ea6565b6106e5565b60405161023d9190613eee565b60405180910390f35b61024e610897565b60405161025b9190613fa2565b60405180910390f35b61027e60048036038101906102799190613ffa565b610929565b60405161028b9190614068565b60405180910390f35b6102ae60048036038101906102a991906140af565b6109ae565b005b6102ca60048036038101906102c591906140ef565b610ac5565b005b6102e660048036038101906102e19190614178565b610b25565b6040516102f391906141b4565b60405180910390f35b610316600480360381019061031191906141cf565b610b45565b60405161032492919061421e565b60405180910390f35b61034760048036038101906103429190614247565b610d2f565b005b610363600480360381019061035e9190614247565b610d50565b005b61037f600480360381019061037a91906140ef565b610dd3565b005b61039b600480360381019061039691906142b3565b610df3565b005b6103b760048036038101906103b291906142e0565b610e21565b6040516103c49190613eee565b60405180910390f35b6103e760048036038101906103e29190613ffa565b610e41565b6040516103f49190614068565b60405180910390f35b610417600480360381019061041291906142e0565b610ef2565b6040516104249190613eee565b60405180910390f35b610447600480360381019061044291906142e0565b610f13565b604051610454919061430d565b60405180910390f35b610465610fca565b005b610481600480360381019061047c9190614247565b6112bd565b60405161048e9190613eee565b60405180910390f35b6104b160048036038101906104ac919061438d565b611328565b005b6104bb61134f565b6040516104c89190613fa2565b60405180910390f35b6104d96113e1565b6040516104e691906141b4565b60405180910390f35b610509600480360381019061050491906143da565b6113e8565b005b6105136113fe565b60405161052091906145f8565b60405180910390f35b610543600480360381019061053e91906142b3565b6116dd565b005b61055f600480360381019061055a91906142e0565b61170b565b60405161056c9190613eee565b60405180910390f35b61058f600480360381019061058a91906142e0565b61172b565b60405161059c9190613eee565b60405180910390f35b6105bf60048036038101906105ba919061474a565b61174c565b005b6105db60048036038101906105d691906147f9565b6117ae565b005b6105f760048036038101906105f29190614839565b6117ea565b005b610613600480360381019061060e9190613ffa565b61181b565b6040516106209190613fa2565b60405180910390f35b610643600480360381019061063e91906142e0565b61190e565b005b61065f600480360381019061065a9190614247565b611963565b005b61067b6004803603810190610676919061438d565b611984565b005b61069760048036038101906106929190614866565b6119ab565b6040516106a49190613eee565b60405180910390f35b6106c760048036038101906106c291906148fc565b611a3f565b005b6106e360048036038101906106de9190614178565b61243e565b005b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806107b057507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061081857507f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061088057507f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610890575061088f82612459565b5b9050919050565b6060606580546108a69061498b565b80601f01602080910402602001604051908101604052809291908181526020018280546108d29061498b565b801561091f5780601f106108f45761010080835404028352916020019161091f565b820191906000526020600020905b81548152906001019060200180831161090257829003601f168201915b5050505050905090565b6000610934826124d3565b610973576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096a90614a2e565b60405180910390fd5b6069600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006109b982610e41565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090614ac0565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610a4861253f565b73ffffffffffffffffffffffffffffffffffffffff161480610a775750610a7681610a7161253f565b6119ab565b5b610ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aad90614b52565b60405180910390fd5b610ac08383612547565b505050565b610ad6610ad061253f565b82612600565b610b15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0c90614be4565b60405180910390fd5b610b208383836126de565b505050565b600060c96000838152602001908152602001600020600101549050919050565b6000806000609860008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610cda5760976040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610ce4612944565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610d109190614c33565b610d1a9190614cbc565b90508160000151819350935050509250929050565b610d3882610b25565b610d418161294e565b610d4b8383612962565b505050565b610d5861253f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610dc5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dbc90614d5f565b60405180910390fd5b610dcf8282612a43565b5050565b610dee8383836040518060200160405280600081525061174c565b505050565b6000801b610e008161294e565b8160fd60000160006101000a81548160ff0219169083151502179055505050565b60fb6020528060005260406000206000915054906101000a900460ff1681565b6000806067600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ee9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee090614df1565b60405180910390fd5b80915050919050565b6101036020528060005260406000206000915054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7a90614e83565b60405180910390fd5b606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610fd66001612b25565b90508015610ffa576001600060016101000a81548160ff0219169083151502179055505b61106e6040518060400160405280600c81526020017f42617365642047686f756c7300000000000000000000000000000000000000008152506040518060400160405280600481526020017f47484c5300000000000000000000000000000000000000000000000000000000815250612c15565b611a0a60fd60000160036101000a81548161ffff021916908361ffff1602179055506109e160fd60000160096101000a81548161ffff021916908361ffff160217905550604051806060016040528060278152602001615d6b6027913960fd60010190805190602001906110e3929190613c5b565b506040518060600160405280603e8152602001615d92603e913960fd6002019080519060200190611115929190613c5b565b507f45b023b371a3c483c2f511b6647ab965a580f4f2eaa3f9240a74c50bd9af779f60001b60fd600301819055507f0b2bcd41b8945cfd9ffe48a11ad38426bb2146bc95f2f2d35087037166f8cfec60001b60fd60040181905550600160fd600001600b6101000a81548161ffff021916908361ffff160217905550611a0a60fd600001600d6101000a81548161ffff021916908361ffff160217905550604260fd600001600f6101000a81548161ffff021916908361ffff160217905550600060fd60000160006101000a81548160ff021916908315150217905550600060fd60000160016101000a81548161ffff021916908361ffff16021790555061123373475dcaa08a69fa462790f42db4d3bba1563cb4746102b2612c72565b6112406000801b33612e07565b6112616000801b7398ccf605c43a0bf9d6795c3cf3b5fed836330511610d2f565b80156112ba5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516112b19190614ef5565b60405180910390a15b50565b600060c9600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b6113358161294e565b828260fd6001019190611349929190613ce1565b50505050565b60606066805461135e9061498b565b80601f016020809104026020016040519081016040528092919081815260200182805461138a9061498b565b80156113d75780601f106113ac576101008083540402835291602001916113d7565b820191906000526020600020905b8154815290600101906020018083116113ba57829003601f168201915b5050505050905090565b6000801b81565b6113fa6113f361253f565b8383612e15565b5050565b611406613d67565b60fd604051806101e00160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900461ffff1661ffff1661ffff1681526020016000820160039054906101000a900461ffff1661ffff1661ffff1681526020016000820160059054906101000a900461ffff1661ffff1661ffff1681526020016000820160079054906101000a900461ffff1661ffff1661ffff1681526020016000820160099054906101000a900461ffff1661ffff1661ffff16815260200160008201600b9054906101000a900461ffff1661ffff1661ffff16815260200160008201600d9054906101000a900461ffff1661ffff1661ffff16815260200160008201600f9054906101000a900461ffff1661ffff1661ffff16815260200160018201805461153f9061498b565b80601f016020809104026020016040519081016040528092919081815260200182805461156b9061498b565b80156115b85780601f1061158d576101008083540402835291602001916115b8565b820191906000526020600020905b81548152906001019060200180831161159b57829003601f168201915b505050505081526020016002820180546115d19061498b565b80601f01602080910402602001604051908101604052809291908181526020018280546115fd9061498b565b801561164a5780601f1061161f5761010080835404028352916020019161164a565b820191906000526020600020905b81548152906001019060200180831161162d57829003601f168201915b5050505050815260200160038201548152602001600482015481526020016005820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016005820160149054906101000a900460ff161515151581525050905090565b6000801b6116ea8161294e565b8160fd60050160146101000a81548160ff0219169083151502179055505050565b60fc6020528060005260406000206000915054906101000a900460ff1681565b6101046020528060005260406000206000915054906101000a900460ff1681565b61175d61175761253f565b83612600565b61179c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161179390614be4565b60405180910390fd5b6117a884848484612f81565b50505050565b6000801b6117bb8161294e565b8260fd600401819055508160fd60000160096101000a81548161ffff021916908361ffff160217905550505050565b6000801b6117f78161294e565b8160fd600001600b6101000a81548161ffff021916908361ffff1602179055505050565b606060fd600001600b9054906101000a900461ffff1661ffff1682106118d05760fd600201805461184b9061498b565b80601f01602080910402602001604051908101604052809291908181526020018280546118779061498b565b80156118c45780601f10611899576101008083540402835291602001916118c4565b820191906000526020600020905b8154815290600101906020018083116118a757829003601f168201915b50505050509050611909565b60fd6001016118e66118e184612fdd565b613085565b6040516020016118f792919061502c565b60405160208183030381529060405290505b919050565b6000801b61191b8161294e565b8160fd60050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b61196c82610b25565b6119758161294e565b61197f8383612a43565b505050565b6000801b6119918161294e565b828260fd60020191906119a5929190613ce1565b50505050565b6000606a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60fd60000160009054906101000a900460ff16611a91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a88906150a7565b60405180910390fd5b60fd60000160039054906101000a900461ffff1661ffff1660fd60000160019054906101000a900461ffff1661ffff161115611b02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af990615113565b60405180910390fd5b60003390503373ffffffffffffffffffffffffffffffffffffffff163273ffffffffffffffffffffffffffffffffffffffff1614611b75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6c9061517f565b60405180910390fd5b8115611efe5761010460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c00906151eb565b60405180910390fd5b60fd60000160099054906101000a900461ffff1661ffff16600360fd60000160079054906101000a900461ffff16611c41919061520b565b61ffff161115611c86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7d9061528f565b60405180910390fd5b600081604051602001611c9991906152f7565b6040516020818303038152906040528051906020012090506000611d04868680806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505060fd60040154846131e5565b905080611d46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d3d9061535e565b60405180910390fd5b600161010460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600161010360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600360fd60000160019054906101000a900461ffff16611e18919061520b565b60fd60000160016101000a81548161ffff021916908361ffff160217905550600360fd60000160078282829054906101000a900461ffff16611e5a919061520b565b92506101000a81548161ffff021916908361ffff160217905550611ea183600360fd60000160019054906101000a900461ffff16611e98919061537e565b61ffff166131fc565b611ece83600260fd60000160019054906101000a900461ffff16611ec5919061537e565b61ffff166131fc565b611efb83600160fd60000160019054906101000a900461ffff16611ef2919061537e565b61ffff166131fc565b50505b60fd60050160149054906101000a900460ff16158015611f1c575081155b1561220f5761010360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611faf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fa6906151eb565b60405180910390fd5b60fd60000160039054906101000a900461ffff1661ffff1660fd60000160099054906101000a900461ffff16600160fd60000160059054906101000a900461ffff16611ffb919061520b565b612005919061520b565b61ffff16111561204a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120419061528f565b60405180910390fd5b60008160405160200161205d91906152f7565b60405160208183030381529060405280519060200120905060006120c8868680806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505060fd60030154846131e5565b90508061210a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121019061535e565b60405180910390fd5b600161010360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160fd60000160019054906101000a900461ffff16612183919061520b565b60fd60000160016101000a81548161ffff021916908361ffff160217905550600160fd60000160058282829054906101000a900461ffff166121c5919061520b565b92506101000a81548161ffff021916908361ffff16021790555061220c83600160fd60000160019054906101000a900461ffff16612203919061537e565b61ffff166131fc565b50505b60fd60050160149054906101000a900460ff161561236c5760fd60000160039054906101000a900461ffff1661ffff1660fd60000160099054906101000a900461ffff16600160fd60000160059054906101000a900461ffff16612273919061520b565b61227d919061520b565b61ffff1611156122c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b99061528f565b60405180910390fd5b600160fd60000160058282829054906101000a900461ffff166122e5919061520b565b92506101000a81548161ffff021916908361ffff160217905550600160fd60000160019054906101000a900461ffff1661231f919061520b565b60fd60000160016101000a81548161ffff021916908361ffff16021790555061236b81600160fd60000160019054906101000a900461ffff16612362919061537e565b61ffff166131fc565b5b60fd600001600f9054906101000a900461ffff1660fd600001600b9054906101000a900461ffff1661239e919061520b565b61ffff1660fd60000160019054906101000a900461ffff1661ffff16106124385760fd60000160019054906101000a900461ffff1660fd600001600b6101000a81548161ffff021916908361ffff16021790555061240e60fd60000160019054906101000a900461ffff166133d5565b60006045428161242157612420614c8d565b5b06604543034060001c02905061243681613468565b505b50505050565b6000801b61244b8161294e565b8160fd600301819055505050565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806124cc57506124cb826134fb565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166067600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816069600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166125ba83610e41565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600061260b826124d3565b61264a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161264190615424565b60405180910390fd5b600061265583610e41565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480612697575061269681856119ab565b5b806126d557508373ffffffffffffffffffffffffffffffffffffffff166126bd84610929565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166126fe82610e41565b73ffffffffffffffffffffffffffffffffffffffff1614612754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161274b906154b6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036127c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127ba90615548565b60405180910390fd5b6127ce838383613575565b6127d9600082612547565b6001606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546128299190615568565b925050819055506001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612880919061559c565b92505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461293f83838361357a565b505050565b6000612710905090565b61295f8161295a61253f565b61357f565b50565b61296c82826112bd565b612a3f57600160c9600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506129e461253f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b612a4d82826112bd565b15612b2157600060c9600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612ac661253f565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b60008060019054906101000a900460ff1615612b9c5760018260ff16148015612b545750612b523061361c565b155b612b93576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8a90615664565b60405180910390fd5b60009050612c10565b8160ff1660008054906101000a900460ff1660ff1610612bf1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612be890615664565b60405180910390fd5b816000806101000a81548160ff021916908360ff160217905550600190505b919050565b600060019054906101000a900460ff16612c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c5b906156f6565b60405180910390fd5b612c6e828261363f565b5050565b612c7a612944565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff161115612cd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ccf90615788565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612d47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d3e906157f4565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250609760008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b612e118282612962565b5050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e7a90615860565b60405180910390fd5b80606a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051612f749190613eee565b60405180910390a3505050565b612f8c8484846126de565b612f98848484846136c0565b612fd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fce906158f2565b60405180910390fd5b50505050565b600060fd60050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfedd61b836040518263ffffffff1660e01b815260040161303d919061430d565b602060405180830381865afa15801561305a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061307e9190615927565b9050919050565b6060600082036130cc576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506131e0565b600082905060005b600082146130fe5780806130e790615954565b915050600a826130f79190614cbc565b91506130d4565b60008167ffffffffffffffff81111561311a5761311961461f565b5b6040519080825280601f01601f19166020018201604052801561314c5781602001600182028036833780820191505090505b5090505b600085146131d9576001826131659190615568565b9150600a85613174919061599c565b6030613180919061559c565b60f81b818381518110613196576131956159cd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a856131d29190614cbc565b9450613150565b8093505050505b919050565b6000826131f28584613847565b1490509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361326b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326290615a48565b60405180910390fd5b613274816124d3565b156132b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132ab90615ab4565b60405180910390fd5b6132c060008383613575565b6001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613310919061559c565b92505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46133d16000838361357a565b5050565b60fd60050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bd35f093826040518263ffffffff1660e01b81526004016134339190615b05565b600060405180830381600087803b15801561344d57600080fd5b505af1158015613461573d6000803e3d6000fd5b5050505050565b60fd60050160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166344d456c1826040518263ffffffff1660e01b81526004016134c6919061430d565b600060405180830381600087803b1580156134e057600080fd5b505af11580156134f4573d6000803e3d6000fd5b5050505050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061356e575061356d826138bc565b5b9050919050565b505050565b505050565b61358982826112bd565b613618576135ae8173ffffffffffffffffffffffffffffffffffffffff16601461399e565b6135bc8360001c602061399e565b6040516020016135cd929190615bb8565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161360f9190613fa2565b60405180910390fd5b5050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff1661368e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613685906156f6565b60405180910390fd5b81606590805190602001906136a4929190613c5b565b5080606690805190602001906136bb929190613c5b565b505050565b60006136e18473ffffffffffffffffffffffffffffffffffffffff1661361c565b1561383a578373ffffffffffffffffffffffffffffffffffffffff1663150b7a0261370a61253f565b8786866040518563ffffffff1660e01b815260040161372c9493929190615c47565b6020604051808303816000875af192505050801561376857506040513d601f19601f820116820180604052508101906137659190615ca8565b60015b6137ea573d8060008114613798576040519150601f19603f3d011682016040523d82523d6000602084013e61379d565b606091505b5060008151036137e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016137d9906158f2565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161491505061383f565b600190505b949350505050565b60008082905060005b84518110156138b157600085828151811061386e5761386d6159cd565b5b60200260200101519050808311613890576138898382613bda565b925061389d565b61389a8184613bda565b92505b5080806138a990615954565b915050613850565b508091505092915050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061398757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80613997575061399682613bf1565b5b9050919050565b6060600060028360026139b19190614c33565b6139bb919061559c565b67ffffffffffffffff8111156139d4576139d361461f565b5b6040519080825280601f01601f191660200182016040528015613a065781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110613a3e57613a3d6159cd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110613aa257613aa16159cd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002613ae29190614c33565b613aec919061559c565b90505b6001811115613b8c577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110613b2e57613b2d6159cd565b5b1a60f81b828281518110613b4557613b446159cd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080613b8590615cd5565b9050613aef565b5060008414613bd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613bc790615d4a565b60405180910390fd5b8091505092915050565b600082600052816020526040600020905092915050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b828054613c679061498b565b90600052602060002090601f016020900481019282613c895760008555613cd0565b82601f10613ca257805160ff1916838001178555613cd0565b82800160010185558215613cd0579182015b82811115613ccf578251825591602001919060010190613cb4565b5b509050613cdd9190613e1d565b5090565b828054613ced9061498b565b90600052602060002090601f016020900481019282613d0f5760008555613d56565b82601f10613d2857803560ff1916838001178555613d56565b82800160010185558215613d56579182015b82811115613d55578235825591602001919060010190613d3a565b5b509050613d639190613e1d565b5090565b604051806101e00160405280600015158152602001600061ffff168152602001600061ffff168152602001600061ffff168152602001600061ffff168152602001600061ffff168152602001600061ffff168152602001600061ffff168152602001600061ffff16815260200160608152602001606081526020016000801916815260200160008019168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000151581525090565b5b80821115613e36576000816000905550600101613e1e565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613e8381613e4e565b8114613e8e57600080fd5b50565b600081359050613ea081613e7a565b92915050565b600060208284031215613ebc57613ebb613e44565b5b6000613eca84828501613e91565b91505092915050565b60008115159050919050565b613ee881613ed3565b82525050565b6000602082019050613f036000830184613edf565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613f43578082015181840152602081019050613f28565b83811115613f52576000848401525b50505050565b6000601f19601f8301169050919050565b6000613f7482613f09565b613f7e8185613f14565b9350613f8e818560208601613f25565b613f9781613f58565b840191505092915050565b60006020820190508181036000830152613fbc8184613f69565b905092915050565b6000819050919050565b613fd781613fc4565b8114613fe257600080fd5b50565b600081359050613ff481613fce565b92915050565b6000602082840312156140105761400f613e44565b5b600061401e84828501613fe5565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061405282614027565b9050919050565b61406281614047565b82525050565b600060208201905061407d6000830184614059565b92915050565b61408c81614047565b811461409757600080fd5b50565b6000813590506140a981614083565b92915050565b600080604083850312156140c6576140c5613e44565b5b60006140d48582860161409a565b92505060206140e585828601613fe5565b9150509250929050565b60008060006060848603121561410857614107613e44565b5b60006141168682870161409a565b93505060206141278682870161409a565b925050604061413886828701613fe5565b9150509250925092565b6000819050919050565b61415581614142565b811461416057600080fd5b50565b6000813590506141728161414c565b92915050565b60006020828403121561418e5761418d613e44565b5b600061419c84828501614163565b91505092915050565b6141ae81614142565b82525050565b60006020820190506141c960008301846141a5565b92915050565b600080604083850312156141e6576141e5613e44565b5b60006141f485828601613fe5565b925050602061420585828601613fe5565b9150509250929050565b61421881613fc4565b82525050565b60006040820190506142336000830185614059565b614240602083018461420f565b9392505050565b6000806040838503121561425e5761425d613e44565b5b600061426c85828601614163565b925050602061427d8582860161409a565b9150509250929050565b61429081613ed3565b811461429b57600080fd5b50565b6000813590506142ad81614287565b92915050565b6000602082840312156142c9576142c8613e44565b5b60006142d78482850161429e565b91505092915050565b6000602082840312156142f6576142f5613e44565b5b60006143048482850161409a565b91505092915050565b6000602082019050614322600083018461420f565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261434d5761434c614328565b5b8235905067ffffffffffffffff81111561436a5761436961432d565b5b60208301915083600182028301111561438657614385614332565b5b9250929050565b600080602083850312156143a4576143a3613e44565b5b600083013567ffffffffffffffff8111156143c2576143c1613e49565b5b6143ce85828601614337565b92509250509250929050565b600080604083850312156143f1576143f0613e44565b5b60006143ff8582860161409a565b92505060206144108582860161429e565b9150509250929050565b61442381613ed3565b82525050565b600061ffff82169050919050565b61444081614429565b82525050565b600082825260208201905092915050565b600061446282613f09565b61446c8185614446565b935061447c818560208601613f25565b61448581613f58565b840191505092915050565b61449981614142565b82525050565b6144a881614047565b82525050565b60006101e0830160008301516144c7600086018261441a565b5060208301516144da6020860182614437565b5060408301516144ed6040860182614437565b5060608301516145006060860182614437565b5060808301516145136080860182614437565b5060a083015161452660a0860182614437565b5060c083015161453960c0860182614437565b5060e083015161454c60e0860182614437565b50610100830151614561610100860182614437565b5061012083015184820361012086015261457b8282614457565b9150506101408301518482036101408601526145978282614457565b9150506101608301516145ae610160860182614490565b506101808301516145c3610180860182614490565b506101a08301516145d86101a086018261449f565b506101c08301516145ed6101c086018261441a565b508091505092915050565b6000602082019050818103600083015261461281846144ae565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61465782613f58565b810181811067ffffffffffffffff821117156146765761467561461f565b5b80604052505050565b6000614689613e3a565b9050614695828261464e565b919050565b600067ffffffffffffffff8211156146b5576146b461461f565b5b6146be82613f58565b9050602081019050919050565b82818337600083830152505050565b60006146ed6146e88461469a565b61467f565b9050828152602081018484840111156147095761470861461a565b5b6147148482856146cb565b509392505050565b600082601f83011261473157614730614328565b5b81356147418482602086016146da565b91505092915050565b6000806000806080858703121561476457614763613e44565b5b60006147728782880161409a565b94505060206147838782880161409a565b935050604061479487828801613fe5565b925050606085013567ffffffffffffffff8111156147b5576147b4613e49565b5b6147c18782880161471c565b91505092959194509250565b6147d681614429565b81146147e157600080fd5b50565b6000813590506147f3816147cd565b92915050565b600080604083850312156148105761480f613e44565b5b600061481e85828601614163565b925050602061482f858286016147e4565b9150509250929050565b60006020828403121561484f5761484e613e44565b5b600061485d848285016147e4565b91505092915050565b6000806040838503121561487d5761487c613e44565b5b600061488b8582860161409a565b925050602061489c8582860161409a565b9150509250929050565b60008083601f8401126148bc576148bb614328565b5b8235905067ffffffffffffffff8111156148d9576148d861432d565b5b6020830191508360208202830111156148f5576148f4614332565b5b9250929050565b60008060006040848603121561491557614914613e44565b5b600084013567ffffffffffffffff81111561493357614932613e49565b5b61493f868287016148a6565b935093505060206149528682870161429e565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806149a357607f821691505b6020821081036149b6576149b561495c565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614a18602c83613f14565b9150614a23826149bc565b604082019050919050565b60006020820190508181036000830152614a4781614a0b565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000614aaa602183613f14565b9150614ab582614a4e565b604082019050919050565b60006020820190508181036000830152614ad981614a9d565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b6000614b3c603883613f14565b9150614b4782614ae0565b604082019050919050565b60006020820190508181036000830152614b6b81614b2f565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b6000614bce603183613f14565b9150614bd982614b72565b604082019050919050565b60006020820190508181036000830152614bfd81614bc1565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614c3e82613fc4565b9150614c4983613fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615614c8257614c81614c04565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614cc782613fc4565b9150614cd283613fc4565b925082614ce257614ce1614c8d565b5b828204905092915050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000614d49602f83613f14565b9150614d5482614ced565b604082019050919050565b60006020820190508181036000830152614d7881614d3c565b9050919050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b6000614ddb602983613f14565b9150614de682614d7f565b604082019050919050565b60006020820190508181036000830152614e0a81614dce565b9050919050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000614e6d602a83613f14565b9150614e7882614e11565b604082019050919050565b60006020820190508181036000830152614e9c81614e60565b9050919050565b6000819050919050565b600060ff82169050919050565b6000819050919050565b6000614edf614eda614ed584614ea3565b614eba565b614ead565b9050919050565b614eef81614ec4565b82525050565b6000602082019050614f0a6000830184614ee6565b92915050565b600081905092915050565b60008190508160005260206000209050919050565b60008154614f3d8161498b565b614f478186614f10565b94506001821660008114614f625760018114614f7357614fa6565b60ff19831686528186019350614fa6565b614f7c85614f1b565b60005b83811015614f9e57815481890152600182019150602081019050614f7f565b838801955050505b50505092915050565b6000614fba82613f09565b614fc48185614f10565b9350614fd4818560208601613f25565b80840191505092915050565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000600082015250565b6000615016600583614f10565b915061502182614fe0565b600582019050919050565b60006150388285614f30565b91506150448284614faf565b915061504f82615009565b91508190509392505050565b7f4e594d0000000000000000000000000000000000000000000000000000000000600082015250565b6000615091600383613f14565b915061509c8261505b565b602082019050919050565b600060208201905081810360008301526150c081615084565b9050919050565b7f4f4f470000000000000000000000000000000000000000000000000000000000600082015250565b60006150fd600383613f14565b9150615108826150c7565b602082019050919050565b6000602082019050818103600083015261512c816150f0565b9050919050565b7f4e53434d00000000000000000000000000000000000000000000000000000000600082015250565b6000615169600483613f14565b915061517482615133565b602082019050919050565b600060208201905081810360008301526151988161515c565b9050919050565b7f544d470000000000000000000000000000000000000000000000000000000000600082015250565b60006151d5600383613f14565b91506151e08261519f565b602082019050919050565b60006020820190508181036000830152615204816151c8565b9050919050565b600061521682614429565b915061522183614429565b92508261ffff0382111561523857615237614c04565b5b828201905092915050565b7f4e45470000000000000000000000000000000000000000000000000000000000600082015250565b6000615279600383613f14565b915061528482615243565b602082019050919050565b600060208201905081810360008301526152a88161526c565b9050919050565b60008160601b9050919050565b60006152c7826152af565b9050919050565b60006152d9826152bc565b9050919050565b6152f16152ec82614047565b6152ce565b82525050565b600061530382846152e0565b60148201915081905092915050565b7f4e42470000000000000000000000000000000000000000000000000000000000600082015250565b6000615348600383613f14565b915061535382615312565b602082019050919050565b600060208201905081810360008301526153778161533b565b9050919050565b600061538982614429565b915061539483614429565b9250828210156153a7576153a6614c04565b5b828203905092915050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b600061540e602c83613f14565b9150615419826153b2565b604082019050919050565b6000602082019050818103600083015261543d81615401565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006154a0602583613f14565b91506154ab82615444565b604082019050919050565b600060208201905081810360008301526154cf81615493565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615532602483613f14565b915061553d826154d6565b604082019050919050565b6000602082019050818103600083015261556181615525565b9050919050565b600061557382613fc4565b915061557e83613fc4565b92508282101561559157615590614c04565b5b828203905092915050565b60006155a782613fc4565b91506155b283613fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156155e7576155e6614c04565b5b828201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b600061564e602e83613f14565b9150615659826155f2565b604082019050919050565b6000602082019050818103600083015261567d81615641565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b60006156e0602b83613f14565b91506156eb82615684565b604082019050919050565b6000602082019050818103600083015261570f816156d3565b9050919050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b6000615772602a83613f14565b915061577d82615716565b604082019050919050565b600060208201905081810360008301526157a181615765565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b60006157de601983613f14565b91506157e9826157a8565b602082019050919050565b6000602082019050818103600083015261580d816157d1565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061584a601983613f14565b915061585582615814565b602082019050919050565b600060208201905081810360008301526158798161583d565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b60006158dc603283613f14565b91506158e782615880565b604082019050919050565b6000602082019050818103600083015261590b816158cf565b9050919050565b60008151905061592181613fce565b92915050565b60006020828403121561593d5761593c613e44565b5b600061594b84828501615912565b91505092915050565b600061595f82613fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361599157615990614c04565b5b600182019050919050565b60006159a782613fc4565b91506159b283613fc4565b9250826159c2576159c1614c8d565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000615a32602083613f14565b9150615a3d826159fc565b602082019050919050565b60006020820190508181036000830152615a6181615a25565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000615a9e601c83613f14565b9150615aa982615a68565b602082019050919050565b60006020820190508181036000830152615acd81615a91565b9050919050565b6000615aef615aea615ae584614429565b614eba565b613fc4565b9050919050565b615aff81615ad4565b82525050565b6000602082019050615b1a6000830184615af6565b92915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000615b56601783614f10565b9150615b6182615b20565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000615ba2601183614f10565b9150615bad82615b6c565b601182019050919050565b6000615bc382615b49565b9150615bcf8285614faf565b9150615bda82615b95565b9150615be68284614faf565b91508190509392505050565b600081519050919050565b600082825260208201905092915050565b6000615c1982615bf2565b615c238185615bfd565b9350615c33818560208601613f25565b615c3c81613f58565b840191505092915050565b6000608082019050615c5c6000830187614059565b615c696020830186614059565b615c76604083018561420f565b8181036060830152615c888184615c0e565b905095945050505050565b600081519050615ca281613e7a565b92915050565b600060208284031215615cbe57615cbd613e44565b5b6000615ccc84828501615c93565b91505092915050565b6000615ce082613fc4565b915060008203615cf357615cf2614c04565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000615d34602083613f14565b9150615d3f82615cfe565b602082019050919050565b60006020820190508181036000830152615d6381615d27565b905091905056fe68747470733a2f2f67686c7370726f642e73332e616d617a6f6e6177732e636f6d2f6a736f6e2f68747470733a2f2f67686c7370726572657665616c2e73332e616d617a6f6e6177732e636f6d2f6a736f6e2f5368616c6c6f775f47726176652e6a736f6ea2646970667358221220fad73151d7a6d315fc4cf33081d7d871c07b965b4e3ac7be2ad1aeb855b1c49164736f6c634300080d0033
Verified Source Code Full Match
Compiler: v0.8.13+commit.abaa5c0e
EVM: london
Optimization: No
IERC721Upgradeable.sol 143 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721Upgradeable is IERC165Upgradeable {
/**
* @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`.
*
* 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;
/**
* @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 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 the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @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);
}
IERC721MetadataUpgradeable.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721Upgradeable.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721MetadataUpgradeable is IERC721Upgradeable {
/**
* @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);
}
IERC2981Upgradeable.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165Upgradeable.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981Upgradeable is IERC165Upgradeable {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
IERC721ReceiverUpgradeable.sol 27 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721ReceiverUpgradeable {
/**
* @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 `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
AddressUpgradeable.sol 195 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
IERC165Upgradeable.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @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);
}
ERC721Upgradeable.sol 459 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721Upgradeable.sol";
import "./IERC721ReceiverUpgradeable.sol";
import "./extensions/IERC721MetadataUpgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../utils/StringsUpgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable {
using AddressUpgradeable for address;
using StringsUpgradeable for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// 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;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC721_init_unchained(name_, symbol_);
}
function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) {
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721Upgradeable.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);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
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);
}
/**
* @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.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
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");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721Upgradeable.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721Upgradeable.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721Upgradeable.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721Upgradeable.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721ReceiverUpgradeable.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[44] private __gap;
}
AccessControlUpgradeable.sol 248 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}
StringsUpgradeable.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
IBatchReveal.sol 15 lines
//SPDX-License-Identifier: CC0
pragma solidity ^0.8.13;
interface IBatchReveal {
struct Range {
int128 start;
int128 end;
}
function getShuffledTokenId(uint startId) view external returns (uint);
function setBatchSeed(uint randomness) external;
function setLastTokenRevealed(uint _index) external;
}
BasedGhoulsNFTv269.sol 177 lines
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;
import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/common/ERC2981Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/cryptography/MerkleProofUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol";
import "./interfaces/IBatchReveal.sol";
// ghouls rebased by @0xhanvalen
contract BasedGhoulsv269 is ERC721Upgradeable, ERC2981Upgradeable, AccessControlUpgradeable {
using StringsUpgradeable for uint256;
mapping (address => bool) public EXPANSIONPAKRedemption;
mapping (address => bool) public REBASERedemption;
struct GhoulData {
bool isMintable;
uint16 totalSupply;
uint16 maxGhouls;
uint16 summonedGhouls;
uint16 rebasedGhouls;
uint16 maxRebasedGhouls;
uint16 lastTokenRevealed;
uint16 TOKEN_LIMIT;
uint16 REVEAL_BATCH_SIZE;
string baseURI;
string unrevealedURI;
bytes32 EXPANSION_PAK;
bytes32 SUMMONER_LIST;
address shufflerAddress;
bool isHordeReleased;
}
GhoulData ghouldata;
function initialize() initializer public {
__ERC721_init("Based Ghouls", "GHLS");
ghouldata.maxGhouls = 6666;
ghouldata.maxRebasedGhouls = 2529;
ghouldata.baseURI = "https://ghlsprod.s3.amazonaws.com/json/";
ghouldata.unrevealedURI = "https://ghlsprereveal.s3.amazonaws.com/json/Shallow_Grave.json";
ghouldata.EXPANSION_PAK = 0x45b023b371a3c483c2f511b6647ab965a580f4f2eaa3f9240a74c50bd9af779f;
ghouldata.SUMMONER_LIST = 0x0b2bcd41b8945cfd9ffe48a11ad38426bb2146bc95f2f2d35087037166f8cfec;
ghouldata.lastTokenRevealed = 1;
ghouldata.TOKEN_LIMIT = 6666;
ghouldata.REVEAL_BATCH_SIZE = 66;
ghouldata.isMintable = false;
ghouldata.totalSupply = 0;
_setDefaultRoyalty(0x475dcAA08A69fA462790F42DB4D3bbA1563cb474, 690);
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
grantRole(DEFAULT_ADMIN_ROLE, 0x98CCf605c43A0bF9D6795C3cf3b5fEd836330511);
}
function getGhoulData() view public returns (GhoulData memory) {
return ghouldata;
}
function updateBaseURI(string calldata _newURI) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.baseURI = _newURI;
}
function updateUnrevealedURI(string calldata _newURI) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.unrevealedURI = _newURI;
}
function setMintability(bool _mintability) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.isMintable = _mintability;
}
function setShufflerAddress(address _address) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.shufflerAddress = _address;
}
function setBatchSeed(uint _randomness) private {
IBatchReveal(ghouldata.shufflerAddress).setBatchSeed(_randomness);
}
function setLastTokenRevealed(uint16 _index) private {
IBatchReveal(ghouldata.shufflerAddress).setLastTokenRevealed(_index);
}
function getShuffledTokenId(uint _startId) view private returns (uint) {
return IBatchReveal(ghouldata.shufflerAddress).getShuffledTokenId(_startId);
}
function insertExpansionPack(bytes32 _newMerkle) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.EXPANSION_PAK = _newMerkle;
}
function releaseTheHorde(bool _isHordeReleased) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.isHordeReleased = _isHordeReleased;
}
function insertRebasePack(bytes32 _newMerkle, uint16 _maxRebasedGhouls) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.SUMMONER_LIST = _newMerkle;
ghouldata.maxRebasedGhouls = _maxRebasedGhouls;
}
// u gotta... GOTTA... send the merkleproof in w the mint request.
function summon(bytes32[] calldata _merkleProof, bool _isRebase) public {
require(ghouldata.isMintable, "NYM");
require(ghouldata.totalSupply <= ghouldata.maxGhouls, "OOG");
address minter = msg.sender;
require(tx.origin == msg.sender, "NSCM");
if (_isRebase) {
require(!REBASERedemption2[minter], "TMG");
require(ghouldata.rebasedGhouls + 3 <= ghouldata.maxRebasedGhouls, "NEG");
bytes32 leaf = keccak256(abi.encodePacked(minter));
bool isLeaf = MerkleProofUpgradeable.verify(_merkleProof, ghouldata.SUMMONER_LIST, leaf);
require(isLeaf, "NBG");
REBASERedemption2[minter] = true;
EXPANSIONPAKRedemption2[minter] = true;
ghouldata.totalSupply = ghouldata.totalSupply + 3;
ghouldata.rebasedGhouls += 3;
_mint(minter, ghouldata.totalSupply - 3);
_mint(minter, ghouldata.totalSupply - 2);
_mint(minter, ghouldata.totalSupply - 1);
}
if (!ghouldata.isHordeReleased && !_isRebase) {
require(!EXPANSIONPAKRedemption2[minter], "TMG");
require(ghouldata.summonedGhouls + 1 + ghouldata.maxRebasedGhouls <= ghouldata.maxGhouls, "NEG");
bytes32 leaf = keccak256(abi.encodePacked(minter));
bool isLeaf = MerkleProofUpgradeable.verify(_merkleProof, ghouldata.EXPANSION_PAK, leaf);
require(isLeaf, "NBG");
EXPANSIONPAKRedemption2[minter] = true;
ghouldata.totalSupply = ghouldata.totalSupply + 1;
ghouldata.summonedGhouls += 1;
_mint(minter, ghouldata.totalSupply - 1);
}
if (ghouldata.isHordeReleased) {
require(ghouldata.summonedGhouls + 1 + ghouldata.maxRebasedGhouls <= ghouldata.maxGhouls, "NEG");
ghouldata.summonedGhouls += 1;
ghouldata.totalSupply = ghouldata.totalSupply + 1;
_mint(minter, ghouldata.totalSupply - 1);
}
if(ghouldata.totalSupply >= (ghouldata.lastTokenRevealed + ghouldata.REVEAL_BATCH_SIZE)) {
ghouldata.lastTokenRevealed = ghouldata.totalSupply;
setLastTokenRevealed(ghouldata.totalSupply);
uint256 seed;
unchecked {
seed = uint256(blockhash(block.number - 69)) * uint256(block.timestamp % 69);
}
setBatchSeed(seed);
}
}
function tokenURI(uint256 id) public view override returns (string memory) {
if(id >= ghouldata.lastTokenRevealed){
return ghouldata.unrevealedURI;
} else {
return string(abi.encodePacked(ghouldata.baseURI, getShuffledTokenId(id).toString(), ".json"));
}
}
function supportsInterface(bytes4 interfaceId) public view virtual override(AccessControlUpgradeable, ERC2981Upgradeable, ERC721Upgradeable) returns (bool) {
return
interfaceId == type(IERC721Upgradeable).interfaceId ||
interfaceId == type(IERC721MetadataUpgradeable).interfaceId ||
interfaceId == type(IAccessControlUpgradeable).interfaceId ||
interfaceId == type(IERC2981Upgradeable).interfaceId ||
super.supportsInterface(interfaceId);
}
mapping (address => bool) public EXPANSIONPAKRedemption2;
mapping (address => bool) public REBASERedemption2;
function setGDLastTokenRevealed(uint16 newToken) public onlyRole(DEFAULT_ADMIN_ROLE) {
ghouldata.lastTokenRevealed = newToken;
}
}
ERC165Upgradeable.sol 42 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
IAccessControlUpgradeable.sol 88 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControlUpgradeable {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}
ERC2981Upgradeable.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981Upgradeable.sol";
import "../../utils/introspection/ERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981Upgradeable is Initializable, IERC2981Upgradeable, ERC165Upgradeable {
function __ERC2981_init() internal onlyInitializing {
}
function __ERC2981_init_unchained() internal onlyInitializing {
}
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165Upgradeable, ERC165Upgradeable) returns (bool) {
return interfaceId == type(IERC2981Upgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981Upgradeable
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `tokenId` must be already minted.
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[48] private __gap;
}
MerkleProofUpgradeable.sol 65 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)
pragma solidity ^0.8.0;
/**
* @dev These functions deal with verification of Merkle Trees proofs.
*
* The proofs can be generated using the JavaScript library
* https://github.com/miguelmota/merkletreejs[merkletreejs].
* Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
*
* See `test/utils/cryptography/MerkleProof.test.js` for some examples.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the merkle tree could be reinterpreted as a leaf value.
*/
library MerkleProofUpgradeable {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leafs & pre-images are assumed to be sorted.
*
* _Available since v4.4._
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = _efficientHash(computedHash, proofElement);
} else {
// Hash(current element of the proof + current computed hash)
computedHash = _efficientHash(proofElement, computedHash);
}
}
return computedHash;
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
ContextUpgradeable.sol 37 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}
Initializable.sol 149 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = _setInitializedVersion(1);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
bool isTopLevelCall = _setInitializedVersion(version);
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(version);
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
_setInitializedVersion(type(uint8).max);
}
function _setInitializedVersion(uint8 version) private returns (bool) {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
// of initializers, because in other contexts the contract may have been reentered.
if (_initializing) {
require(
version == 1 && !AddressUpgradeable.isContract(address(this)),
"Initializable: contract is already initialized"
);
return false;
} else {
require(_initialized < version, "Initializable: contract is already initialized");
_initialized = version;
return true;
}
}
}
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
EXPANSIONPAKRedemption 0x59ea929f → bool
EXPANSIONPAKRedemption2 0x63c371bd → bool
REBASERedemption 0xaa11f848 → bool
REBASERedemption2 0xb21fd34e → bool
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
getGhoulData 0xa304970c → tuple
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
isApprovedForAll 0xe985e9c5 → bool
name 0x06fdde03 → string
ownerOf 0x6352211e → address
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
grantRole 0x2f2ff15d
bytes32 role
address account
initialize 0x8129fc1c
No parameters
insertExpansionPack 0xf8b16cfb
bytes32 _newMerkle
insertRebasePack 0xb8e0bdf9
bytes32 _newMerkle
uint16 _maxRebasedGhouls
releaseTheHorde 0xa4650a14
bool _isHordeReleased
renounceRole 0x36568abe
bytes32 role
address account
revokeRole 0xd547741f
bytes32 role
address account
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setGDLastTokenRevealed 0xc518e1bd
uint16 newToken
setMintability 0x4e429f13
bool _mintability
setShufflerAddress 0xcc8c241a
address _address
summon 0xeb4e7326
bytes32[] _merkleProof
bool _isRebase
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
updateBaseURI 0x931688cb
string _newURI
updateUnrevealedURI 0xe5ef873d
string _newURI
Recent Transactions
This address has 1 on-chain transactions, but only 1.2% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →