Address Contract Verified
Address
0x0Dc71D22bDD4a9EB4b422A5FA0Fffa772ea38434
Balance
0.012600 ETH
Nonce
1
Code Size
16290 bytes
Creator
0xECae2bF6...a356 at tx 0x29a88dc6...6412c8
Indexed Transactions
0
Contract Bytecode
16290 bytes
0x6080604052600436106101695760003560e01c8063715018a6116100d1578063ab377daa1161008a578063f23a6e6111610064578063f23a6e6114610518578063f242432a14610555578063f2fde38b1461057e578063fe96d7a4146105a757610170565b8063ab377daa14610460578063bc197c811461049e578063e985e9c5146104db57610170565b8063715018a6146103885780638da5cb5b1461039f5780638e021c06146103ca57806395d89b41146103e1578063a17129b21461040c578063a22cb4651461043757610170565b806318160ddd1161012357806318160ddd146102995780632eb2c2d6146102c4578063385f134e146102ed578063388b9fe0146103185780634e1273f41461034157806363bd1d4a1461037e57610170565b8062fdd58e1461017257806301ffc9a7146101af57806302fe5305146101ec57806306fdde03146102155780630e89341c14610240578063156e29f61461027d57610170565b3661017057005b005b34801561017e57600080fd5b5061019960048036038101906101949190612454565b6105d2565b6040516101a691906124a3565b60405180910390f35b3480156101bb57600080fd5b506101d660048036038101906101d19190612516565b61069a565b6040516101e3919061255e565b60405180910390f35b3480156101f857600080fd5b50610213600480360381019061020e91906126bf565b6106ac565b005b34801561022157600080fd5b5061022a610716565b6040516102379190612787565b60405180910390f35b34801561024c57600080fd5b50610267600480360381019061026291906127a9565b6107a4565b6040516102749190612787565b60405180910390f35b610297600480360381019061029291906127d6565b610838565b005b3480156102a557600080fd5b506102ae6109d1565b6040516102bb91906124a3565b60405180910390f35b3480156102d057600080fd5b506102eb60048036038101906102e69190612992565b610a35565b005b3480156102f957600080fd5b50610302610ad6565b60405161030f9190612b1f565b60405180910390f35b34801561032457600080fd5b5061033f600480360381019061033a91906127d6565b610b2e565b005b34801561034d57600080fd5b5061036860048036038101906103639190612c04565b610c58565b6040516103759190612b1f565b60405180910390f35b610386610d71565b005b34801561039457600080fd5b5061039d610fac565b005b3480156103ab57600080fd5b506103b4610fc0565b6040516103c19190612c8b565b60405180910390f35b3480156103d657600080fd5b506103df610fea565b005b3480156103ed57600080fd5b506103f661100f565b6040516104039190612787565b60405180910390f35b34801561041857600080fd5b5061042161109d565b60405161042e9190612b1f565b60405180910390f35b34801561044357600080fd5b5061045e60048036038101906104599190612cd2565b6110f5565b005b34801561046c57600080fd5b50610487600480360381019061048291906127a9565b61110b565b604051610495929190612d33565b60405180910390f35b3480156104aa57600080fd5b506104c560048036038101906104c09190612992565b61115f565b6040516104d29190612d6b565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612d86565b611174565b60405161050f919061255e565b60405180910390f35b34801561052457600080fd5b5061053f600480360381019061053a9190612dc6565b611208565b60405161054c9190612d6b565b60405180910390f35b34801561056157600080fd5b5061057c60048036038101906105779190612dc6565b61121d565b005b34801561058a57600080fd5b506105a560048036038101906105a09190612e5d565b6112be565b005b3480156105b357600080fd5b506105bc611341565b6040516105c9919061255e565b60405180910390f35b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610642576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063990612efc565b60405180910390fd5b60008083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60006106a582611354565b9050919050565b6106b46113ce565b60001515600460149054906101000a900460ff1615151461070a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070190612f8e565b60405180910390fd5b6107138161144c565b50565b6005805461072390612fdd565b80601f016020809104026020016040519081016040528092919081815260200182805461074f90612fdd565b801561079c5780601f106107715761010080835404028352916020019161079c565b820191906000526020600020905b81548152906001019060200180831161077f57829003601f168201915b505050505081565b6060600280546107b390612fdd565b80601f01602080910402602001604051908101604052809291908181526020018280546107df90612fdd565b801561082c5780601f106108015761010080835404028352916020019161082c565b820191906000526020600020905b81548152906001019060200180831161080f57829003601f168201915b50505050509050919050565b60008211801561084d57506007805490508211155b61088c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108839061305a565b60405180910390fd5b80600760018461089c91906130a9565b815481106108ad576108ac6130dd565b5b90600052602060002001546108c2919061310c565b3414610903576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108fa9061319a565b60405180910390fd5b600860018361091291906130a9565b81548110610923576109226130dd565b5b9060005260206000200154811115610970576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096790613206565b60405180910390fd5b61098b8383836040518060200160405280600081525061145f565b80600860018461099b91906130a9565b815481106109ac576109ab6130dd565b5b9060005260206000200160008282546109c591906130a9565b92505081905550505050565b6000806000905060005b6008805490508160ff161015610a2d5760088160ff1681548110610a0257610a016130dd565b5b906000526020600020015482610a189190613226565b91508080610a2590613267565b9150506109db565b508091505090565b610a3d61160f565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480610a835750610a8285610a7d61160f565b611174565b5b610ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab990613302565b60405180910390fd5b610acf8585858585611617565b5050505050565b60606007805480602002602001604051908101604052809291908181526020018280548015610b2457602002820191906000526020600020905b815481526020019060010190808311610b10575b5050505050905090565b610b366113ce565b600082118015610b4b57506007805490508211155b610b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b819061305a565b60405180910390fd5b6008600183610b9991906130a9565b81548110610baa57610ba96130dd565b5b9060005260206000200154811115610bf7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bee90613206565b60405180910390fd5b610c128383836040518060200160405280600081525061145f565b806008600184610c2291906130a9565b81548110610c3357610c326130dd565b5b906000526020600020016000828254610c4c91906130a9565b92505081905550505050565b60608151835114610c9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9590613394565b60405180910390fd5b6000835167ffffffffffffffff811115610cbb57610cba612594565b5b604051908082528060200260200182016040528015610ce95781602001602082028036833780820191505090505b50905060005b8451811015610d6657610d36858281518110610d0e57610d0d6130dd565b5b6020026020010151858381518110610d2957610d286130dd565b5b60200260200101516105d2565b828281518110610d4957610d486130dd565b5b60200260200101818152505080610d5f906133b4565b9050610cef565b508091505092915050565b60004711610db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dab90613448565b60405180910390fd5b600047905060005b600380549050811015610fa857600061271061ffff1660038381548110610de657610de56130dd565b5b90600052602060002090600202016000015484610e03919061310c565b610e0d9190613497565b9050600060038381548110610e2557610e246130dd565b5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682604051610e7a906134f9565b60006040518083038185875af1925050503d8060008114610eb7576040519150601f19603f3d011682016040523d82523d6000602084013e610ebc565b606091505b5050905080610f00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ef79061355a565b60405180910390fd5b60038381548110610f1457610f136130dd565b5b906000526020600020906002020160010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5afeca38b2064c23a692c4cf353015d80ab3ecc417b4f893f372690c11fbd9a683604051610f8b91906124a3565b60405180910390a250508080610fa0906133b4565b915050610dbc565b5050565b610fb46113ce565b610fbe6000611938565b565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ff26113ce565b6001600460146101000a81548160ff021916908315150217905550565b6006805461101c90612fdd565b80601f016020809104026020016040519081016040528092919081815260200182805461104890612fdd565b80156110955780601f1061106a57610100808354040283529160200191611095565b820191906000526020600020905b81548152906001019060200180831161107857829003601f168201915b505050505081565b606060088054806020026020016040519081016040528092919081815260200182805480156110eb57602002820191906000526020600020905b8154815260200190600101908083116110d7575b5050505050905090565b61110761110061160f565b83836119fe565b5050565b6003818154811061111b57600080fd5b90600052602060002090600202016000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905082565b600063bc197c8160e01b905095945050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600063f23a6e6160e01b905095945050505050565b61122561160f565b73ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16148061126b575061126a8561126561160f565b611174565b5b6112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a190613302565b60405180910390fd5b6112b78585858585611b6a565b5050505050565b6112c66113ce565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611335576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132c906135ec565b60405180910390fd5b61133e81611938565b50565b600460149054906101000a900460ff1681565b60007f4e2312e0000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806113c757506113c682611e05565b5b9050919050565b6113d661160f565b73ffffffffffffffffffffffffffffffffffffffff166113f4610fc0565b73ffffffffffffffffffffffffffffffffffffffff161461144a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161144190613658565b60405180910390fd5b565b806002908161145b9190613824565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036114ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c590613968565b60405180910390fd5b60006114d861160f565b905060006114e585611ee7565b905060006114f285611ee7565b905061150383600089858589611f61565b8460008088815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115629190613226565b925050819055508673ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6289896040516115e0929190613988565b60405180910390a46115f783600089858589611f69565b61160683600089898989611f71565b50505050505050565b600033905090565b815183511461165b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165290613a23565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036116ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116c190613ab5565b60405180910390fd5b60006116d461160f565b90506116e4818787878787611f61565b60005b8451811015611895576000858281518110611705576117046130dd565b5b602002602001015190506000858381518110611724576117236130dd565b5b60200260200101519050600080600084815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156117c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117bc90613b47565b60405180910390fd5b81810360008085815260200190815260200160002060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160008085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461187a9190613226565b925050819055505050508061188e906133b4565b90506116e7565b508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb878760405161190c929190613b67565b60405180910390a4611922818787878787611f69565b611930818787878787612148565b505050505050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611a6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6390613c10565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611b5d919061255e565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611bd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd090613ab5565b60405180910390fd5b6000611be361160f565b90506000611bf085611ee7565b90506000611bfd85611ee7565b9050611c0d838989858589611f61565b600080600088815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905085811015611ca4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9b90613b47565b60405180910390fd5b85810360008089815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560008089815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611d599190613226565b925050819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628a8a604051611dd6929190613988565b60405180910390a4611dec848a8a86868a611f69565b611dfa848a8a8a8a8a611f71565b505050505050505050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611ed057507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80611ee05750611edf8261231f565b5b9050919050565b60606000600167ffffffffffffffff811115611f0657611f05612594565b5b604051908082528060200260200182016040528015611f345781602001602082028036833780820191505090505b5090508281600081518110611f4c57611f4b6130dd565b5b60200260200101818152505080915050919050565b505050505050565b505050505050565b611f908473ffffffffffffffffffffffffffffffffffffffff16612389565b15612140578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b8152600401611fd6959493929190613c85565b6020604051808303816000875af192505050801561201257506040513d601f19601f8201168201806040525081019061200f9190613cf4565b60015b6120b75761201e613d2e565b806308c379a00361207a5750612032613d50565b8061203d575061207c565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120719190612787565b60405180910390fd5b505b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ae90613e52565b60405180910390fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161461213e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161213590613ee4565b60405180910390fd5b505b505050505050565b6121678473ffffffffffffffffffffffffffffffffffffffff16612389565b15612317578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b81526004016121ad959493929190613f04565b6020604051808303816000875af19250505080156121e957506040513d601f19601f820116820180604052508101906121e69190613cf4565b60015b61228e576121f5613d2e565b806308c379a0036122515750612209613d50565b806122145750612253565b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122489190612787565b60405180910390fd5b505b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228590613e52565b60405180910390fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614612315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161230c90613ee4565b60405180910390fd5b505b505050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006123eb826123c0565b9050919050565b6123fb816123e0565b811461240657600080fd5b50565b600081359050612418816123f2565b92915050565b6000819050919050565b6124318161241e565b811461243c57600080fd5b50565b60008135905061244e81612428565b92915050565b6000806040838503121561246b5761246a6123b6565b5b600061247985828601612409565b925050602061248a8582860161243f565b9150509250929050565b61249d8161241e565b82525050565b60006020820190506124b86000830184612494565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6124f3816124be565b81146124fe57600080fd5b50565b600081359050612510816124ea565b92915050565b60006020828403121561252c5761252b6123b6565b5b600061253a84828501612501565b91505092915050565b60008115159050919050565b61255881612543565b82525050565b6000602082019050612573600083018461254f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6125cc82612583565b810181811067ffffffffffffffff821117156125eb576125ea612594565b5b80604052505050565b60006125fe6123ac565b905061260a82826125c3565b919050565b600067ffffffffffffffff82111561262a57612629612594565b5b61263382612583565b9050602081019050919050565b82818337600083830152505050565b600061266261265d8461260f565b6125f4565b90508281526020810184848401111561267e5761267d61257e565b5b612689848285612640565b509392505050565b600082601f8301126126a6576126a5612579565b5b81356126b684826020860161264f565b91505092915050565b6000602082840312156126d5576126d46123b6565b5b600082013567ffffffffffffffff8111156126f3576126f26123bb565b5b6126ff84828501612691565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612742578082015181840152602081019050612727565b60008484015250505050565b600061275982612708565b6127638185612713565b9350612773818560208601612724565b61277c81612583565b840191505092915050565b600060208201905081810360008301526127a1818461274e565b905092915050565b6000602082840312156127bf576127be6123b6565b5b60006127cd8482850161243f565b91505092915050565b6000806000606084860312156127ef576127ee6123b6565b5b60006127fd86828701612409565b935050602061280e8682870161243f565b925050604061281f8682870161243f565b9150509250925092565b600067ffffffffffffffff82111561284457612843612594565b5b602082029050602081019050919050565b600080fd5b600061286d61286884612829565b6125f4565b905080838252602082019050602084028301858111156128905761288f612855565b5b835b818110156128b957806128a5888261243f565b845260208401935050602081019050612892565b5050509392505050565b600082601f8301126128d8576128d7612579565b5b81356128e884826020860161285a565b91505092915050565b600067ffffffffffffffff82111561290c5761290b612594565b5b61291582612583565b9050602081019050919050565b6000612935612930846128f1565b6125f4565b9050828152602081018484840111156129515761295061257e565b5b61295c848285612640565b509392505050565b600082601f83011261297957612978612579565b5b8135612989848260208601612922565b91505092915050565b600080600080600060a086880312156129ae576129ad6123b6565b5b60006129bc88828901612409565b95505060206129cd88828901612409565b945050604086013567ffffffffffffffff8111156129ee576129ed6123bb565b5b6129fa888289016128c3565b935050606086013567ffffffffffffffff811115612a1b57612a1a6123bb565b5b612a27888289016128c3565b925050608086013567ffffffffffffffff811115612a4857612a476123bb565b5b612a5488828901612964565b9150509295509295909350565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612a968161241e565b82525050565b6000612aa88383612a8d565b60208301905092915050565b6000602082019050919050565b6000612acc82612a61565b612ad68185612a6c565b9350612ae183612a7d565b8060005b83811015612b12578151612af98882612a9c565b9750612b0483612ab4565b925050600181019050612ae5565b5085935050505092915050565b60006020820190508181036000830152612b398184612ac1565b905092915050565b600067ffffffffffffffff821115612b5c57612b5b612594565b5b602082029050602081019050919050565b6000612b80612b7b84612b41565b6125f4565b90508083825260208201905060208402830185811115612ba357612ba2612855565b5b835b81811015612bcc5780612bb88882612409565b845260208401935050602081019050612ba5565b5050509392505050565b600082601f830112612beb57612bea612579565b5b8135612bfb848260208601612b6d565b91505092915050565b60008060408385031215612c1b57612c1a6123b6565b5b600083013567ffffffffffffffff811115612c3957612c386123bb565b5b612c4585828601612bd6565b925050602083013567ffffffffffffffff811115612c6657612c656123bb565b5b612c72858286016128c3565b9150509250929050565b612c85816123e0565b82525050565b6000602082019050612ca06000830184612c7c565b92915050565b612caf81612543565b8114612cba57600080fd5b50565b600081359050612ccc81612ca6565b92915050565b60008060408385031215612ce957612ce86123b6565b5b6000612cf785828601612409565b9250506020612d0885828601612cbd565b9150509250929050565b6000612d1d826123c0565b9050919050565b612d2d81612d12565b82525050565b6000604082019050612d486000830185612494565b612d556020830184612d24565b9392505050565b612d65816124be565b82525050565b6000602082019050612d806000830184612d5c565b92915050565b60008060408385031215612d9d57612d9c6123b6565b5b6000612dab85828601612409565b9250506020612dbc85828601612409565b9150509250929050565b600080600080600060a08688031215612de257612de16123b6565b5b6000612df088828901612409565b9550506020612e0188828901612409565b9450506040612e128882890161243f565b9350506060612e238882890161243f565b925050608086013567ffffffffffffffff811115612e4457612e436123bb565b5b612e5088828901612964565b9150509295509295909350565b600060208284031215612e7357612e726123b6565b5b6000612e8184828501612409565b91505092915050565b7f455243313135353a2061646472657373207a65726f206973206e6f742061207660008201527f616c6964206f776e657200000000000000000000000000000000000000000000602082015250565b6000612ee6602a83612713565b9150612ef182612e8a565b604082019050919050565b60006020820190508181036000830152612f1581612ed9565b9050919050565b7f555249206973206c6f636b65642e2043616e6e6f74207365742074686520626160008201527f7365205552490000000000000000000000000000000000000000000000000000602082015250565b6000612f78602683612713565b9150612f8382612f1c565b604082019050919050565b60006020820190508181036000830152612fa781612f6b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680612ff557607f821691505b60208210810361300857613007612fae565b5b50919050565b7f546f6b656e206e6f7420617661696c61626c6520666f72206d696e74696e6700600082015250565b6000613044601f83612713565b915061304f8261300e565b602082019050919050565b6000602082019050818103600083015261307381613037565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006130b48261241e565b91506130bf8361241e565b92508282039050818111156130d7576130d661307a565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006131178261241e565b91506131228361241e565b92508282026131308161241e565b915082820484148315176131475761314661307a565b5b5092915050565b7f57726f6e67206d696e74696e6720666565000000000000000000000000000000600082015250565b6000613184601183612713565b915061318f8261314e565b602082019050919050565b600060208201905081810360008301526131b381613177565b9050919050565b7f4e6f7420656e6f75676820737570706c79206f66207468697320746f6b656e00600082015250565b60006131f0601f83612713565b91506131fb826131ba565b602082019050919050565b6000602082019050818103600083015261321f816131e3565b9050919050565b60006132318261241e565b915061323c8361241e565b92508282019050808211156132545761325361307a565b5b92915050565b600060ff82169050919050565b60006132728261325a565b915060ff82036132855761328461307a565b5b600182019050919050565b7f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60008201527f6572206f7220617070726f766564000000000000000000000000000000000000602082015250565b60006132ec602e83612713565b91506132f782613290565b604082019050919050565b6000602082019050818103600083015261331b816132df565b9050919050565b7f455243313135353a206163636f756e747320616e6420696473206c656e67746860008201527f206d69736d617463680000000000000000000000000000000000000000000000602082015250565b600061337e602983612713565b915061338982613322565b604082019050919050565b600060208201905081810360008301526133ad81613371565b9050919050565b60006133bf8261241e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036133f1576133f061307a565b5b600182019050919050565b7f436f6e74726163742062616c616e636520697320300000000000000000000000600082015250565b6000613432601583612713565b915061343d826133fc565b602082019050919050565b6000602082019050818103600083015261346181613425565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006134a28261241e565b91506134ad8361241e565b9250826134bd576134bc613468565b5b828204905092915050565b600081905092915050565b50565b60006134e36000836134c8565b91506134ee826134d3565b600082019050919050565b6000613504826134d6565b9150819050919050565b7f5472616e73666572206661696c65642e00000000000000000000000000000000600082015250565b6000613544601083612713565b915061354f8261350e565b602082019050919050565b6000602082019050818103600083015261357381613537565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006135d6602683612713565b91506135e18261357a565b604082019050919050565b60006020820190508181036000830152613605816135c9565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000613642602083612713565b915061364d8261360c565b602082019050919050565b6000602082019050818103600083015261367181613635565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026136da7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261369d565b6136e4868361369d565b95508019841693508086168417925050509392505050565b6000819050919050565b600061372161371c6137178461241e565b6136fc565b61241e565b9050919050565b6000819050919050565b61373b83613706565b61374f61374782613728565b8484546136aa565b825550505050565b600090565b613764613757565b61376f818484613732565b505050565b5b818110156137935761378860008261375c565b600181019050613775565b5050565b601f8211156137d8576137a981613678565b6137b28461368d565b810160208510156137c1578190505b6137d56137cd8561368d565b830182613774565b50505b505050565b600082821c905092915050565b60006137fb600019846008026137dd565b1980831691505092915050565b600061381483836137ea565b9150826002028217905092915050565b61382d82612708565b67ffffffffffffffff81111561384657613845612594565b5b6138508254612fdd565b61385b828285613797565b600060209050601f83116001811461388e576000841561387c578287015190505b6138868582613808565b8655506138ee565b601f19841661389c86613678565b60005b828110156138c45784890151825560018201915060208501945060208101905061389f565b868310156138e157848901516138dd601f8916826137ea565b8355505b6001600288020188555050505b505050505050565b7f455243313135353a206d696e7420746f20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000613952602183612713565b915061395d826138f6565b604082019050919050565b6000602082019050818103600083015261398181613945565b9050919050565b600060408201905061399d6000830185612494565b6139aa6020830184612494565b9392505050565b7f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060008201527f6d69736d61746368000000000000000000000000000000000000000000000000602082015250565b6000613a0d602883612713565b9150613a18826139b1565b604082019050919050565b60006020820190508181036000830152613a3c81613a00565b9050919050565b7f455243313135353a207472616e7366657220746f20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000613a9f602583612713565b9150613aaa82613a43565b604082019050919050565b60006020820190508181036000830152613ace81613a92565b9050919050565b7f455243313135353a20696e73756666696369656e742062616c616e636520666f60008201527f72207472616e7366657200000000000000000000000000000000000000000000602082015250565b6000613b31602a83612713565b9150613b3c82613ad5565b604082019050919050565b60006020820190508181036000830152613b6081613b24565b9050919050565b60006040820190508181036000830152613b818185612ac1565b90508181036020830152613b958184612ac1565b90509392505050565b7f455243313135353a2073657474696e6720617070726f76616c2073746174757360008201527f20666f722073656c660000000000000000000000000000000000000000000000602082015250565b6000613bfa602983612713565b9150613c0582613b9e565b604082019050919050565b60006020820190508181036000830152613c2981613bed565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000613c5782613c30565b613c618185613c3b565b9350613c71818560208601612724565b613c7a81612583565b840191505092915050565b600060a082019050613c9a6000830188612c7c565b613ca76020830187612c7c565b613cb46040830186612494565b613cc16060830185612494565b8181036080830152613cd38184613c4c565b90509695505050505050565b600081519050613cee816124ea565b92915050565b600060208284031215613d0a57613d096123b6565b5b6000613d1884828501613cdf565b91505092915050565b60008160e01c9050919050565b600060033d1115613d4d5760046000803e613d4a600051613d21565b90505b90565b600060443d10613ddd57613d626123ac565b60043d036004823e80513d602482011167ffffffffffffffff82111715613d8a575050613ddd565b808201805167ffffffffffffffff811115613da85750505050613ddd565b80602083010160043d038501811115613dc5575050505050613ddd565b613dd4826020018501866125c3565b82955050505050505b90565b7f455243313135353a207472616e7366657220746f206e6f6e2d4552433131353560008201527f526563656976657220696d706c656d656e746572000000000000000000000000602082015250565b6000613e3c603483612713565b9150613e4782613de0565b604082019050919050565b60006020820190508181036000830152613e6b81613e2f565b9050919050565b7f455243313135353a204552433131353552656365697665722072656a6563746560008201527f6420746f6b656e73000000000000000000000000000000000000000000000000602082015250565b6000613ece602883612713565b9150613ed982613e72565b604082019050919050565b60006020820190508181036000830152613efd81613ec1565b9050919050565b600060a082019050613f196000830188612c7c565b613f266020830187612c7c565b8181036040830152613f388186612ac1565b90508181036060830152613f4c8185612ac1565b90508181036080830152613f608184613c4c565b9050969550505050505056fea26469706673582212207183a2f9345e4f2c67b8190ec002aee6db5c187f55836873dd9ddefb58c2dec064736f6c63430008110033
Verified Source Code Full Match
Compiler: v0.8.17+commit.8df45f5f
EVM: london
Optimization: No
ERC1155Receiver.sol 19 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)
pragma solidity ^0.8.0;
import "../IERC1155Receiver.sol";
import "../../../utils/introspection/ERC165.sol";
/**
* @dev _Available since v3.1._
*/
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
}
}
LockURI.sol 27 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title LockURI
* LockURI - Allows the owner to lock the base URI - not reversable
*/
abstract contract LockURI is Ownable{
// Indicates if the owner can still change the metadata URI
bool public isUriLocked;
constructor() {
isUriLocked = false;
}
/**
* @dev For owner to lock the metadata URI - this is not reversable
*/
function lockURI() public onlyOwner {
isUriLocked = true;
}
}
ERC1155Holder.sol 36 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)
pragma solidity ^0.8.0;
import "./ERC1155Receiver.sol";
/**
* Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
*
* IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
* stuck.
*
* @dev _Available since v3.1._
*/
contract ERC1155Holder is ERC1155Receiver {
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) public virtual override returns (bytes4) {
return this.onERC1155BatchReceived.selector;
}
}
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;
}
}
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);
}
WLTEarlyAdopter.sol 111 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol";
import "./Shareholders.sol";
import "./LockURI.sol";
/**
* @title WLTEarlyAdopter
*
*
* __ __.____ ___________
* / \ / \ | \__ ___/
* \ \/\/ / | | |
* \ /| |___| |
* \__/\ / |_______ \____|
* \/ \/
*
* WLTEarlyAdopter - ERC-1155 smart contract for Satoshi's Closet WLT Early Adopter NFT
*/
contract WLTEarlyAdopter is ERC1155, ERC1155Holder, Shareholders, LockURI {
// Contract name
string public name = "$STCL WLT Early Adopter";
// Contract symbol
string public symbol = "STCLWLT";
// Set prices for items that can be minted
uint256[] private _itemPrices = [4200000000000000];
// Set supplies for items that can be minted
uint256[] private _itemSupplies = [1000];
/**
* @dev Constructor
* @param _shares The number of shares each shareholder has
* @param _shareholder_addresses Payment address for each shareholder
*/
constructor(
uint256[] memory _shares,
address payable[] memory _shareholder_addresses
) ERC1155("") Shareholders(_shares, _shareholder_addresses){
}
/**
* @dev See https://forum.openzeppelin.com/t/derived-contract-must-override-function-supportsinterface/6315
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, ERC1155Receiver) returns (bool) {
return super.supportsInterface(interfaceId);
}
/**
* @dev Returns the max total supply of all tokens
*/
function totalSupply() public view returns (uint256) {
uint256 supply = 0;
for(uint8 i=0; i < _itemSupplies.length; i++){
supply += _itemSupplies[i];
}
return supply;
}
/**
* @dev Returns the item prices array
*/
function itemPrices() public view returns (uint256[] memory) {
return _itemPrices;
}
/**
* @dev Returns the item supplies array
*/
function itemSupplies() public view returns (uint256[] memory) {
return _itemSupplies;
}
/**
* @dev For owner to set the base metadata URI while isUriLocked is false
* @param _uri string - new value for metadata URI
*/
function setURI(string memory _uri) public onlyOwner {
require(isUriLocked == false, "URI is locked. Cannot set the base URI");
_setURI(_uri);
}
/**
* @dev Mint items
* @param amount The number of items to mint.
*/
function mint(address _to, uint256 tokenId, uint256 amount) public payable {
require(tokenId > 0 && tokenId <= _itemPrices.length, "Token not available for minting");
require(msg.value == _itemPrices[tokenId - 1] * amount, "Wrong minting fee"); // Starting from token ID 1
require(amount <= _itemSupplies[tokenId - 1], "Not enough supply of this token"); // Starting from token ID 1
_mint(_to, tokenId, amount, "");
_itemSupplies[tokenId - 1] -= amount;
}
/**
* @dev Mint items by Owner
* @param amount The number of items to mint.
*/
function ownerMint(address _to, uint256 tokenId, uint256 amount) public onlyOwner {
require(tokenId > 0 && tokenId <= _itemPrices.length, "Token not available for minting");
require(amount <= _itemSupplies[tokenId - 1], "Not enough supply of this token"); // Starting from token ID 1
_mint(_to, tokenId, amount, "");
_itemSupplies[tokenId - 1] -= amount;
}
}
ERC1155.sol 517 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (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: address zero is not a valid owner");
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 token owner or 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: caller is not token owner or 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();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, to, ids, amounts, 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);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_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);
_afterTokenTransfer(operator, from, to, ids, amounts, data);
_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();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, address(0), to, ids, amounts, data);
_balances[id][to] += amount;
emit TransferSingle(operator, address(0), to, id, amount);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
*
* 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 _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);
_afterTokenTransfer(operator, address(0), to, ids, amounts, data);
_doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
}
/**
* @dev Destroys `amount` tokens of token type `id` from `from`
*
* Emits a {TransferSingle} event.
*
* 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();
uint256[] memory ids = _asSingletonArray(id);
uint256[] memory amounts = _asSingletonArray(amount);
_beforeTokenTransfer(operator, from, address(0), ids, amounts, "");
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);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
*
* Emits a {TransferBatch} event.
*
* 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);
_afterTokenTransfer(operator, from, address(0), ids, amounts, "");
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {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 `ids` and `amounts` 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 {}
/**
* @dev Hook that is called after 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 _afterTokenTransfer(
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;
}
}
Shareholders.sol 98 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
/**
* @title Shareholders
* Shareholders - Allows defining sharesplit between shareholders and having payouts of contract balance based on share splits.
* Can be used with ERC-721 or ERC-1155.
*/
abstract contract Shareholders {
// Constants
uint16 private constant TOTAL_SHARES = 10000;
// Contract shareholders
struct Shareholder {
uint256 share;
address payable shareholder_address;
}
Shareholder[] public shareholders;
event Payout(address indexed _to, uint256 _value);
/**
* @dev Constructor
* @param _shares The number of shares each shareholder has
* @param _shareholder_addresses Payment address for each shareholder
*/
constructor(
uint256[] memory _shares,
address payable[] memory _shareholder_addresses
) {
// there should be at least one shareholder
require(
_shareholder_addresses.length > 0,
"_shareholder_addresses must have at least one item."
);
// the _shares and _shareholder_addresses provided should be the same length
require(
_shares.length == _shareholder_addresses.length,
"_shareholder_addresses and _shares must be of the same length"
);
// keep track of the total number of shares
uint256 _total_number_of_shares = 0;
for (uint256 i = 0; i < _shares.length; i++) {
_total_number_of_shares += _shares[i];
Shareholder memory x = Shareholder({
share: _shares[i],
shareholder_address: _shareholder_addresses[i]
});
shareholders.push(x);
}
// there should be exactly 10,000 shares, this amount is used to calculate payouts
require(
_total_number_of_shares == TOTAL_SHARES,
"Total number of shares must be 10,000"
);
}
/**
* @dev Once the royalty contract has a balance, call this to payout to the shareholders
*/
function payout() public payable {
// the balance must be greater than 0
require(address(this).balance > 0, "Contract balance is 0");
// get the balance of ETH held by the royalty contract
uint256 balance = address(this).balance;
for (uint256 i = 0; i < shareholders.length; i++) {
// 10,000 shares represents 100.00% ownership
uint256 amount = (balance * shareholders[i].share) / TOTAL_SHARES;
// https://solidity-by-example.org/sending-ether/
// this considered the safest way to send ETH
(bool success, ) = shareholders[i].shareholder_address.call{
value: amount
}("");
// it should not fail
require(success, "Transfer failed.");
emit Payout(shareholders[i].shareholder_address, amount);
}
}
// https://solidity-by-example.org/sending-ether/
// receive is called when msg.data is empty.
receive() external payable {}
// https://solidity-by-example.org/sending-ether/
// fallback function is called when msg.data is not empty.
fallback() external payable {}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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);
}
}
Address.sol 244 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or 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 {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
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);
}
IERC1155.sol 125 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 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;
}
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);
}
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;
}
}
Read Contract
balanceOf 0x00fdd58e → uint256
balanceOfBatch 0x4e1273f4 → uint256[]
isApprovedForAll 0xe985e9c5 → bool
isUriLocked 0xfe96d7a4 → bool
itemPrices 0x385f134e → uint256[]
itemSupplies 0xa17129b2 → uint256[]
name 0x06fdde03 → string
owner 0x8da5cb5b → address
shareholders 0xab377daa → uint256, address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
uri 0x0e89341c → string
Write Contract 12 functions
These functions modify contract state and require a wallet transaction to execute.
lockURI 0x8e021c06
No parameters
mint 0x156e29f6
address _to
uint256 tokenId
uint256 amount
onERC1155BatchReceived 0xbc197c81
address
address
uint256[]
uint256[]
bytes
returns: bytes4
onERC1155Received 0xf23a6e61
address
address
uint256
uint256
bytes
returns: bytes4
ownerMint 0x388b9fe0
address _to
uint256 tokenId
uint256 amount
payout 0x63bd1d4a
No parameters
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
setApprovalForAll 0xa22cb465
address operator
bool approved
setURI 0x02fe5305
string _uri
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address