Address Contract Partially Verified
Address
0xA3B041eE6b56BCcBc54A3048417d82Fe67736F62
Balance
0 ETH
Nonce
1
Code Size
18616 bytes
Creator
0xD3f27738...AedB at tx 0x6a89ccec...8b8b6f
Indexed Transactions
0
Contract Bytecode
18616 bytes
0x60806040526004361061022f5760003560e01c80636352211e1161012e5780639e34070f116100ab578063c87b56dd1161006f578063c87b56dd146107d4578063d2cab05614610811578063e985e9c51461082d578063eb8d24441461086a578063f2fde38b146108955761022f565b80639e34070f146106fe578063a0712d681461073b578063a22cb46514610757578063a82524b214610780578063b88d4fde146107ab5761022f565b80637c69e207116100f25780637c69e2071461063d578063841718a6146106545780638da5cb5b1461067d578063921ad4d8146106a857806395d89b41146106d35761022f565b80636352211e146105565780636b077523146105935780636c0360eb146105be57806370a08231146105e9578063715018a6146106265761022f565b806323b872dd116101bc57806342842e0e1161018057806342842e0e146104945780634dd710d1146104bd578063525f8a5c146104e857806354a8ccea1461051157806355f804b31461052d5761022f565b806323b872dd146103d7578063296cab551461040057806332cb6b0c146104295780633549345e146104545780633ccfd60b1461047d5761022f565b8063095ea7b311610203578063095ea7b31461030457806318160ddd1461032d5780631cbaee2d146103585780631fca850a146103835780632261c6b6146103ae5761022f565b80620e7fa81461023457806301ffc9a71461025f57806306fdde031461029c578063081812fc146102c7575b600080fd5b34801561024057600080fd5b506102496108be565b6040516102569190612e7e565b60405180910390f35b34801561026b57600080fd5b5061028660048036038101906102819190612f05565b6108c4565b6040516102939190612f4d565b60405180910390f35b3480156102a857600080fd5b506102b16109a6565b6040516102be9190613001565b60405180910390f35b3480156102d357600080fd5b506102ee60048036038101906102e9919061304f565b610a38565b6040516102fb91906130bd565b60405180910390f35b34801561031057600080fd5b5061032b60048036038101906103269190613104565b610abd565b005b34801561033957600080fd5b50610342610bd5565b60405161034f9190612e7e565b60405180910390f35b34801561036457600080fd5b5061036d610be6565b60405161037a9190612e7e565b60405180910390f35b34801561038f57600080fd5b50610398610bec565b6040516103a59190612e7e565b60405180910390f35b3480156103ba57600080fd5b506103d560048036038101906103d0919061304f565b610bf2565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613144565b610c78565b005b34801561040c57600080fd5b506104276004803603810190610422919061304f565b610cd8565b005b34801561043557600080fd5b5061043e610d5e565b60405161044b9190612e7e565b60405180910390f35b34801561046057600080fd5b5061047b6004803603810190610476919061304f565b610d64565b005b34801561048957600080fd5b50610492610dea565b005b3480156104a057600080fd5b506104bb60048036038101906104b69190613144565b610f48565b005b3480156104c957600080fd5b506104d2610f68565b6040516104df9190612e7e565b60405180910390f35b3480156104f457600080fd5b5061050f600480360381019061050a919061304f565b610f6d565b005b61052b600480360381019061052691906131fc565b610ff3565b005b34801561053957600080fd5b50610554600480360381019061054f91906133a0565b6112e0565b005b34801561056257600080fd5b5061057d6004803603810190610578919061304f565b611376565b60405161058a91906130bd565b60405180910390f35b34801561059f57600080fd5b506105a8611428565b6040516105b59190612e7e565b60405180910390f35b3480156105ca57600080fd5b506105d361142e565b6040516105e09190613001565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b91906133e9565b6114bc565b60405161061d9190612e7e565b60405180910390f35b34801561063257600080fd5b5061063b611574565b005b34801561064957600080fd5b506106526115fc565b005b34801561066057600080fd5b5061067b60048036038101906106769190613442565b61170e565b005b34801561068957600080fd5b506106926117a7565b60405161069f91906130bd565b60405180910390f35b3480156106b457600080fd5b506106bd6117d1565b6040516106ca9190612e7e565b60405180910390f35b3480156106df57600080fd5b506106e86117d7565b6040516106f59190613001565b60405180910390f35b34801561070a57600080fd5b506107256004803603810190610720919061304f565b611869565b6040516107329190612f4d565b60405180910390f35b6107556004803603810190610750919061304f565b6118bf565b005b34801561076357600080fd5b5061077e6004803603810190610779919061346f565b611a1e565b005b34801561078c57600080fd5b50610795611a34565b6040516107a29190612e7e565b60405180910390f35b3480156107b757600080fd5b506107d260048036038101906107cd9190613550565b611a3a565b005b3480156107e057600080fd5b506107fb60048036038101906107f6919061304f565b611a9c565b6040516108089190613001565b60405180910390f35b61082b600480360381019061082691906135d3565b611b43565b005b34801561083957600080fd5b50610854600480360381019061084f9190613633565b611d9b565b6040516108619190612f4d565b60405180910390f35b34801561087657600080fd5b5061087f611e2f565b60405161088c9190612f4d565b60405180910390f35b3480156108a157600080fd5b506108bc60048036038101906108b791906133e9565b611e42565b005b60095481565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061098f57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b8061099f575061099e82611f3a565b5b9050919050565b6060600080546109b5906136a2565b80601f01602080910402602001604051908101604052809291908181526020018280546109e1906136a2565b8015610a2e5780601f10610a0357610100808354040283529160200191610a2e565b820191906000526020600020905b815481529060010190602001808311610a1157829003601f168201915b5050505050905090565b6000610a4382611fa4565b610a82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7990613746565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000610ac882611376565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b30906137d8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610b58612010565b73ffffffffffffffffffffffffffffffffffffffff161480610b875750610b8681610b81612010565b611d9b565b5b610bc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbd9061386a565b60405180910390fd5b610bd08383612018565b505050565b6000610be1600f6120d1565b905090565b600a5481565b6108ae81565b610bfa612010565b73ffffffffffffffffffffffffffffffffffffffff16610c186117a7565b73ffffffffffffffffffffffffffffffffffffffff1614610c6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c65906138d6565b60405180910390fd5b8060088190555050565b610c89610c83612010565b826120df565b610cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbf90613968565b60405180910390fd5b610cd38383836121bd565b505050565b610ce0612010565b73ffffffffffffffffffffffffffffffffffffffff16610cfe6117a7565b73ffffffffffffffffffffffffffffffffffffffff1614610d54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4b906138d6565b60405180910390fd5b80600b8190555050565b61115c81565b610d6c612010565b73ffffffffffffffffffffffffffffffffffffffff16610d8a6117a7565b73ffffffffffffffffffffffffffffffffffffffff1614610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd7906138d6565b60405180910390fd5b8060098190555050565b610df2612010565b73ffffffffffffffffffffffffffffffffffffffff16610e106117a7565b73ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906138d6565b60405180910390fd5b60006103e861035247610e7991906139b7565b610e839190613a40565b9050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050610ee557600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050610f4557600080fd5b50565b610f6383838360405180602001604052806000815250611a3a565b505050565b601481565b610f75612010565b73ffffffffffffffffffffffffffffffffffffffff16610f936117a7565b73ffffffffffffffffffffffffffffffffffffffff1614610fe9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe0906138d6565b60405180910390fd5b80600a8190555050565b600e60149054906101000a900460ff16611042576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103990613abd565b60405180910390fd5b600b54421015611087576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107e90613b29565b60405180910390fd5b600a5442106110cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c290613b95565b60405180910390fd5b600083141580156110dd575060148311155b61111c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111390613c01565b60405180910390fd5b6108ae8360075461112d9190613c21565b111561116e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116590613cc3565b60405180910390fd5b8260095461117c91906139b7565b34146111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b490613d2f565b60405180910390fd5b6000843360016040516020016111d593929190613db8565b604051602081830303815290604052805190602001209050611259838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f2f02d937e933ee30c12ef2dee0201a15a588cde97faaf8aa58c175ecc350f98283612419565b611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90613e67565b60405180910390fd5b83600760008282546112aa9190613c21565b9250508190555060005b848110156112d8576112c533612430565b80806112d090613e87565b9150506112b4565b505050505050565b6112e8612010565b73ffffffffffffffffffffffffffffffffffffffff166113066117a7565b73ffffffffffffffffffffffffffffffffffffffff161461135c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611353906138d6565b60405180910390fd5b80600c9080519060200190611372929190612dc2565b5050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141690613f42565b60405180910390fd5b80915050919050565b60085481565b600c805461143b906136a2565b80601f0160208091040260200160405190810160405280929190818152602001828054611467906136a2565b80156114b45780601f10611489576101008083540402835291602001916114b4565b820191906000526020600020905b81548152906001019060200180831161149757829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152490613fd4565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61157c612010565b73ffffffffffffffffffffffffffffffffffffffff1661159a6117a7565b73ffffffffffffffffffffffffffffffffffffffff16146115f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e7906138d6565b60405180910390fd5b6115fa60006124af565b565b611604612010565b73ffffffffffffffffffffffffffffffffffffffff166116226117a7565b73ffffffffffffffffffffffffffffffffffffffff1614611678576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166f906138d6565b60405180910390fd5b600e60159054906101000a900460ff16156116c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116bf90614040565b60405180910390fd5b6001600e60156101000a81548160ff02191690831515021790555060005b602881101561170b576116f833612430565b808061170390613e87565b9150506116e6565b50565b611716612010565b73ffffffffffffffffffffffffffffffffffffffff166117346117a7565b73ffffffffffffffffffffffffffffffffffffffff161461178a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611781906138d6565b60405180910390fd5b80600e60146101000a81548160ff02191690831515021790555050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075481565b6060600180546117e6906136a2565b80601f0160208091040260200160405190810160405280929190818152602001828054611812906136a2565b801561185f5780601f106118345761010080835404028352916020019161185f565b820191906000526020600020905b81548152906001019060200180831161184257829003601f168201915b5050505050905090565b6000806101008361187a9190613a40565b905060006101008461188c9190614060565b90506000601060008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b600e60149054906101000a900460ff1661190e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161190590613abd565b60405180910390fd5b60008114158015611920575060148111155b61195f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195690613c01565b60405180910390fd5b600a544210156119a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199b906140dd565b60405180910390fd5b806008546119b291906139b7565b34146119f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ea90613d2f565b60405180910390fd5b60005b81811015611a1a57611a0733612430565b8080611a1290613e87565b9150506119f6565b5050565b611a30611a29612010565b8383612575565b5050565b600b5481565b611a4b611a45612010565b836120df565b611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8190613968565b60405180910390fd5b611a96848484846126e2565b50505050565b6060611aa782611fa4565b611ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611add9061416f565b60405180910390fd5b6000611af061273e565b90506000815111611b105760405180602001604052806000815250611b3b565b80611b1a846127d0565b604051602001611b2b9291906141cb565b6040516020818303038152906040525b915050919050565b600e60149054906101000a900460ff16611b92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8990613abd565b60405180910390fd5b600b54421015611bd7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bce90613b29565b60405180910390fd5b600a544210611c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1290613b95565b60405180910390fd5b6008543414611c5f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5690613d2f565b60405180910390fd5b611c6883611869565b15611ca8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9f9061423b565b60405180910390fd5b600083336001604051602001611cc093929190613db8565b604051602081830303815290604052805190602001209050611d44838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f584be09e9027215d42738e0e4609b2fce52ef3080388a5ecf844b812368cd70383612419565b611d83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7a90613e67565b60405180910390fd5b611d8c84612931565b611d9533612430565b50505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600e60149054906101000a900460ff1681565b611e4a612010565b73ffffffffffffffffffffffffffffffffffffffff16611e686117a7565b73ffffffffffffffffffffffffffffffffffffffff1614611ebe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eb5906138d6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611f2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f25906142cd565b60405180910390fd5b611f37816124af565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661208b83611376565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600081600001549050919050565b60006120ea82611fa4565b612129576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121209061435f565b60405180910390fd5b600061213483611376565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806121a357508373ffffffffffffffffffffffffffffffffffffffff1661218b84610a38565b73ffffffffffffffffffffffffffffffffffffffff16145b806121b457506121b38185611d9b565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff166121dd82611376565b73ffffffffffffffffffffffffffffffffffffffff1614612233576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161222a906143f1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156122a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229a90614483565b60405180910390fd5b6122ae83838361298b565b6122b9600082612018565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461230991906144a3565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546123609190613c21565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000826124268584612990565b1490509392505050565b61115c600161243f600f6120d1565b6124499190613c21565b10612489576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248090614523565b60405180910390fd5b6000612495600f6120d1565b90506124a1600f612a43565b6124ab8282612a59565b5050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156125e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125db9061458f565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516126d59190612f4d565b60405180910390a3505050565b6126ed8484846121bd565b6126f984848484612c27565b612738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161272f90614621565b60405180910390fd5b50505050565b6060600c805461274d906136a2565b80601f0160208091040260200160405190810160405280929190818152602001828054612779906136a2565b80156127c65780601f1061279b576101008083540402835291602001916127c6565b820191906000526020600020905b8154815290600101906020018083116127a957829003601f168201915b5050505050905090565b60606000821415612818576040518060400160405280600181526020017f3000000000000000000000000000000000000000000000000000000000000000815250905061292c565b600082905060005b6000821461284a57808061283390613e87565b915050600a826128439190613a40565b9150612820565b60008167ffffffffffffffff81111561286657612865613275565b5b6040519080825280601f01601f1916602001820160405280156128985781602001600182028036833780820191505090505b5090505b60008514612925576001826128b191906144a3565b9150600a856128c09190614060565b60306128cc9190613c21565b60f81b8183815181106128e2576128e1614641565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8561291e9190613a40565b945061289c565b8093505050505b919050565b6000610100826129419190613a40565b90506000610100836129539190614060565b9050806001901b6010600084815260200190815260200160002054176010600084815260200190815260200160002081905550505050565b505050565b60008082905060005b8451811015612a385760008582815181106129b7576129b6614641565b5b602002602001015190508083116129f85782816040516020016129db92919061469b565b604051602081830303815290604052805190602001209250612a24565b8083604051602001612a0b92919061469b565b6040516020818303038152906040528051906020012092505b508080612a3090613e87565b915050612999565b508091505092915050565b6001816000016000828254019250508190555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ac090614713565b60405180910390fd5b612ad281611fa4565b15612b12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b099061477f565b60405180910390fd5b612b1e6000838361298b565b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254612b6e9190613c21565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6000612c488473ffffffffffffffffffffffffffffffffffffffff16612daf565b15612da2578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612c71612010565b8786866040518563ffffffff1660e01b8152600401612c9394939291906147f4565b6020604051808303816000875af1925050508015612ccf57506040513d601f19601f82011682018060405250810190612ccc9190614855565b60015b612d52573d8060008114612cff576040519150601f19603f3d011682016040523d82523d6000602084013e612d04565b606091505b50600081511415612d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d4190614621565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612da7565b600190505b949350505050565b600080823b905060008111915050919050565b828054612dce906136a2565b90600052602060002090601f016020900481019282612df05760008555612e37565b82601f10612e0957805160ff1916838001178555612e37565b82800160010185558215612e37579182015b82811115612e36578251825591602001919060010190612e1b565b5b509050612e449190612e48565b5090565b5b80821115612e61576000816000905550600101612e49565b5090565b6000819050919050565b612e7881612e65565b82525050565b6000602082019050612e936000830184612e6f565b92915050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612ee281612ead565b8114612eed57600080fd5b50565b600081359050612eff81612ed9565b92915050565b600060208284031215612f1b57612f1a612ea3565b5b6000612f2984828501612ef0565b91505092915050565b60008115159050919050565b612f4781612f32565b82525050565b6000602082019050612f626000830184612f3e565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612fa2578082015181840152602081019050612f87565b83811115612fb1576000848401525b50505050565b6000601f19601f8301169050919050565b6000612fd382612f68565b612fdd8185612f73565b9350612fed818560208601612f84565b612ff681612fb7565b840191505092915050565b6000602082019050818103600083015261301b8184612fc8565b905092915050565b61302c81612e65565b811461303757600080fd5b50565b60008135905061304981613023565b92915050565b60006020828403121561306557613064612ea3565b5b60006130738482850161303a565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006130a78261307c565b9050919050565b6130b78161309c565b82525050565b60006020820190506130d260008301846130ae565b92915050565b6130e18161309c565b81146130ec57600080fd5b50565b6000813590506130fe816130d8565b92915050565b6000806040838503121561311b5761311a612ea3565b5b6000613129858286016130ef565b925050602061313a8582860161303a565b9150509250929050565b60008060006060848603121561315d5761315c612ea3565b5b600061316b868287016130ef565b935050602061317c868287016130ef565b925050604061318d8682870161303a565b9150509250925092565b600080fd5b600080fd5b600080fd5b60008083601f8401126131bc576131bb613197565b5b8235905067ffffffffffffffff8111156131d9576131d861319c565b5b6020830191508360208202830111156131f5576131f46131a1565b5b9250929050565b6000806000806060858703121561321657613215612ea3565b5b60006132248782880161303a565b94505060206132358782880161303a565b935050604085013567ffffffffffffffff81111561325657613255612ea8565b5b613262878288016131a6565b925092505092959194509250565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6132ad82612fb7565b810181811067ffffffffffffffff821117156132cc576132cb613275565b5b80604052505050565b60006132df612e99565b90506132eb82826132a4565b919050565b600067ffffffffffffffff82111561330b5761330a613275565b5b61331482612fb7565b9050602081019050919050565b82818337600083830152505050565b600061334361333e846132f0565b6132d5565b90508281526020810184848401111561335f5761335e613270565b5b61336a848285613321565b509392505050565b600082601f83011261338757613386613197565b5b8135613397848260208601613330565b91505092915050565b6000602082840312156133b6576133b5612ea3565b5b600082013567ffffffffffffffff8111156133d4576133d3612ea8565b5b6133e084828501613372565b91505092915050565b6000602082840312156133ff576133fe612ea3565b5b600061340d848285016130ef565b91505092915050565b61341f81612f32565b811461342a57600080fd5b50565b60008135905061343c81613416565b92915050565b60006020828403121561345857613457612ea3565b5b60006134668482850161342d565b91505092915050565b6000806040838503121561348657613485612ea3565b5b6000613494858286016130ef565b92505060206134a58582860161342d565b9150509250929050565b600067ffffffffffffffff8211156134ca576134c9613275565b5b6134d382612fb7565b9050602081019050919050565b60006134f36134ee846134af565b6132d5565b90508281526020810184848401111561350f5761350e613270565b5b61351a848285613321565b509392505050565b600082601f83011261353757613536613197565b5b81356135478482602086016134e0565b91505092915050565b6000806000806080858703121561356a57613569612ea3565b5b6000613578878288016130ef565b9450506020613589878288016130ef565b935050604061359a8782880161303a565b925050606085013567ffffffffffffffff8111156135bb576135ba612ea8565b5b6135c787828801613522565b91505092959194509250565b6000806000604084860312156135ec576135eb612ea3565b5b60006135fa8682870161303a565b935050602084013567ffffffffffffffff81111561361b5761361a612ea8565b5b613627868287016131a6565b92509250509250925092565b6000806040838503121561364a57613649612ea3565b5b6000613658858286016130ef565b9250506020613669858286016130ef565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806136ba57607f821691505b602082108114156136ce576136cd613673565b5b50919050565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000613730602c83612f73565b915061373b826136d4565b604082019050919050565b6000602082019050818103600083015261375f81613723565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b60006137c2602183612f73565b91506137cd82613766565b604082019050919050565b600060208201905081810360008301526137f1816137b5565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b6000613854603883612f73565b915061385f826137f8565b604082019050919050565b6000602082019050818103600083015261388381613847565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006138c0602083612f73565b91506138cb8261388a565b602082019050919050565b600060208201905081810360008301526138ef816138b3565b9050919050565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b6000613952603183612f73565b915061395d826138f6565b604082019050919050565b6000602082019050818103600083015261398181613945565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006139c282612e65565b91506139cd83612e65565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613a0657613a05613988565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613a4b82612e65565b9150613a5683612e65565b925082613a6657613a65613a11565b5b828204905092915050565b7f4e6f742061637469766500000000000000000000000000000000000000000000600082015250565b6000613aa7600a83612f73565b9150613ab282613a71565b602082019050919050565b60006020820190508181036000830152613ad681613a9a565b9050919050565b7f50726573616c65206d7573742062652061637469766500000000000000000000600082015250565b6000613b13601683612f73565b9150613b1e82613add565b602082019050919050565b60006020820190508181036000830152613b4281613b06565b9050919050565b7f50726573616c652068617320656e646564000000000000000000000000000000600082015250565b6000613b7f601183612f73565b9150613b8a82613b49565b602082019050919050565b60006020820190508181036000830152613bae81613b72565b9050919050565b7f302f6c696d697400000000000000000000000000000000000000000000000000600082015250565b6000613beb600783612f73565b9150613bf682613bb5565b602082019050919050565b60006020820190508181036000830152613c1a81613bde565b9050919050565b6000613c2c82612e65565b9150613c3783612e65565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c6c57613c6b613988565b5b828201905092915050565b7f43617070656420686f6c6465722073616c650000000000000000000000000000600082015250565b6000613cad601283612f73565b9150613cb882613c77565b602082019050919050565b60006020820190508181036000830152613cdc81613ca0565b9050919050565b7f45746865722076616c75652073656e74206973206e6f7420636f727265637400600082015250565b6000613d19601f83612f73565b9150613d2482613ce3565b602082019050919050565b60006020820190508181036000830152613d4881613d0c565b9050919050565b6000819050919050565b613d6a613d6582612e65565b613d4f565b82525050565b60008160601b9050919050565b6000613d8882613d70565b9050919050565b6000613d9a82613d7d565b9050919050565b613db2613dad8261309c565b613d8f565b82525050565b6000613dc48286613d59565b602082019150613dd48285613da1565b601482019150613de48284613d59565b602082019150819050949350505050565b7f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f6660008201527f2e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000613e51602183612f73565b9150613e5c82613df5565b604082019050919050565b60006020820190508181036000830152613e8081613e44565b9050919050565b6000613e9282612e65565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613ec557613ec4613988565b5b600182019050919050565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b6000613f2c602983612f73565b9150613f3782613ed0565b604082019050919050565b60006020820190508181036000830152613f5b81613f1f565b9050919050565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b6000613fbe602a83612f73565b9150613fc982613f62565b604082019050919050565b60006020820190508181036000830152613fed81613fb1565b9050919050565b7f416c7265616479206d696e746564000000000000000000000000000000000000600082015250565b600061402a600e83612f73565b915061403582613ff4565b602082019050919050565b600060208201905081810360008301526140598161401d565b9050919050565b600061406b82612e65565b915061407683612e65565b92508261408657614085613a11565b5b828206905092915050565b7f53616c65206d7573742062652061637469766500000000000000000000000000600082015250565b60006140c7601383612f73565b91506140d282614091565b602082019050919050565b600060208201905081810360008301526140f6816140ba565b9050919050565b7f4552433732314d657461646174613a2055524920717565727920666f72206e6f60008201527f6e6578697374656e7420746f6b656e0000000000000000000000000000000000602082015250565b6000614159602f83612f73565b9150614164826140fd565b604082019050919050565b600060208201905081810360008301526141888161414c565b9050919050565b600081905092915050565b60006141a582612f68565b6141af818561418f565b93506141bf818560208601612f84565b80840191505092915050565b60006141d7828561419a565b91506141e3828461419a565b91508190509392505050565b7f416c726561647920636c61696d65640000000000000000000000000000000000600082015250565b6000614225600f83612f73565b9150614230826141ef565b602082019050919050565b6000602082019050818103600083015261425481614218565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006142b7602683612f73565b91506142c28261425b565b604082019050919050565b600060208201905081810360008301526142e6816142aa565b9050919050565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b6000614349602c83612f73565b9150614354826142ed565b604082019050919050565b600060208201905081810360008301526143788161433c565b9050919050565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b60006143db602983612f73565b91506143e68261437f565b604082019050919050565b6000602082019050818103600083015261440a816143ce565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061446d602483612f73565b915061447882614411565b604082019050919050565b6000602082019050818103600083015261449c81614460565b9050919050565b60006144ae82612e65565b91506144b983612e65565b9250828210156144cc576144cb613988565b5b828203905092915050565b7f4d41585f535550504c5900000000000000000000000000000000000000000000600082015250565b600061450d600a83612f73565b9150614518826144d7565b602082019050919050565b6000602082019050818103600083015261453c81614500565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b6000614579601983612f73565b915061458482614543565b602082019050919050565b600060208201905081810360008301526145a88161456c565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b600061460b603283612f73565b9150614616826145af565b604082019050919050565b6000602082019050818103600083015261463a816145fe565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000819050919050565b6000819050919050565b61469561469082614670565b61467a565b82525050565b60006146a78285614684565b6020820191506146b78284614684565b6020820191508190509392505050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b60006146fd602083612f73565b9150614708826146c7565b602082019050919050565b6000602082019050818103600083015261472c816146f0565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000614769601c83612f73565b915061477482614733565b602082019050919050565b600060208201905081810360008301526147988161475c565b9050919050565b600081519050919050565b600082825260208201905092915050565b60006147c68261479f565b6147d081856147aa565b93506147e0818560208601612f84565b6147e981612fb7565b840191505092915050565b600060808201905061480960008301876130ae565b61481660208301866130ae565b6148236040830185612e6f565b818103606083015261483581846147bb565b905095945050505050565b60008151905061484f81612ed9565b92915050565b60006020828403121561486b5761486a612ea3565b5b600061487984828501614840565b9150509291505056fea26469706673582212204812816b4be3fd9402f5b19f2cefdc837d7434ef65cb222ab730f8a4f4405ba464736f6c634300080a0033
Verified Source Code Partial Match
Compiler: v0.8.10+commit.fc410830
EVM: london
Optimization: No
PersonaLamps.sol 1346 lines
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts v4.4.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.
*/
library MerkleProof {
/**
* @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 Merklee 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 = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
return computedHash;
}
}
// File: @openzeppelin/contracts/utils/Counters.sol
// OpenZeppelin Contracts v4.4.0 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
// File: @openzeppelin/contracts/utils/Strings.sol
// OpenZeppelin Contracts v4.4.0 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
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);
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.0 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts v4.4.0 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts v4.4.0 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(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);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol
// OpenZeppelin Contracts v4.4.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 IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts v4.4.0 (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 IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts v4.4.0 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
/**
* @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 ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/ERC721/IERC721.sol
// OpenZeppelin Contracts v4.4.0 (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol
// OpenZeppelin Contracts v4.4.0 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}
// File: @openzeppelin/contracts/token/ERC721/ERC721.sol
// OpenZeppelin Contracts v4.4.0 (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
/**
* @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 ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings 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.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).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 overriden 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 = ERC721.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 = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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);
}
/**
* @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 = ERC721.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);
}
/**
* @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(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(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(ERC721.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 IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.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 {}
}
// File: contracts/PersonaLamps.sol
//Contract based on https://docs.openzeppelin.com/contracts/3.x/erc721
pragma solidity ^0.8.0;
contract PersonaLamps is ERC721, Ownable {
using Counters for Counters.Counter;
uint256 public constant MAX_LAMP_PURCHASE = 20;
uint256 public constant MAX_SUPPLY = 4444;
uint256 public constant HOLDER_CAP = 2222;
bytes32 immutable whitelistRoot;
bytes32 immutable holderRoot;
uint256 public holderBuys;
uint256 public lampPrice = 0.044 ether;
uint256 public presalePrice = 0.04 ether;
uint256 public saleStartTime = type(uint256).max;
uint256 public presaleStartTime = type(uint256).max;
string public baseURI;
address treasury = 0xB299aE977acAc0eAc606EBCa28d171B7F5670002;
address uwulabs = 0x354A70969F0b4a4C994403051A81C2ca45db3615;
bool public saleIsActive = true;
bool private devMinted = false;
Counters.Counter private _tokenIds;
// This is a packed array of booleans.
mapping(uint256 => uint256) private claimedBitMap;
constructor(uint256 _presaleStartTime, uint256 _saleStartTime, bytes32 _whitelistRoot, bytes32 _holderRoot) Ownable() ERC721("Persona Lamps", "LAMP") {
require(_saleStartTime > _presaleStartTime, "Invalid timestamp");
presaleStartTime = _presaleStartTime;
saleStartTime = _saleStartTime;
whitelistRoot = _whitelistRoot;
holderRoot = _holderRoot;
}
function devMint() external onlyOwner {
require(!devMinted, "Already minted");
devMinted = true;
for (uint256 i = 0; i < 40; i++) {
_mintNFT(msg.sender);
}
}
function withdraw() external onlyOwner {
uint256 treasuryShare = (address(this).balance*850)/1000;
require(payable(treasury).send(treasuryShare));
require(payable(uwulabs).send(address(this).balance));
}
// Function to disable sale and close minting.
function setSaleActive(bool active) external onlyOwner {
saleIsActive = active;
}
function setPresalePrice(uint256 newPresalePrice) external onlyOwner {
presalePrice = newPresalePrice;
}
function setLampPrice(uint256 newLampPrice) external onlyOwner {
lampPrice = newLampPrice;
}
function setPresaleStartTime(uint256 _presaleStartTime) external onlyOwner {
presaleStartTime = _presaleStartTime;
}
function setSaleStartTime(uint256 startTime) external onlyOwner {
saleStartTime = startTime;
}
function setBaseURI(string memory newURI) external onlyOwner {
baseURI = newURI;
}
function holderMint(uint256 index, uint256 amountToMint, bytes32[] calldata merkleProof) external payable {
require(saleIsActive, "Not active");
require(block.timestamp >= presaleStartTime, "Presale must be active");
require(block.timestamp < saleStartTime, "Presale has ended");
require(amountToMint != 0 && amountToMint <= MAX_LAMP_PURCHASE, "0/limit");
require(holderBuys + amountToMint <= HOLDER_CAP, "Capped holder sale");
require(msg.value == presalePrice*amountToMint, "Ether value sent is not correct");
// Verify the merkle proof.
bytes32 node = keccak256(abi.encodePacked(index, msg.sender, uint256(1)));
require(MerkleProof.verify(merkleProof, holderRoot, node), 'MerkleDistributor: Invalid proof.');
holderBuys += amountToMint;
for (uint256 i = 0; i < amountToMint; i++) {
_mintNFT(msg.sender);
}
}
function whitelistMint(uint256 index, bytes32[] calldata merkleProof) external payable {
require(saleIsActive, "Not active");
require(block.timestamp >= presaleStartTime, "Presale must be active");
require(block.timestamp < saleStartTime, "Presale has ended");
require(msg.value == lampPrice, "Ether value sent is not correct");
// Verify the merkle proof.
require(!isClaimed(index), "Already claimed");
bytes32 node = keccak256(abi.encodePacked(index, msg.sender, uint256(1)));
require(MerkleProof.verify(merkleProof, whitelistRoot, node), 'MerkleDistributor: Invalid proof.');
_setClaimed(index);
_mintNFT(msg.sender);
}
function mint(uint256 numberOfTokens) external payable {
require(saleIsActive, "Not active");
require(numberOfTokens != 0 && numberOfTokens <= MAX_LAMP_PURCHASE, "0/limit");
require(block.timestamp >= saleStartTime, "Sale must be active");
require(msg.value == lampPrice * numberOfTokens, "Ether value sent is not correct");
for(uint i = 0; i < numberOfTokens; i++) {
_mintNFT(msg.sender);
}
}
function totalSupply() external view returns (uint256) {
return _tokenIds.current();
}
function isClaimed(uint256 index) public view returns (bool) {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
uint256 claimedWord = claimedBitMap[claimedWordIndex];
uint256 mask = (1 << claimedBitIndex);
return claimedWord & mask == mask;
}
function _setClaimed(uint256 index) private {
uint256 claimedWordIndex = index / 256;
uint256 claimedBitIndex = index % 256;
claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex);
}
function _mintNFT(address to) internal {
require(_tokenIds.current() + 1 < MAX_SUPPLY, "MAX_SUPPLY");
uint256 newItemId = _tokenIds.current();
_tokenIds.increment();
_mint(to, newItemId);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseURI;
}
}
Read Contract
HOLDER_CAP 0x1fca850a → uint256
MAX_LAMP_PURCHASE 0x4dd710d1 → uint256
MAX_SUPPLY 0x32cb6b0c → uint256
balanceOf 0x70a08231 → uint256
baseURI 0x6c0360eb → string
getApproved 0x081812fc → address
holderBuys 0x921ad4d8 → uint256
isApprovedForAll 0xe985e9c5 → bool
isClaimed 0x9e34070f → bool
lampPrice 0x6b077523 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
presalePrice 0x000e7fa8 → uint256
presaleStartTime 0xa82524b2 → uint256
saleIsActive 0xeb8d2444 → bool
saleStartTime 0x1cbaee2d → uint256
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 18 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
devMint 0x7c69e207
No parameters
holderMint 0x54a8ccea
uint256 index
uint256 amountToMint
bytes32[] merkleProof
mint 0xa0712d68
uint256 numberOfTokens
renounceOwnership 0x715018a6
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseURI 0x55f804b3
string newURI
setLampPrice 0x2261c6b6
uint256 newLampPrice
setPresalePrice 0x3549345e
uint256 newPresalePrice
setPresaleStartTime 0x296cab55
uint256 _presaleStartTime
setSaleActive 0x841718a6
bool active
setSaleStartTime 0x525f8a5c
uint256 startTime
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
whitelistMint 0xd2cab056
uint256 index
bytes32[] merkleProof
withdraw 0x3ccfd60b
No parameters
Recent Transactions
No transactions found for this address