Address Contract Verified
Address
0x93b60aC4aB09Cb9F652279476FA13640d025F540
Balance
0 ETH
Nonce
1
Code Size
13574 bytes
Creator
0x7be2EBAE...D3FB at tx 0xd3860d8d...5c8a04
Indexed Transactions
0
Contract Bytecode
13574 bytes
0x6080604052600436106102b15760003560e01c80637cb6475911610175578063a6e158f8116100dc578063d86bd3f811610095578063f242432a1161006f578063f242432a1461089b578063f2fde38b146108bb578063f3fef3a3146108db578063f5298aca146108fb57600080fd5b8063d86bd3f814610805578063e81ed04414610825578063e985e9c51461085257600080fd5b8063a6e158f814610723578063a9d3483714610743578063ad2f852a14610758578063b706910914610778578063b8997a9714610798578063c2576d64146107d857600080fd5b806395a613571161012e57806395a61357146106835780639659867e1461069857806397666c1e146106ae578063a22cb465146106ce578063a4435dfd146106ee578063a5e47bbc1461070e57600080fd5b80637cb64759146105d15780637ff9b596146105f157806389a89002146106075780638da5cb5b1461061c5780638f2cbdd11461064e57806391b7f5ed1461066357600080fd5b8063318f1552116102195780635a527946116101d25780635a527946146105395780635def2d7c1461055357806367243482146105695780636b20c45414610589578063715018a6146105a95780637bc9200e146105be57600080fd5b8063318f155214610499578063375a069a146104ae5780634047638d146104c157806344555a36146104d65780634ccdb6ff146104eb5780634e1273f41461050c57600080fd5b8063134c42f01161026b578063134c42f0146103dc5780632a55205a146103f25780632ac3822f146104315780632db11544146104505780632eb2c2d6146104635780632eb4a7ab1461048357600080fd5b8062fdd58e146102f557806301195d521461032857806301ffc9a71461034a57806302f73b2b1461037a57806302fa7c471461038f5780630e89341c146103af57600080fd5b366102f057604080513381523460208201527f88a5966d370b9919b20f3e2c13ff65706f196a4e32cc2c12bf57088f88525874910160405180910390a1005b600080fd5b34801561030157600080fd5b506103156103103660046128de565b61091b565b6040519081526020015b60405180910390f35b34801561033457600080fd5b506103486103433660046129e0565b6109b2565b005b34801561035657600080fd5b5061036a610365366004612ac2565b610ac8565b604051901515815260200161031f565b34801561038657600080fd5b5061031560fa81565b34801561039b57600080fd5b506103486103aa366004612ae6565b610ad9565b3480156103bb57600080fd5b506103cf6103ca366004612b2b565b610b57565b60405161031f9190612b91565b3480156103e857600080fd5b5061031560075481565b3480156103fe57600080fd5b5061041261040d366004612ba4565b610beb565b604080516001600160a01b03909316835260208301919091520161031f565b34801561043d57600080fd5b50600a5461036a90610100900460ff1681565b61034861045e366004612b2b565b610c99565b34801561046f57600080fd5b5061034861047e366004612c39565b610d6f565b34801561048f57600080fd5b50610315600c5481565b3480156104a557600080fd5b50610348610e06565b6103486104bc366004612b2b565b610e4d565b3480156104cd57600080fd5b50610348611023565b3480156104e257600080fd5b506103486110d3565b3480156104f757600080fd5b50600a5461036a906301000000900460ff1681565b34801561051857600080fd5b5061052c6105273660046129e0565b611176565b60405161031f9190612d21565b34801561054557600080fd5b50600a5461036a9060ff1681565b34801561055f57600080fd5b50610315612aa981565b34801561057557600080fd5b50610348610584366004612d78565b61129f565b34801561059557600080fd5b506103486105a4366004612de3565b611453565b3480156105b557600080fd5b50610348611496565b6103486105cc366004612e58565b6114cc565b3480156105dd57600080fd5b506103486105ec366004612b2b565b6116f8565b3480156105fd57600080fd5b5061031560085481565b34801561061357600080fd5b50610315600181565b34801561062857600080fd5b506003546001600160a01b03165b6040516001600160a01b03909116815260200161031f565b34801561065a57600080fd5b50610348611727565b34801561066f57600080fd5b5061034861067e366004612b2b565b6117a8565b34801561068f57600080fd5b50610315600281565b3480156106a457600080fd5b5061031560095481565b3480156106ba57600080fd5b506103486106c9366004612ea3565b6117d7565b3480156106da57600080fd5b506103486106e9366004612ec0565b611823565b3480156106fa57600080fd5b50600a5461036a9062010000900460ff1681565b34801561071a57600080fd5b50610315600581565b34801561072f57600080fd5b5061034861073e366004612b2b565b61182e565b34801561074f57600080fd5b5061031560e181565b34801561076457600080fd5b50600b54610636906001600160a01b031681565b34801561078457600080fd5b5061036a610793366004612ef3565b61199a565b3480156107a457600080fd5b50600a546107c09064010000000090046001600160601b031681565b6040516001600160601b03909116815260200161031f565b3480156107e457600080fd5b506103156107f3366004612ea3565b600e6020526000908152604090205481565b34801561081157600080fd5b50600654610636906001600160a01b031681565b34801561083157600080fd5b50610315610840366004612ea3565b600d6020526000908152604090205481565b34801561085e57600080fd5b5061036a61086d366004612f2e565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b3480156108a757600080fd5b506103486108b6366004612f5c565b611a20565b3480156108c757600080fd5b506103486108d6366004612ea3565b611a65565b3480156108e757600080fd5b506103486108f63660046128de565b611afd565b34801561090757600080fd5b50610348610916366004612fc4565b611bbc565b60006001600160a01b03831661098c5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b6003546001600160a01b031633146109dc5760405162461bcd60e51b815260040161098390612ff9565b8051825114610a485760405162461bcd60e51b815260206004820152603260248201527f416464726573736573206c656e67746820646f6573206e6f74206d61746368206044820152710dad2dce882dadeeadce8e640d8cadccee8d60731b6064820152608401610983565b60005b8251811015610ac357818181518110610a6657610a6661302e565b6020026020010151600e6000858481518110610a8457610a8461302e565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055508080610abb9061305a565b915050610a4b565b505050565b6000610ad382611bff565b92915050565b6003546001600160a01b03163314610b035760405162461bcd60e51b815260040161098390612ff9565b600b80546001600160a01b0319166001600160a01b038416179055600a80546fffffffffffffffffffffffff0000000019166401000000006001600160601b03841602179055610b538282611c24565b5050565b606060028054610b6690613075565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9290613075565b8015610bdf5780601f10610bb457610100808354040283529160200191610bdf565b820191906000526020600020905b815481529060010190602001808311610bc257829003601f168201915b50505050509050919050565b60008281526005602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610c605750604080518082019091526004546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610c7f906001600160601b0316876130b0565b610c8991906130cf565b91519350909150505b9250929050565b323314610cb85760405162461bcd60e51b8152600401610983906130f1565b600a5462010000900460ff16610d075760405162461bcd60e51b8152602060048201526014602482015273283ab13634b19036b4b73a103737ba1037b832b760611b6044820152606401610983565b600081118015610d175750600681105b610d635760405162461bcd60e51b815260206004820152601d60248201527f3120746f203520746f6b656e7320706572207472616e73616374696f6e0000006044820152606401610983565b610d6c81611d21565b50565b6001600160a01b038516331480610d8b5750610d8b853361086d565b610df25760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608401610983565b610dff8585858585611e29565b5050505050565b6003546001600160a01b03163314610e305760405162461bcd60e51b815260040161098390612ff9565b600a805461ff001981166101009182900460ff1615909102179055565b323314610e6c5760405162461bcd60e51b8152600401610983906130f1565b600a54610100900460ff16610ec35760405162461bcd60e51b815260206004820152601760248201527f446576656c6f706572206d696e74206e6f74206f70656e0000000000000000006044820152606401610983565b336000908152600e6020526040902054610f1f5760405162461bcd60e51b815260206004820152601960248201527f4e6f7420656c696769626c6520666f7220646576206d696e74000000000000006044820152606401610983565b806007541015610f715760405162461bcd60e51b815260206004820152601860248201527f457863656564732064657620737570706c79206c696d697400000000000000006044820152606401610983565b336000908152600e6020526040902054811115610fdc5760405162461bcd60e51b8152602060048201526024808201527f45786365656473206465762077616c6c6574277320616c6c6f7474656420616d6044820152631bdd5b9d60e21b6064820152608401610983565b336000908152600e602052604081208054839290610ffb908490613128565b9250508190555080600760008282546110149190613128565b90915550610d6c905081611d21565b6003546001600160a01b0316331461104d5760405162461bcd60e51b815260040161098390612ff9565b600a5460ff161580156110685750600a54610100900460ff16155b6110b45760405162461bcd60e51b815260206004820152601e60248201527f416c6c206f74686572206d696e7473206d75737420626520636c6f73656400006044820152606401610983565b600a805462ff0000198116620100009182900460ff1615909102179055565b6003546001600160a01b031633146110fd5760405162461bcd60e51b815260040161098390612ff9565b6006546001600160a01b03166111555760405162461bcd60e51b815260206004820152601760248201527f4d697373696e672041766174617220636f6e74726163740000000000000000006044820152606401610983565b600a805463ff00000019811663010000009182900460ff1615909102179055565b606081518351146111db5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608401610983565b600083516001600160401b038111156111f6576111f661290a565b60405190808252806020026020018201604052801561121f578160200160208202803683370190505b50905060005b84518110156112975761126a8582815181106112435761124361302e565b602002602001015185838151811061125d5761125d61302e565b602002602001015161091b565b82828151811061127c5761127c61302e565b60209081029190910101526112908161305a565b9050611225565b509392505050565b6003546001600160a01b031633146112c95760405162461bcd60e51b815260040161098390612ff9565b8281146113345760405162461bcd60e51b815260206004820152603360248201527f416464726573736573206c656e67746820646f6573206e6f74206d61746368206044820152720c2dadeeadce8a8de9ad2dce840d8cadccee8d606b1b6064820152608401610983565b60095460005b8481101561144957612aa9828585848181106113585761135861302e565b90506020020135611369919061313f565b11156113b75760405162461bcd60e51b815260206004820152601d60248201527f4d696e742077696c6c2065786365656420746f74616c20737570706c790000006044820152606401610983565b8383828181106113c9576113c961302e565b90506020020135826113db919061313f565b91506114378686838181106113f2576113f261302e565b90506020020160208101906114079190612ea3565b600186868581811061141b5761141b61302e565b9050602002013560405180602001604052806000815250611fbd565b806114418161305a565b91505061133a565b5060095550505050565b6001600160a01b03831633148061146f575061146f833361086d565b61148b5760405162461bcd60e51b815260040161098390613157565b610ac38383836120c7565b6003546001600160a01b031633146114c05760405162461bcd60e51b815260040161098390612ff9565b6114ca6000612243565b565b3233146114eb5760405162461bcd60e51b8152600401610983906130f1565b600a5460ff1661153d5760405162461bcd60e51b815260206004820152601760248201527f416c6c6f776c697374206d696e74206e6f74206f70656e0000000000000000006044820152606401610983565b60008311801561154e575060028311155b6115925760405162461bcd60e51b815260206004820152601560248201527420b6b7bab73a1036bab9ba10313290189037b9101960591b6044820152606401610983565b336000908152600d60205260409020546002906115b090859061313f565b11156115fe5760405162461bcd60e51b815260206004820152601860248201527f457863656564732077616c6c657420616c6c6f77616e636500000000000000006044820152606401610983565b6040516bffffffffffffffffffffffff193360601b16602082015260009060340160405160208183030381529060405280519060200120905061167883838080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600c549150849050612295565b6116c45760405162461bcd60e51b815260206004820152601e60248201527f41646472657373206e6f7420666f756e6420696e20616c6c6f776c69737400006044820152606401610983565b336000908152600d6020526040812080548692906116e390849061313f565b909155506116f2905084611d21565b50505050565b6003546001600160a01b031633146117225760405162461bcd60e51b815260040161098390612ff9565b600c55565b6003546001600160a01b031633146117515760405162461bcd60e51b815260040161098390612ff9565b600c546117945760405162461bcd60e51b8152602060048201526011602482015270115b5c1d1e481b595c9adb19481c9bdbdd607a1b6044820152606401610983565b600a805460ff19811660ff90911615179055565b6003546001600160a01b031633146117d25760405162461bcd60e51b815260040161098390612ff9565b600855565b6003546001600160a01b031633146118015760405162461bcd60e51b815260040161098390612ff9565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b610b533383836122ab565b32331461184d5760405162461bcd60e51b8152600401610983906130f1565b600a546301000000900460ff166118a65760405162461bcd60e51b815260206004820152601d60248201527f526564656d7074696f6e20706572696f64206e6f7420656e61626c65640000006044820152606401610983565b6000811180156118c057506118bc33600161091b565b8111155b61191e5760405162461bcd60e51b815260206004820152602960248201527f416d6f756e74206d757374206265206265747765656e203120616e6420746f6b604482015268195b9cc81bdddb995960ba1b6064820152608401610983565b6006546001600160a01b031661193633600184611bbc565b60405163697c86db60e11b8152336004820152602481018390526001600160a01b0382169063d2f90db690604401600060405180830381600087803b15801561197e57600080fd5b505af1158015611992573d6000803e3d6000fd5b505050505050565b6040516bffffffffffffffffffffffff19606085901b1660208201526000908190603401604051602081830303815290604052805190602001209050611a1784848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600c549150849050612295565b95945050505050565b6001600160a01b038516331480611a3c5750611a3c853361086d565b611a585760405162461bcd60e51b815260040161098390613157565b610dff858585858561238c565b6003546001600160a01b03163314611a8f5760405162461bcd60e51b815260040161098390612ff9565b6001600160a01b038116611af45760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610983565b610d6c81612243565b6003546001600160a01b03163314611b275760405162461bcd60e51b815260040161098390612ff9565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611b74576040519150601f19603f3d011682016040523d82523d6000602084013e611b79565b606091505b5050905080610ac35760405162461bcd60e51b815260206004820152600f60248201526e15da5d1a191c985dc819985a5b1959608a1b6044820152606401610983565b6001600160a01b038316331480611bd85750611bd8833361086d565b611bf45760405162461bcd60e51b815260040161098390613157565b610ac38383836124a9565b60006001600160e01b0319821663152a902d60e11b1480610ad35750610ad3826125ab565b6127106001600160601b0382161115611c925760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610983565b6001600160a01b038216611ce85760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610983565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600455565b612aa960fa60095483611d34919061313f565b611d3e919061313f565b1115611d8c5760405162461bcd60e51b815260206004820152601d60248201527f4d696e742077696c6c2065786365656420746f74616c20737570706c790000006044820152606401610983565b80600854611d9a91906130b0565b3414611df45760405162461bcd60e51b8152602060048201526024808201527f4554482073656e74206d75737420626520657175616c20746f206d696e7420706044820152637269636560e01b6064820152608401610983565b8060096000828254611e06919061313f565b92505081905550610d6c3360018360405180602001604052806000815250611fbd565b8151835114611e4a5760405162461bcd60e51b8152600401610983906131a0565b6001600160a01b038416611e705760405162461bcd60e51b8152600401610983906131e8565b3360005b8451811015611f57576000858281518110611e9157611e9161302e565b602002602001015190506000858381518110611eaf57611eaf61302e565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015611eff5760405162461bcd60e51b81526004016109839061322d565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290611f3c90849061313f565b9250508190555050505080611f509061305a565b9050611e74565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051611fa7929190613277565b60405180910390a46119928187878787876125fb565b6001600160a01b03841661201d5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608401610983565b336120378160008761202e88612757565b610dff88612757565b6000848152602081815260408083206001600160a01b03891684529091528120805485929061206790849061313f565b909155505060408051858152602081018590526001600160a01b0380881692600092918516917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610dff816000878787876127a2565b6001600160a01b0383166120ed5760405162461bcd60e51b81526004016109839061329c565b805182511461210e5760405162461bcd60e51b8152600401610983906131a0565b604080516020810190915260009081905233905b83518110156121e457600084828151811061213f5761213f61302e565b60200260200101519050600084838151811061215d5761215d61302e565b602090810291909101810151600084815280835260408082206001600160a01b038c1683529093529190912054909150818110156121ad5760405162461bcd60e51b8152600401610983906132df565b6000928352602083815260408085206001600160a01b038b16865290915290922091039055806121dc8161305a565b915050612122565b5060006001600160a01b0316846001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051612235929190613277565b60405180910390a450505050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000826122a2858461285d565b14949350505050565b816001600160a01b0316836001600160a01b0316141561231f5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610983565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166123b25760405162461bcd60e51b8152600401610983906131e8565b336123c281878761202e88612757565b6000848152602081815260408083206001600160a01b038a168452909152902054838110156124035760405162461bcd60e51b81526004016109839061322d565b6000858152602081815260408083206001600160a01b038b811685529252808320878503905590881682528120805486929061244090849061313f565b909155505060408051868152602081018690526001600160a01b03808916928a821692918616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46124a08288888888886127a2565b50505050505050565b6001600160a01b0383166124cf5760405162461bcd60e51b81526004016109839061329c565b336124ff818560006124e087612757565b6124e987612757565b5050604080516020810190915260009052505050565b6000838152602081815260408083206001600160a01b0388168452909152902054828110156125405760405162461bcd60e51b8152600401610983906132df565b6000848152602081815260408083206001600160a01b03898116808652918452828520888703905582518981529384018890529092908616917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050505050565b60006001600160e01b03198216636cdb3d1360e11b14806125dc57506001600160e01b031982166303a24d0760e21b145b80610ad357506301ffc9a760e01b6001600160e01b0319831614610ad3565b6001600160a01b0384163b156119925760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061263f9089908990889088908890600401613323565b6020604051808303816000875af192505050801561267a575060408051601f3d908101601f1916820190925261267791810190613381565b60015b6127275761268661339e565b806308c379a014156126c0575061269b6133ba565b806126a657506126c2565b8060405162461bcd60e51b81526004016109839190612b91565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b6064820152608401610983565b6001600160e01b0319811663bc197c8160e01b146124a05760405162461bcd60e51b815260040161098390613443565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106127915761279161302e565b602090810291909101015292915050565b6001600160a01b0384163b156119925760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906127e6908990899088908890889060040161348b565b6020604051808303816000875af1925050508015612821575060408051601f3d908101601f1916820190925261281e91810190613381565b60015b61282d5761268661339e565b6001600160e01b0319811663f23a6e6160e01b146124a05760405162461bcd60e51b815260040161098390613443565b600081815b845181101561129757600085828151811061287f5761287f61302e565b602002602001015190508083116128a557600083815260208290526040902092506128b6565b600081815260208490526040902092505b50806128c18161305a565b915050612862565b6001600160a01b0381168114610d6c57600080fd5b600080604083850312156128f157600080fd5b82356128fc816128c9565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156129455761294561290a565b6040525050565b60006001600160401b038211156129655761296561290a565b5060051b60200190565b600082601f83011261298057600080fd5b8135602061298d8261294c565b60405161299a8282612920565b83815260059390931b85018201928281019150868411156129ba57600080fd5b8286015b848110156129d557803583529183019183016129be565b509695505050505050565b600080604083850312156129f357600080fd5b82356001600160401b0380821115612a0a57600080fd5b818501915085601f830112612a1e57600080fd5b81356020612a2b8261294c565b604051612a388282612920565b83815260059390931b8501820192828101915089841115612a5857600080fd5b948201945b83861015612a7f578535612a70816128c9565b82529482019490820190612a5d565b96505086013592505080821115612a9557600080fd5b50612aa28582860161296f565b9150509250929050565b6001600160e01b031981168114610d6c57600080fd5b600060208284031215612ad457600080fd5b8135612adf81612aac565b9392505050565b60008060408385031215612af957600080fd5b8235612b04816128c9565b915060208301356001600160601b0381168114612b2057600080fd5b809150509250929050565b600060208284031215612b3d57600080fd5b5035919050565b6000815180845260005b81811015612b6a57602081850181015186830182015201612b4e565b81811115612b7c576000602083870101525b50601f01601f19169290920160200192915050565b602081526000612adf6020830184612b44565b60008060408385031215612bb757600080fd5b50508035926020909101359150565b600082601f830112612bd757600080fd5b81356001600160401b03811115612bf057612bf061290a565b604051612c07601f8301601f191660200182612920565b818152846020838601011115612c1c57600080fd5b816020850160208301376000918101602001919091529392505050565b600080600080600060a08688031215612c5157600080fd5b8535612c5c816128c9565b94506020860135612c6c816128c9565b935060408601356001600160401b0380821115612c8857600080fd5b612c9489838a0161296f565b94506060880135915080821115612caa57600080fd5b612cb689838a0161296f565b93506080880135915080821115612ccc57600080fd5b50612cd988828901612bc6565b9150509295509295909350565b600081518084526020808501945080840160005b83811015612d1657815187529582019590820190600101612cfa565b509495945050505050565b602081526000612adf6020830184612ce6565b60008083601f840112612d4657600080fd5b5081356001600160401b03811115612d5d57600080fd5b6020830191508360208260051b8501011115610c9257600080fd5b60008060008060408587031215612d8e57600080fd5b84356001600160401b0380821115612da557600080fd5b612db188838901612d34565b90965094506020870135915080821115612dca57600080fd5b50612dd787828801612d34565b95989497509550505050565b600080600060608486031215612df857600080fd5b8335612e03816128c9565b925060208401356001600160401b0380821115612e1f57600080fd5b612e2b8783880161296f565b93506040860135915080821115612e4157600080fd5b50612e4e8682870161296f565b9150509250925092565b600080600060408486031215612e6d57600080fd5b8335925060208401356001600160401b03811115612e8a57600080fd5b612e9686828701612d34565b9497909650939450505050565b600060208284031215612eb557600080fd5b8135612adf816128c9565b60008060408385031215612ed357600080fd5b8235612ede816128c9565b915060208301358015158114612b2057600080fd5b600080600060408486031215612f0857600080fd5b8335612f13816128c9565b925060208401356001600160401b03811115612e8a57600080fd5b60008060408385031215612f4157600080fd5b8235612f4c816128c9565b91506020830135612b20816128c9565b600080600080600060a08688031215612f7457600080fd5b8535612f7f816128c9565b94506020860135612f8f816128c9565b9350604086013592506060860135915060808601356001600160401b03811115612fb857600080fd5b612cd988828901612bc6565b600080600060608486031215612fd957600080fd5b8335612fe4816128c9565b95602085013595506040909401359392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561306e5761306e613044565b5060010190565b600181811c9082168061308957607f821691505b602082108114156130aa57634e487b7160e01b600052602260045260246000fd5b50919050565b60008160001904831182151516156130ca576130ca613044565b500290565b6000826130ec57634e487b7160e01b600052601260045260246000fd5b500490565b60208082526018908201527f5468652063616c6c6572206973206120636f6e74726163740000000000000000604082015260600190565b60008282101561313a5761313a613044565b500390565b6000821982111561315257613152613044565b500190565b60208082526029908201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260408201526808185c1c1c9bdd995960ba1b606082015260800190565b60208082526028908201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206040820152670dad2e6dac2e8c6d60c31b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b60408152600061328a6040830185612ce6565b8281036020840152611a178185612ce6565b60208082526023908201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526024908201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604082015263616e636560e01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061334f90830186612ce6565b82810360608401526133618186612ce6565b905082810360808401526133758185612b44565b98975050505050505050565b60006020828403121561339357600080fd5b8151612adf81612aac565b600060033d11156133b75760046000803e5060005160e01c5b90565b600060443d10156133c85790565b6040516003193d81016004833e81513d6001600160401b0381602484011181841117156133f757505050505090565b828501915081518181111561340f5750505050505090565b843d87010160208285010111156134295750505050505090565b61343860208286010187612920565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906134c590830184612b44565b97965050505050505056fea264697066735822122036ac110e8bb884f34ee0e847c9760daa9e4032c811add3d518eff011a767001964736f6c634300080c0033
Verified Source Code Full Match
Compiler: v0.8.12+commit.f00d7308
EVM: london
Optimization: Yes (200 runs)
LaunchPass.sol 269 lines
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.12;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
/*
* ^
* / \
* / _ \
* |.ETH.| ██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗
* |'._.'| ██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║
* | | ██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║
* | S | ██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║
* | P | ███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║
* | A | ╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝
* | C |
* | E | ██████╗ █████╗ ███████╗███████╗
* | + | ██╔══██╗██╔══██╗██╔════╝██╔════╝
* || || ██████╔╝███████║███████╗███████╗
* .'| | |'. ██╔═══╝ ██╔══██║╚════██║╚════██║
* / | | | \ ██║ ██║ ██║███████║███████║
* |.-'--|--'-.| ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝
*/
interface ISpacePlusAvatar {
function transferLaunchPasses(address to, uint256 amountToRedeem) external;
}
contract LaunchPass is ERC1155, Ownable, ERC2981, ERC1155Burnable {
/**
* @dev Supply minted under token id 1 to keep burning simple.
*/
uint256 public constant TOKEN_ID = 1;
//==== AVATAR CONTRACT ====\\
address public avatarContractAddress;
//==== EVENTS ====\\
event Received(address, uint256);
//==== SUPPLY ====\\
uint256 public constant MAX_PASSES = 10921; // Circumference of the moon in km
uint256 public constant COMMUNITY_DEVELOPMENT = 250; // Passes reserved for giveaways and community development
uint256 public constant THE_TEAM = 225; // Will be airdropped to all those who helped make Space+ possible
uint256 public constant MAX_PER_AL_WALLET = 2; // Max number of passes a wallet in the allowlist can mint
uint256 public constant MAX_PER_PUBLIC_MINT = 5; // Max number of passes a wallet can mint during public sale
uint256 public devMintRemaining = 382; // Maximum possible dev mints, but may not mint out before the dev mint window closes
//==== PRICE ====\\
uint256 public tokenPrice = 170000000000000000; // 0.17 ETH
//==== CONTRACT STATE ====\\
uint256 public mintCount;
bool public isAllowlistMintOpen;
bool public isDevMintOpen;
bool public isPublicMintOpen;
bool public isRedemptionEnabled;
//==== ROYALTIES ====\\
uint96 public royaltyFee = 750; // Royalty percentage is 7.5%
address public royaltyAddress;
//==== ALLOWLIST ====\\
bytes32 public merkleRoot;
mapping(address => uint256) public allowlistMinted;
/**
* @dev Record of reserved mints remaining per wallet for developers.
*/
mapping(address => uint256) public devMintList;
constructor() ERC1155("ipfs://bafkreig26hjqlvrv6rq2jh5alvtnwvxxxgxjv7whvs5gup6utu3ekbpv2q") {
royaltyAddress = owner();
_setDefaultRoyalty(royaltyAddress, royaltyFee);
}
/**
* @notice Modifier that only allows the caller to be an externally owned account, not a contract.
*/
modifier onlyEoa() {
require(tx.origin == msg.sender, "The caller is a contract");
_;
}
/**
* @notice Allows minting of up to two passes, for eligible allowlist wallets.
*/
function allowlistMint(uint256 amountToMint, bytes32[] calldata merkleProof) external payable onlyEoa {
require(isAllowlistMintOpen, "Allowlist mint not open");
require(amountToMint > 0 && amountToMint <= MAX_PER_AL_WALLET, "Amount must be 1 or 2");
require(allowlistMinted[msg.sender] + amountToMint <= MAX_PER_AL_WALLET, "Exceeds wallet allowance");
bytes32 leaf = keccak256(abi.encodePacked(msg.sender));
require(MerkleProof.verify(merkleProof, merkleRoot, leaf), "Address not found in allowlist");
allowlistMinted[msg.sender] += amountToMint;
_internalMint(amountToMint);
}
/**
* @notice Allows eligible developers to mint.
*/
function devMint(uint256 amountToMint) external payable onlyEoa {
require(isDevMintOpen, "Developer mint not open");
require(devMintList[msg.sender] > 0, "Not eligible for dev mint");
require(devMintRemaining >= amountToMint, "Exceeds dev supply limit");
require(amountToMint <= devMintList[msg.sender], "Exceeds dev wallet's allotted amount");
devMintList[msg.sender] -= amountToMint;
devMintRemaining -= amountToMint;
_internalMint(amountToMint);
}
/**
* @notice Allows the public to mint.
*/
function publicMint(uint256 amountToMint) external payable onlyEoa {
require(isPublicMintOpen, "Public mint not open");
require(amountToMint > 0 && amountToMint < 6, "1 to 5 tokens per transaction");
_internalMint(amountToMint);
}
/**
* @notice Handles minting for allowlistMint, devMint, and publicMint.
*/
function _internalMint(uint256 amountToMint) internal {
require(amountToMint + mintCount + COMMUNITY_DEVELOPMENT <= MAX_PASSES, "Mint will exceed total supply");
require(msg.value == tokenPrice * amountToMint, "ETH sent must be equal to mint price");
mintCount += amountToMint;
_mint(msg.sender, TOKEN_ID, amountToMint, "");
}
/**
* @notice Exchanges Launch Pass tokens for Space+ Avatars. Launch Passes are burned in the process.
*/
function redeemTokens(uint256 amountToRedeem) external onlyEoa {
require(isRedemptionEnabled, "Redemption period not enabled");
require(amountToRedeem > 0 && amountToRedeem <= balanceOf(msg.sender, 1), "Amount must be between 1 and tokens owned");
ISpacePlusAvatar avatarContract = ISpacePlusAvatar(avatarContractAddress);
// Burn launch pass token
burn(msg.sender, TOKEN_ID, amountToRedeem);
// Mint avatar in separate contract
avatarContract.transferLaunchPasses(msg.sender, amountToRedeem);
}
/**
* @notice For gifting Launch Pass tokens.
*/
function airdrop(address[] calldata to, uint256[] calldata amountToMint) external onlyOwner {
require(to.length == amountToMint.length, "Addresses length does not match amountToMint length");
uint256 tokenCount = mintCount;
for (uint256 i = 0; i < to.length; i++) {
require(amountToMint[i] + tokenCount <= MAX_PASSES, "Mint will exceed total supply");
tokenCount += amountToMint[i];
_mint(to[i], TOKEN_ID, amountToMint[i], "");
}
mintCount = tokenCount;
}
/**
* @notice Seeds the developer list with max mint amount by address.
*/
function seedDevList(address[] memory addresses, uint256[] memory mintAmounts) external onlyOwner {
require(addresses.length == mintAmounts.length, "Addresses length does not match mintAmounts length");
for (uint256 i = 0; i < addresses.length; i++) {
devMintList[addresses[i]] = mintAmounts[i];
}
}
/**
* @notice Stores the Space+ Avatar contract address, used during Launch Pass to Avatar migration.
*/
function setSpacePlusAvatarContract(address contractAddress) external onlyOwner {
avatarContractAddress = contractAddress;
}
/**
* @notice Sets the merkle root for the allowlist mint.
*/
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
merkleRoot = _merkleRoot;
}
/**
* @notice Verifies wallet address eligibility for the allowlist mint.
*/
function isAllowlistEligible(address wallet, bytes32[] calldata merkleProof) external view returns (bool) {
bytes32 leaf = keccak256(abi.encodePacked(wallet));
return MerkleProof.verify(merkleProof, merkleRoot, leaf);
}
/**
* @notice Updates price if necessary.
*/
function setPrice(uint256 newPrice) external onlyOwner {
tokenPrice = newPrice;
}
/**
* @notice Toggles the allowlist mint.
*/
function toggleAllowlistMint() external onlyOwner {
require(merkleRoot != "", "Empty merkle root");
isAllowlistMintOpen = !isAllowlistMintOpen;
}
/**
* @notice Toggles the developer mint.
*/
function toggleDevMint() external onlyOwner {
isDevMintOpen = !isDevMintOpen;
}
/**
* @notice Toggles the public mint.
*/
function togglePublicMint() external onlyOwner {
require(!isAllowlistMintOpen && !isDevMintOpen, "All other mints must be closed");
isPublicMintOpen = !isPublicMintOpen;
}
/**
* @notice Toggles the migration period for redeeming a Launch Pass for an Avatar.
*/
function toggleRedemptionPeriod() external onlyOwner {
require(avatarContractAddress != address(0), "Missing Avatar contract");
isRedemptionEnabled = !isRedemptionEnabled;
}
/**
* @notice Sets the royalty information that all ids in this contract will default to.
*/
function setRoyaltyInfo(address receiver, uint96 feeNumerator) external onlyOwner {
royaltyAddress = receiver;
royaltyFee = feeNumerator;
_setDefaultRoyalty(receiver, feeNumerator);
}
/**
* @notice Withdraws funds from the contract.
*/
function withdraw(address payable to, uint256 amount) external onlyOwner {
(bool success, ) = to.call{value: amount}("");
require(success, "Withdraw failed");
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view override(ERC1155, ERC2981) returns (bool) {
return super.supportsInterface(interfaceId);
}
/**
* @notice Allows contract to receive funds.
*/
receive() external payable {
emit Received(msg.sender, msg.value);
}
}
Address.sol 222 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 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
* ====
*
* [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 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);
}
}
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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;
}
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @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);
}
}
IERC165.sol 6 lines
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
IERC2981.sol 25 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "./IERC165.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 IERC2981 is IERC165 {
/**
* @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 payed in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
ERC2981.sol 118 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.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 ERC2981 is IERC2981, ERC165 {
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(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
external
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];
}
}
ERC1155.sol 464 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)
pragma solidity ^0.8.0;
import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the basic standard multi-token.
* See https://eips.ethereum.org/EIPS/eip-1155
* Originally based on code by Enjin: https://github.com/enjin/erc-1155
*
* _Available since v3.1._
*/
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
using Address for address;
// Mapping from token ID to account balances
mapping(uint256 => mapping(address => uint256)) private _balances;
// Mapping from account to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
string private _uri;
/**
* @dev See {_setURI}.
*/
constructor(string memory uri_) {
_setURI(uri_);
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC1155).interfaceId ||
interfaceId == type(IERC1155MetadataURI).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC1155MetadataURI-uri}.
*
* This implementation returns the same URI for *all* token types. It relies
* on the token type ID substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* Clients calling this function must replace the `\{id\}` substring with the
* actual token type ID.
*/
function uri(uint256) public view virtual override returns (string memory) {
return _uri;
}
/**
* @dev See {IERC1155-balanceOf}.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
require(account != address(0), "ERC1155: balance query for the zero address");
return _balances[id][account];
}
/**
* @dev See {IERC1155-balanceOfBatch}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
public
view
virtual
override
returns (uint256[] memory)
{
require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch");
uint256[] memory batchBalances = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; ++i) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
}
return batchBalances;
}
/**
* @dev See {IERC1155-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC1155-isApprovedForAll}.
*/
function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {
return _operatorApprovals[account][operator];
}
/**
* @dev See {IERC1155-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_safeTransferFrom(from, to, id, amount, data);
}
/**
* @dev See {IERC1155-safeBatchTransferFrom}.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) public virtual override {
require(
from == _msgSender() || isApprovedForAll(from, _msgSender()),
"ERC1155: transfer caller is not owner nor approved"
);
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
emit TransferSingle(operator, from, to, id, amount);
_doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _safeBatchTransferFrom(
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
require(to != address(0), "ERC1155: transfer to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; ++i) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
unchecked {
_balances[id][from] = fromBalance - amount;
}
_balances[id][to] += amount;
}
emit TransferBatch(operator, from, to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
}
/**
* @dev Sets a new URI for all token types, by relying on the token type ID
* substitution mechanism
* https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
*
* By this mechanism, any occurrence of the `\{id\}` substring in either the
* URI or any of the amounts in the JSON file at said URI will be replaced by
* clients with the token type ID.
*
* For example, the `https://token-cdn-domain/\{id\}.json` URI would be
* interpreted by clients as
* `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
* for token type ID 0x4cce0.
*
* See {uri}.
*
* Because these URIs cannot be meaningfully represented by the {URI} event,
* this function emits no events.
*/
function _setURI(string memory newuri) internal virtual {
_uri = newuri;
}
/**
* @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function _mintBatch(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
require(to != address(0), "ERC1155: mint to the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
for (uint256 i = 0; i < ids.length; i++) {
_balances[ids[i]][to] += amounts[i];
}
emit TransferBatch(operator, address(0), to, ids, amounts);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `from` must have at least `amount` tokens of token type `id`.
*/
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
emit TransferSingle(operator, from, address(0), id, amount);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
*/
function _burnBatch(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
require(from != address(0), "ERC1155: burn from the zero address");
require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
address operator = _msgSender();
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
uint256 amount = amounts[i];
uint256 fromBalance = _balances[id][from];
require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
unchecked {
_balances[id][from] = fromBalance - amount;
}
}
emit TransferBatch(operator, from, address(0), ids, amounts);
}
/**
* @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, "ERC1155: setting approval status for self");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning, as well as batched variants.
*
* The same hook is called on both single and batched variants. For single
* transfers, the length of the `id` and `amount` arrays will be 1.
*
* Calling conditions (for each `id` and `amount` pair):
*
* - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* of token type `id` will be transferred to `to`.
* - When `from` is zero, `amount` tokens of token type `id` will be minted
* for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
* will be burned.
* - `from` and `to` are never both zero.
* - `ids` and `amounts` have the same, non-zero length.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {}
function _doSafeTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
if (response != IERC1155Receiver.onERC1155Received.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _doSafeBatchTransferAcceptanceCheck(
address operator,
address from,
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) private {
if (to.isContract()) {
try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
bytes4 response
) {
if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
revert("ERC1155: ERC1155Receiver rejected tokens");
}
} catch Error(string memory reason) {
revert(reason);
} catch {
revert("ERC1155: transfer to non ERC1155Receiver implementer");
}
}
}
function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
uint256[] memory array = new uint256[](1);
array[0] = element;
return array;
}
}
IERC1155.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC1155 compliant contract, as defined in the
* https://eips.ethereum.org/EIPS/eip-1155[EIP].
*
* _Available since v3.1._
*/
interface IERC1155 is IERC165 {
/**
* @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
*/
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
/**
* @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
* transfers.
*/
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
/**
* @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
* `approved`.
*/
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
/**
* @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
*
* If an {URI} event was emitted for `id`, the standard
* https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
* returned by {IERC1155MetadataURI-uri}.
*/
event URI(string value, uint256 indexed id);
/**
* @dev Returns the amount of tokens of token type `id` owned by `account`.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function balanceOf(address account, uint256 id) external view returns (uint256);
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
*
* Requirements:
*
* - `accounts` and `ids` must have the same length.
*/
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
/**
* @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
*
* Emits an {ApprovalForAll} event.
*
* Requirements:
*
* - `operator` cannot be the caller.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address account, address operator) external view returns (bool);
/**
* @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
*
* Emits a {TransferSingle} event.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
* - `from` must have a balance of tokens of type `id` of at least `amount`.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
* acceptance magic value.
*/
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
*
* Emits a {TransferBatch} event.
*
* Requirements:
*
* - `ids` and `amounts` must have the same length.
* - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
* acceptance magic value.
*/
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
ERC165.sol 29 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.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 ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
IERC165.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 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);
}
IERC1155Receiver.sol 58 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev _Available since v3.1._
*/
interface IERC1155Receiver is IERC165 {
/**
* @dev Handles the receipt of a single ERC1155 token type. This function is
* called at the end of a `safeTransferFrom` after the balance has been updated.
*
* NOTE: To accept the transfer, this must return
* `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
* (i.e. 0xf23a6e61, or its own function selector).
*
* @param operator The address which initiated the transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param id The ID of the token being transferred
* @param value The amount of tokens being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
*/
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
/**
* @dev Handles the receipt of a multiple ERC1155 token types. This function
* is called at the end of a `safeBatchTransferFrom` after the balances have
* been updated.
*
* NOTE: To accept the transfer(s), this must return
* `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
* (i.e. 0xbc197c81, or its own function selector).
*
* @param operator The address which initiated the batch transfer (i.e. msg.sender)
* @param from The address which previously owned the token
* @param ids An array containing ids of each token being transferred (order and length must match values array)
* @param values An array containing amounts of each token being transferred (order and length must match ids array)
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
*/
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
MerkleProof.sol 60 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.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 = _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)
}
}
}
ERC1155Burnable.sol 40 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Burnable.sol)
pragma solidity ^0.8.0;
import "../ERC1155.sol";
/**
* @dev Extension of {ERC1155} that allows token holders to destroy both their
* own tokens and those that they have been approved to use.
*
* _Available since v3.1._
*/
abstract contract ERC1155Burnable is ERC1155 {
function burn(
address account,
uint256 id,
uint256 value
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burn(account, id, value);
}
function burnBatch(
address account,
uint256[] memory ids,
uint256[] memory values
) public virtual {
require(
account == _msgSender() || isApprovedForAll(account, _msgSender()),
"ERC1155: caller is not owner nor approved"
);
_burnBatch(account, ids, values);
}
}
IERC1155MetadataURI.sol 22 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)
pragma solidity ^0.8.0;
import "../IERC1155.sol";
/**
* @dev Interface of the optional ERC1155MetadataExtension interface, as defined
* in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
*
* _Available since v3.1._
*/
interface IERC1155MetadataURI is IERC1155 {
/**
* @dev Returns the URI for token type `id`.
*
* If the `\{id\}` substring is present in the URI, it must be replaced by
* clients with the actual token type ID.
*/
function uri(uint256 id) external view returns (string memory);
}
Read Contract
COMMUNITY_DEVELOPMENT 0x02f73b2b → uint256
MAX_PASSES 0x5def2d7c → uint256
MAX_PER_AL_WALLET 0x95a61357 → uint256
MAX_PER_PUBLIC_MINT 0xa5e47bbc → uint256
THE_TEAM 0xa9d34837 → uint256
TOKEN_ID 0x89a89002 → uint256
allowlistMinted 0xe81ed044 → uint256
avatarContractAddress 0xd86bd3f8 → address
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
devMintList 0xc2576d64 → uint256
devMintRemaining 0x134c42f0 → uint256
isAllowlistEligible 0xb7069109 → bool
isAllowlistMintOpen 0x5a527946 → bool
isApprovedForAll 0xe985e9c5 → bool
isDevMintOpen 0x2ac3822f → bool
isPublicMintOpen 0xa4435dfd → bool
isRedemptionEnabled 0x4ccdb6ff → bool
merkleRoot 0x2eb4a7ab → bytes32
mintCount 0x9659867e → uint256
owner 0x8da5cb5b → address
royaltyAddress 0xad2f852a → address
royaltyFee 0xb8997a97 → uint96
royaltyInfo 0x2a55205a → address, uint256
supportsInterface 0x01ffc9a7 → bool
tokenPrice 0x7ff9b596 → uint256
uri 0x0e89341c → string
Write Contract 22 functions
These functions modify contract state and require a wallet transaction to execute.
airdrop 0x67243482
address[] to
uint256[] amountToMint
allowlistMint 0x7bc9200e
uint256 amountToMint
bytes32[] merkleProof
burn 0xf5298aca
address account
uint256 id
uint256 value
burnBatch 0x6b20c454
address account
uint256[] ids
uint256[] values
devMint 0x375a069a
uint256 amountToMint
publicMint 0x2db11544
uint256 amountToMint
redeemTokens 0xa6e158f8
uint256 amountToRedeem
renounceOwnership 0x715018a6
No parameters
safeBatchTransferFrom 0x2eb2c2d6
address from
address to
uint256[] ids
uint256[] amounts
bytes data
safeTransferFrom 0xf242432a
address from
address to
uint256 id
uint256 amount
bytes data
seedDevList 0x01195d52
address[] addresses
uint256[] mintAmounts
setApprovalForAll 0xa22cb465
address operator
bool approved
setMerkleRoot 0x7cb64759
bytes32 _merkleRoot
setPrice 0x91b7f5ed
uint256 newPrice
setRoyaltyInfo 0x02fa7c47
address receiver
uint96 feeNumerator
setSpacePlusAvatarContract 0x97666c1e
address contractAddress
toggleAllowlistMint 0x8f2cbdd1
No parameters
toggleDevMint 0x318f1552
No parameters
togglePublicMint 0x4047638d
No parameters
toggleRedemptionPeriod 0x44555a36
No parameters
transferOwnership 0xf2fde38b
address newOwner
withdraw 0xf3fef3a3
address to
uint256 amount
Recent Transactions
No transactions found for this address