Address Contract Partially Verified
Address
0x8Ec319e40E0A91A11cF584053EB5e420C613f01d
Balance
0 ETH
Nonce
1
Code Size
19805 bytes
Creator
0x5772A94e...dF04 at tx 0x1ae3e78f...ea86ed
Indexed Transactions
0
Contract Bytecode
19805 bytes
0x608060405234801561001057600080fd5b50600436106104285760003560e01c806370a082311161022b578063a784d5c111610130578063c87b56dd116100b8578063e935b7b111610087578063e935b7b114610ad5578063e985e9c514610ade578063f51f74a914610af1578063f70c0f0414610b11578063f851a44014610b3157600080fd5b8063c87b56dd14610a89578063d03c390c14610a9c578063db2ff86114610aaf578063dce5d85814610ac257600080fd5b8063b88d4fde116100ff578063b88d4fde14610a2a578063bcd4f24414610a3d578063bee04f9c14610a50578063c26aff0f14610a63578063c6d7323114610a7657600080fd5b8063a784d5c1146109de578063acad0124146109f1578063b1656ba314610a04578063b7b04fae14610a1757600080fd5b80638dd91a56116101b35780639dc29fac116101825780639dc29fac14610969578063a11ec70a1461097c578063a22cb4651461098f578063a3b2cca6146109a2578063a47d29cb146109b557600080fd5b80638dd91a561461091657806393961c661461093b57806395d89b411461094e57806397dc86cf1461095657600080fd5b8063826fc391116101fa578063826fc391146107d15780638462151c146107e45780638ba8f14d146108045780638c2c3622146108175780638c3c9cdd1461090357600080fd5b806370a082311461076857806370a8a0ad1461077b578063742ff77a1461078e578063810051d7146107ae57600080fd5b80632f745c59116103315780634aa6d417116102b9578063621a1f7411610288578063621a1f74146106fc5780636352211e1461071c578063672b17e91461072f57806369d14faf146107425780636bd5d5911461075557600080fd5b80634aa6d4171461069e5780634ae9a738146106c35780634f6ccce7146106d65780635c088dcc146106e957600080fd5b80633e48e848116103005780633e48e8481461063f5780633f383cb8146106525780633fef6c2a1461066557806342842e0e1461067857806343fa7f441461068b57600080fd5b80632f745c59146105f3578063360d223a1461060657806337859963146106195780633bdbd5c41461062c57600080fd5b80631b689c0b116103b457806325b75d681161038357806325b75d6814610585578063261eb4e514610598578063266001d3146105ab57806327901822146105be5780632d9c0205146105d157600080fd5b80631b689c0b146105265780632002f7131461054657806321c0da791461056957806323b872dd1461057257600080fd5b80630b8f4d2d116103fb5780630b8f4d2d146104c45780630d170673146104d75780630d4d1513146104ea57806318160ddd1461050b5780631afe39f81461051357600080fd5b806301ffc9a71461042d57806306fdde031461046f578063081812fc14610484578063095ea7b3146104af575b600080fd5b61045a61043b3660046143ae565b6001600160e01b03191660009081526020819052604090205460ff1690565b60405190151581526020015b60405180910390f35b610477610b44565b604051610466919061442a565b61049761049236600461443d565b610bd6565b6040516001600160a01b039091168152602001610466565b6104c26104bd366004614472565b610c70565b005b6104c26104d236600461449c565b610dd3565b6104c26104e5366004614584565b610e21565b6104fd6104f83660046145cb565b610ed4565b604051908152602001610466565b6007546104fd565b6104c2610521366004614617565b6110d6565b6104fd61053436600461443d565b60116020526000908152604090205481565b61045a61055436600461449c565b60166020526000908152604090205460ff1681565b6104fd600f5481565b6104c26105803660046146aa565b611238565b6104c2610593366004614584565b6112b8565b6104776105a636600461443d565b61136a565b6104776105b93660046146e6565b611404565b6104c26105cc36600461443d565b611430565b6105e46105df36600461443d565b6114b6565b60405161046693929190614740565b6104fd610601366004614472565b61161c565b6104c261061436600461449c565b6116c6565b6104c2610627366004614584565b611712565b6104c261063a36600461443d565b611775565b6104c261064d366004614584565b6118eb565b6104c261066036600461449c565b611948565b6104c2610673366004614584565b611993565b6104c26106863660046146aa565b611a45565b6104c261069936600461449c565b611a60565b6106b16106ac36600461443d565b611aae565b60405161046696959493929190614778565b600e54610497906001600160a01b031681565b6104fd6106e436600461443d565b611c43565b6104c26106f736600461443d565b611cd6565b6104fd61070a36600461443d565b60136020526000908152604090205481565b61049761072a36600461443d565b611dd1565b6104c261073d3660046147c6565b611e4e565b6104c261075036600461480a565b611f10565b6104c2610763366004614584565b611f91565b6104fd61077636600461449c565b611fee565b6104c261078936600461443d565b612077565b6104fd61079c36600461443d565b6000908152600d602052604090205490565b61045a6107bc36600461449c565b60176020526000908152604090205460ff1681565b6104c26107df366004614836565b6120e4565b6107f76107f236600461449c565b612231565b6040516104669190614858565b6104c261081236600461443d565b6122a7565b6108a261082536600461443d565b6000908152600c6020818152604080842054600d80845282862054600b90945291909420928301549083015460138401546005850154600686015460078701546008909701546001600160a01b03988916999698959794966201000090940460ff90811696938416959284169493831693600160a01b9093041691565b604080516001600160a01b039b8c168152602081019a909a528901979097526060880195909552921515608087015290861660a0860152851660c085015290931660e083015291151561010082015261012081019190915261014001610466565b610477610911366004614836565b612336565b61092961092436600461443d565b6123e7565b6040516104669695949392919061489c565b6104c2610949366004614584565b612732565b6104776127af565b6104c2610964366004614836565b6127be565b6104fd610977366004614472565b612809565b6104c261098a36600461443d565b6128cb565b6104c261099d366004614913565b612950565b6104c26109b0366004614584565b612a15565b6104976109c336600461443d565b600c602052600090815260409020546001600160a01b031681565b6104c26109ec36600461480a565b612a72565b6104c26109ff366004614584565b612b0e565b6104c2610a1236600461493d565b612c02565b6104c2610a25366004614584565b612d19565b6104c2610a3836600461498d565b612dcb565b6104c2610a4b36600461449c565b612e49565b6107f7610a5e36600461443d565b612e94565b6104c2610a7136600461480a565b612ef4565b6104c2610a84366004614584565b612f90565b610477610a9736600461443d565b613042565b6104c2610aaa36600461443d565b6134da565b6104c2610abd36600461443d565b613537565b6104c2610ad036600461443d565b613699565b6104fd60185481565b61045a610aec366004614a09565b6137b6565b6104fd610aff36600461443d565b60146020526000908152604090205481565b6104fd610b1f36600461443d565b600d6020526000908152604090205481565b601554610497906001600160a01b031681565b606060098054610b5390614a33565b80601f0160208091040260200160405190810160405280929190818152602001828054610b7f90614a33565b8015610bcc5780601f10610ba157610100808354040283529160200191610bcc565b820191906000526020600020905b815481529060010190602001808311610baf57829003601f168201915b5050505050905090565b6000818152600160205260408120546001600160a01b0316610c545760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600260205260409020546001600160a01b031690565b6000610c7b82611dd1565b9050806001600160a01b0316836001600160a01b03161415610ce95760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c4b565b336001600160a01b0382161480610d055750610d0581336137b6565b610d775760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c4b565b60008281526002602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6015546001600160a01b03163314610dfd5760405162461bcd60e51b8152600401610c4b90614a68565b6001600160a01b03166000908152601760205260409020805460ff19166001179055565b6000828152600b602052604090206013015482906301000000900460ff1615610e5c5760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054839060ff1680610e9257506000818152600c60205260409020546001600160a01b031633145b610eae5760405162461bcd60e51b8152600401610c4b90614ab6565b6000848152600b602090815260409091208451610ecd928601906142c9565b5050505050565b3360009081526017602052604081205460ff16610f3f5760405162461bcd60e51b815260206004820152602360248201527f4d757374206d696e742066726f6d205261696e626f776c6973746564206d696e6044820152623a32b960e91b6064820152608401610c4b565b6000838152600b60205260409020600d810154600c90910154610f63906001614b03565b1115610fb15760405162461bcd60e51b815260206004820152601760248201527f45786365656473206d617820696e766f636174696f6e730000000000000000006044820152606401610c4b565b6000838152600b602052604090206013015462010000900460ff1680610ff057506000838152600c60205260409020546001600160a01b038381169116145b61103c5760405162461bcd60e51b815260206004820152601d60248201527f50726f6a206d75737420657869737420616e64206265206163746976650000006044820152606401610c4b565b6000838152600b6020526040902060130154640100000000900460ff16158061107e57506000838152600c60205260409020546001600160a01b038381169116145b6110c15760405162461bcd60e51b8152602060048201526014602482015273141d5c98da185cd95cc8185c99481c185d5cd95960621b6044820152606401610c4b565b60006110cd85856137e4565b95945050505050565b3360009081526016602052604090205460ff166111055760405162461bcd60e51b8152600401610c4b90614b1b565b6018546000818152600c6020908152604080832080546001600160a01b0319166001600160a01b038c16179055600b82529091208951611147928b01906142c9565b506000818152600b602081815260408084206005810180546001600160a01b0319166001600160a01b038c1617905560078101805460ff60a01b1916600160a01b8b15150217905560088101889055600d8084529185208b90559290915260138201805464010000000064ff0000000019909116179055601182019290925560098101805460ff1916851515179055620f424091015581611200576000818152600b60205260409020601301805460ff1916905561121d565b6000818152600b60205260409020601301805460ff191660011790555b60185461122b906001614b03565b6018555050505050505050565b611242338261393a565b6112a85760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610c4b565b6112b3838383613a11565b505050565b6000828152600b602052604090206013015482906301000000900460ff16156112f35760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054839060ff168061132957506000818152600c60205260409020546001600160a01b031633145b6113455760405162461bcd60e51b8152600401610c4b90614ab6565b6000848152600b602090815260409091208451610ecd926004909201918601906142c9565b6010602052600090815260409020805461138390614a33565b80601f01602080910402602001604051908101604052809291908181526020018280546113af90614a33565b80156113fc5780601f106113d1576101008083540402835291602001916113fc565b820191906000526020600020905b8154815290600101906020018083116113df57829003601f168201915b505050505081565b60608282604051602001611419929190614b47565b604051602081830303815290604052905092915050565b60008181526011602090815260408083205433845260169092529091205460ff168061147257506000818152600c60205260409020546001600160a01b031633145b61148e5760405162461bcd60e51b8152600401610c4b90614ab6565b6000828152601160209081526040808320548352601090915281206114b29161434d565b5050565b6000818152600b60205260408120600a018054606092839290916114d990614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461150590614a33565b80156115525780601f1061152757610100808354040283529160200191611552565b820191906000526020600020905b81548152906001019060200180831161153557829003601f168201915b50505050509250600b6000858152602001908152602001600020600b01805461157a90614a33565b80601f01602080910402602001604051908101604052809291908181526020018280546115a690614a33565b80156115f35780601f106115c8576101008083540402835291602001916115f3565b820191906000526020600020905b8154815290600101906020018083116115d657829003601f168201915b50505060009687525050600b602052604090942060130154929461010090930460ff1692915050565b600061162783611fee565b82106116895760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c4b565b6001600160a01b03831660009081526005602052604090208054839081106116b3576116b3614b76565b9060005260206000200154905092915050565b6015546001600160a01b031633146116f05760405162461bcd60e51b8152600401610c4b90614a68565b600e80546001600160a01b0319166001600160a01b0392909216919091179055565b6000828152600c602052604090205482906001600160a01b0316331461174a5760405162461bcd60e51b8152600401610c4b90614b8c565b6000838152600b60209081526040909120835161176f926003909201918501906142c9565b50505050565b6000818152600b602052604090206013015481906301000000900460ff16156117b05760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054829060ff16806117e657506000818152600c60205260409020546001600160a01b031633145b6118025760405162461bcd60e51b8152600401610c4b90614ab6565b6000838152600b60205260409020600c0154156118715760405162461bcd60e51b815260206004820152602760248201527f43616e206e6f7420737769746368206166746572206120746f6b656e2069732060448201526636b4b73a32b21760c91b6064820152608401610c4b565b6000838152600b602052604090206009015460ff16156118a9576000838152600b60205260409020601301805460ff191690556118c6565b6000838152600b60205260409020601301805460ff191660011790555b50506000908152600b60205260409020600901805460ff19811660ff90911615179055565b6000828152600c602052604090205482906001600160a01b031633146119235760405162461bcd60e51b8152600401610c4b90614b8c565b6000838152600b60209081526040909120835161176f92600a909201918501906142c9565b6015546001600160a01b031633146119725760405162461bcd60e51b8152600401610c4b90614a68565b6001600160a01b03166000908152601760205260409020805460ff19169055565b6000828152600b602052604090206013015482906301000000900460ff16156119ce5760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054839060ff1680611a0457506000818152600c60205260409020546001600160a01b031633145b611a205760405162461bcd60e51b8152600401610c4b90614ab6565b6000848152600b602090815260409091208451610ecd926012909201918601906142c9565b6112b383838360405180602001604052806000815250612dcb565b6015546001600160a01b03163314611a8a5760405162461bcd60e51b8152600401610c4b90614a68565b6001600160a01b03166000908152601660205260409020805460ff19166001179055565b60606000806060600080600b6000888152602001908152602001600020600e018054611ad990614a33565b80601f0160208091040260200160405190810160405280929190818152602001828054611b0590614a33565b8015611b525780601f10611b2757610100808354040283529160200191611b52565b820191906000526020600020905b815481529060010190602001808311611b3557829003601f168201915b50505060008a8152600b602052604090206010810154601382015460129092018054959b5090995060ff909116975092611b8e92509050614a33565b80601f0160208091040260200160405190810160405280929190818152602001828054611bba90614a33565b8015611c075780601f10611bdc57610100808354040283529160200191611c07565b820191906000526020600020905b815481529060010190602001808311611bea57829003601f168201915b5050506000998a525050600b602052604090972060130154959794969395939460ff630100000086048116956401000000009004169350915050565b6000611c4e60075490565b8210611cb15760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c4b565b60078281548110611cc457611cc4614b76565b90600052602060002001549050919050565b33600090815260166020526040902054819060ff1680611d0c57506000818152600c60205260409020546001600160a01b031633145b611d285760405162461bcd60e51b8152600401610c4b90614ab6565b6000828152600b602052604090206009015460ff1615611da45760405162461bcd60e51b815260206004820152603160248201527f63616e206f6e6c7920736574207374617469632049504653206861736820666f60448201527072207374617469632070726f6a6563747360781b6064820152608401610c4b565b506000908152600b60205260409020601301805461ff001981166101009182900460ff1615909102179055565b6000818152600160205260408120546001600160a01b031680611e485760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c4b565b92915050565b6000848152600b602052604090206013015484906301000000900460ff1615611e895760405162461bcd60e51b8152600401610c4b90614a8c565b3360009081526016602052604090205460ff16611eb85760405162461bcd60e51b8152600401610c4b90614b1b565b506000938452600b60205260409093206005810180546001600160a01b039094166001600160a01b031990941693909317909255600782018054911515600160a01b0260ff60a01b1990921691909117905560080155565b33600090815260166020526040902054829060ff1680611f4657506000818152600c60205260409020546001600160a01b031633145b611f625760405162461bcd60e51b8152600401610c4b90614ab6565b506000918252600c602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b6000828152600c602052604090205482906001600160a01b03163314611fc95760405162461bcd60e51b8152600401610c4b90614b8c565b6000838152600b60208181526040909220845161176f939190920191908501906142c9565b60006001600160a01b0382166120595760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c4b565b6001600160a01b038216600090815260036020526040902054611e48565b6015546001600160a01b031633146120a15760405162461bcd60e51b8152600401610c4b90614a68565b60328111156120df5760405162461bcd60e51b815260206004820152600a6024820152694d6178206f662035302560b01b6044820152606401610c4b565b600f55565b6000828152600c602052604090205482906001600160a01b0316331461211c5760405162461bcd60e51b8152600401610c4b90614b8c565b6000838152600b60205260409020601301546301000000900460ff16158061215457506000838152600b60205260409020600d015482105b6121705760405162461bcd60e51b8152600401610c4b90614a8c565b6000838152600b60205260409020600c015482116121d05760405162461bcd60e51b815260206004820152601f60248201527f4d617820696e766f636174696f6e7320657863656564732063757272656e74006044820152606401610c4b565b620f424082111561221b5760405162461bcd60e51b8152602060048201526015602482015274043616e6e6f7420657863656564203130303030303605c1b6044820152606401610c4b565b506000918252600b6020526040909120600d0155565b6060612251826001600160a01b0316600090815260056020526040902090565b80548060200260200160405190810160405280929190818152602001828054801561229b57602002820191906000526020600020905b815481526020019060010190808311612287575b50505050509050919050565b3360009081526016602052604090205460ff166122d65760405162461bcd60e51b8152600401610c4b90614b1b565b6000818152600b602052604090206013015481906301000000900460ff16156123115760405162461bcd60e51b8152600401610c4b90614a8c565b506000908152600b60205260409020601301805463ff00000019166301000000179055565b6000828152600b60209081526040808320848452600f01909152902080546060919061236190614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461238d90614a33565b80156123da5780601f106123af576101008083540402835291602001916123da565b820191906000526020600020905b8154815290600101906020018083116123bd57829003601f168201915b5050505050905092915050565b60608060608060606000600b6000888152602001908152602001600020600001805461241290614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461243e90614a33565b801561248b5780601f106124605761010080835404028352916020019161248b565b820191906000526020600020905b81548152906001019060200180831161246e57829003601f168201915b50505060008a8152600b602052604090206001018054939950926124b192509050614a33565b80601f01602080910402602001604051908101604052809291908181526020018280546124dd90614a33565b801561252a5780601f106124ff5761010080835404028352916020019161252a565b820191906000526020600020905b81548152906001019060200180831161250d57829003601f168201915b50505060008a8152600b6020526040902060020180549398509261255092509050614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461257c90614a33565b80156125c95780601f1061259e576101008083540402835291602001916125c9565b820191906000526020600020905b8154815290600101906020018083116125ac57829003601f168201915b50505060008a8152600b602052604090206003018054939750926125ef92509050614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461261b90614a33565b80156126685780601f1061263d57610100808354040283529160200191612668565b820191906000526020600020905b81548152906001019060200180831161264b57829003601f168201915b50505060008a8152600b6020526040902060040180549396509261268e92509050614a33565b80601f01602080910402602001604051908101604052809291908181526020018280546126ba90614a33565b80156127075780601f106126dc57610100808354040283529160200191612707565b820191906000526020600020905b8154815290600101906020018083116126ea57829003601f168201915b5050506000998a525050600b602052604090972060090154959794969395929460ff90931692915050565b60008281526011602090815260408083205433845260169092529091205460ff168061277457506000818152600c60205260409020546001600160a01b031633145b6127905760405162461bcd60e51b8152600401610c4b90614ab6565b6000838152601060209081526040909120835161176f928501906142c9565b6060600a8054610b5390614a33565b6000828152600c602052604090205482906001600160a01b031633146127f65760405162461bcd60e51b8152600401610c4b90614b8c565b506000918252600d602052604090912055565b3360009081526017602052604081205460ff166128745760405162461bcd60e51b815260206004820152602360248201527f4d757374206275726e2066726f6d205261696e626f776c6973746564206d696e6044820152623a32b960e91b6064820152608401610c4b565b61287e8383613a30565b6000828152601160208181526040808420548452600b90915290912001546128a7906001614b03565b6000838152601160208181526040808420548452600b909152909120015550919050565b33600090815260166020526040902054819060ff168061290157506000818152600c60205260409020546001600160a01b031633145b61291d5760405162461bcd60e51b8152600401610c4b90614ab6565b506000908152600b60205260409020601301805464ff000000001981166401000000009182900460ff1615909102179055565b6001600160a01b0382163314156129a95760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c4b565b3360008181526004602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6000828152600c602052604090205482906001600160a01b03163314612a4d5760405162461bcd60e51b8152600401610c4b90614b8c565b6000838152600b60209081526040909120835161176f926002909201918501906142c9565b6000828152600b602052604090206013015482906301000000900460ff1615612aad5760405162461bcd60e51b8152600401610c4b90614a8c565b3360009081526016602052604090205460ff16612adc5760405162461bcd60e51b8152600401610c4b90614b1b565b506000918252600b602052604090912060060180546001600160a01b0319166001600160a01b03909216919091179055565b6000828152600b602052604090206013015482906301000000900460ff1615612b495760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054839060ff1680612b7f57506000818152600c60205260409020546001600160a01b031633145b612b9b5760405162461bcd60e51b8152600401610c4b90614ab6565b6000848152600b6020908152604080832060108101548452600f0182529091208451612bc9928601906142c9565b506000848152600b6020526040902060100154612be7906001614b03565b6000948552600b602052604090942060100193909355505050565b6000838152600b602052604090206013015483906301000000900460ff1615612c3d5760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054849060ff1680612c7357506000818152600c60205260409020546001600160a01b031633145b612c8f5760405162461bcd60e51b8152600401610c4b90614ab6565b6000858152600b60205260409020601001548410612ce75760405162461bcd60e51b81526020600482015260156024820152747363726970744964206f7574206f662072616e676560581b6044820152606401610c4b565b6000858152600b60209081526040808320878452600f0182529091208451612d11928601906142c9565b505050505050565b6000828152600b602052604090206013015482906301000000900460ff1615612d545760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054839060ff1680612d8a57506000818152600c60205260409020546001600160a01b031633145b612da65760405162461bcd60e51b8152600401610c4b90614ab6565b6000848152600b602090815260409091208451610ecd926001909201918601906142c9565b612dd6848484611238565b612de284848484613a5c565b61176f5760405162461bcd60e51b815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b6064820152608401610c4b565b6015546001600160a01b03163314612e735760405162461bcd60e51b8152600401610c4b90614a68565b6001600160a01b03166000908152601660205260409020805460ff19169055565b60008181526012602090815260409182902080548351818402810184019094528084526060939283018282801561229b57602002820191906000526020600020908154815260200190600101908083116122875750505050509050919050565b6000828152600b602052604090206013015482906301000000900460ff1615612f2f5760405162461bcd60e51b8152600401610c4b90614a8c565b3360009081526016602052604090205460ff16612f5e5760405162461bcd60e51b8152600401610c4b90614b1b565b506000918252600b602052604090912060070180546001600160a01b0319166001600160a01b03909216919091179055565b6000828152600b602052604090206013015482906301000000900460ff1615612fcb5760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054839060ff168061300157506000818152600c60205260409020546001600160a01b031633145b61301d5760405162461bcd60e51b8152600401610c4b90614ab6565b6000848152600b602090815260409091208451610ecd92600e909201918601906142c9565b606081613066816000908152600160205260409020546001600160a01b0316151590565b6130a85760405162461bcd60e51b8152602060048201526013602482015272546f6b656e204944206e6f742065786973747360681b6044820152606401610c4b565b6000838152601160209081526040808320548352600b9091529020600701546001600160a01b03161561317c576000838152601160209081526040808320548352600b90915290819020600701549051631675f45560e01b8152600481018590526001600160a01b03909116908190631675f4559060240160006040518083038186803b15801561313857600080fd5b505afa15801561314c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526131749190810190614bb1565b9250506134d4565b6000838152601060205260408120805461319590614a33565b905011156132ee576000838152601160209081526040808320548352600b918290529091200180546132e791906131cb90614a33565b80601f01602080910402602001604051908101604052809291908181526020018280546131f790614a33565b80156132445780601f1061321957610100808354040283529160200191613244565b820191906000526020600020905b81548152906001019060200180831161322757829003601f168201915b505050600087815260106020526040902080549092506132649150614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461329090614a33565b80156132dd5780601f106132b2576101008083540402835291602001916132dd565b820191906000526020600020905b8154815290600101906020018083116132c057829003601f168201915b5050505050611404565b91506134d4565b6000838152601160209081526040808320548352600b90915290206009015460ff1615801561334057506000838152601160209081526040808320548352600b909152902060130154610100900460ff165b1561341c576000838152601160209081526040808320548352600b918290529091200180546132e7919061337390614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461339f90614a33565b80156133ec5780601f106133c1576101008083540402835291602001916133ec565b820191906000526020600020905b8154815290600101906020018083116133cf57829003601f168201915b5050506000878152601160209081526040808320548352600b909152902060120180549092506132649150614a33565b6000838152601160209081526040808320548352600b9091529020600a0180546134d1919061344a90614a33565b80601f016020809104026020016040519081016040528092919081815260200182805461347690614a33565b80156134c35780601f10613498576101008083540402835291602001916134c3565b820191906000526020600020905b8154815290600101906020018083116134a657829003601f168201915b50505050506105b985613b1a565b91505b50919050565b3360009081526016602052604090205460ff166135095760405162461bcd60e51b8152600401610c4b90614b1b565b6000908152600b60205260409020601301805462ff0000198116620100009182900460ff1615909102179055565b6000818152600b602052604090206013015481906301000000900460ff16156135725760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054829060ff16806135a857506000818152600c60205260409020546001600160a01b031633145b6135c45760405162461bcd60e51b8152600401610c4b90614ab6565b6000838152600b60205260409020601001546136225760405162461bcd60e51b815260206004820152601e60248201527f746865726520617265206e6f207363726970747320746f2072656d6f766500006044820152606401610c4b565b6000838152600b602052604081206010810154600f909101919061364890600190614c1f565b81526020019081526020016000206000613662919061434d565b6000838152600b602052604090206010015461367f906001614b03565b6000938452600b6020526040909320601001929092555050565b6000818152600b602052604090206013015481906301000000900460ff16156136d45760405162461bcd60e51b8152600401610c4b90614a8c565b33600090815260166020526040902054829060ff168061370a57506000818152600c60205260409020546001600160a01b031633145b6137265760405162461bcd60e51b8152600401610c4b90614ab6565b6000838152600b60205260409020600c0154156137915760405162461bcd60e51b8152602060048201526024808201527f43616e6e6f74206d6f6469667920616674657220746f6b656e206973206d696e6044820152633a32b21760e11b6064820152608401610c4b565b50506000908152600b60205260409020601301805460ff19811660ff90911615179055565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205460ff1690565b6000818152600b60205260408120600c01548190613805620f424085614c36565b61380f9190614b03565b6000848152600b60205260409020600c015490915061382f906001614b03565b6000848152600b60205260408120600c018290559043613850600182614c1f565b6040805160208101949094528301919091524060608083019190915233901b6bffffffffffffffffffffffff191660808201526094810184905260b40160408051601f1981840301815291815281516020928301206000858152601384528281208290558181526014909352912083905590506138cd8583613c43565b600082815260116020908152604080832087905586835260128252808320805460018101825590845291832090910184905551859184916001600160a01b038916917f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f91a4509392505050565b6000818152600160205260408120546001600160a01b03166139b35760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c4b565b60006139be83611dd1565b9050806001600160a01b0316846001600160a01b031614806139f95750836001600160a01b03166139ee84610bd6565b6001600160a01b0316145b80613a095750613a0981856137b6565b949350505050565b613a1c838383613c9f565b613a268382613e23565b6112b38282613f32565b613a3a8282613f70565b613a448282613e23565b6000818152600660205260408120556114b281614066565b60006001600160a01b0384163b613a7557506001613a09565b604051630a85bd0160e11b81526000906001600160a01b0386169063150b7a0290613aaa9033908a9089908990600401614c55565b602060405180830381600087803b158015613ac457600080fd5b505af1158015613ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613afc9190614c92565b6001600160e01b031916630a85bd0160e11b14915050949350505050565b606081613b3e5750506040805180820190915260018152600360fc1b602082015290565b8160005b8115613b685780613b5281614caf565b9150613b619050600a83614cca565b9150613b42565b60008167ffffffffffffffff811115613b8357613b836144b7565b6040519080825280601f01601f191660200182016040528015613bad576020820181803683370190505b509050815b8515613c3a57613bc3600182614c1f565b90506000613bd2600a88614cca565b613bdd90600a614c36565b613be79088614c1f565b613bf2906030614cec565b905060008160f81b905080848481518110613c0f57613c0f614b76565b60200101906001600160f81b031916908160001a905350613c31600a89614cca565b97505050613bb2565b50949350505050565b613c4d8282614127565b613c578282613f32565b6114b281600780546000838152600860205260408120829055600182018355919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880155565b826001600160a01b0316613cb282611dd1565b6001600160a01b031614613d1a5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610c4b565b6001600160a01b038216613d7c5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c4b565b613d858161425d565b6001600160a01b0383166000908152600360205260409020613da69061429a565b6001600160a01b0382166000908152600360205260409020613dc7906142ac565b60008181526001602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6001600160a01b038216600090815260056020526040812054613e4890600190614c1f565b600083815260066020526040902054909150808214613eef576001600160a01b0384166000908152600560205260408120805484908110613e8b57613e8b614b76565b906000526020600020015490508060056000876001600160a01b03166001600160a01b031681526020019081526020016000208381548110613ecf57613ecf614b76565b600091825260208083209091019290925591825260069052604090208190555b6001600160a01b0384166000908152600560205260409020805480613f1657613f16614d11565b6001900381819060005260206000200160009055905550505050565b6001600160a01b0390911660009081526005602081815260408084208054868652600684529185208290559282526001810183559183529091200155565b816001600160a01b0316613f8382611dd1565b6001600160a01b031614613fe75760405162461bcd60e51b815260206004820152602560248201527f4552433732313a206275726e206f6620746f6b656e2074686174206973206e6f6044820152643a1037bbb760d91b6064820152608401610c4b565b613ff08161425d565b6001600160a01b03821660009081526003602052604090206140119061429a565b60008181526001602052604080822080546001600160a01b0319169055518291906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60075460009061407890600190614c1f565b600083815260086020526040812054600780549394509092849081106140a0576140a0614b76565b9060005260206000200154905080600783815481106140c1576140c1614b76565b600091825260208083209091019290925582815260089091526040902082905560078054806140f2576140f2614d11565b600190038181906000526020600020016000905590556000600860008681526020019081526020016000208190555050505050565b6001600160a01b03821661417d5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c4b565b6000818152600160205260409020546001600160a01b0316156141e25760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c4b565b600081815260016020908152604080832080546001600160a01b0319166001600160a01b038716908117909155835260039091529020614221906142ac565b60405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000818152600260205260409020546001600160a01b03161561429757600081815260026020526040902080546001600160a01b03191690555b50565b80546142a890600190614c1f565b9055565b60018160000160008282546142c19190614b03565b909155505050565b8280546142d590614a33565b90600052602060002090601f0160209004810192826142f7576000855561433d565b82601f1061431057805160ff191683800117855561433d565b8280016001018555821561433d579182015b8281111561433d578251825591602001919060010190614322565b50614349929150614383565b5090565b50805461435990614a33565b6000825580601f10614369575050565b601f01602090049060005260206000209081019061429791905b5b808211156143495760008155600101614384565b6001600160e01b03198116811461429757600080fd5b6000602082840312156143c057600080fd5b81356143cb81614398565b9392505050565b60005b838110156143ed5781810151838201526020016143d5565b8381111561176f5750506000910152565b600081518084526144168160208601602086016143d2565b601f01601f19169290920160200192915050565b6020815260006143cb60208301846143fe565b60006020828403121561444f57600080fd5b5035919050565b80356001600160a01b038116811461446d57600080fd5b919050565b6000806040838503121561448557600080fd5b61448e83614456565b946020939093013593505050565b6000602082840312156144ae57600080fd5b6143cb82614456565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156144f6576144f66144b7565b604052919050565b600067ffffffffffffffff821115614518576145186144b7565b50601f01601f191660200190565b6000614539614534846144fe565b6144cd565b905082815283838301111561454d57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261457557600080fd5b6143cb83833560208501614526565b6000806040838503121561459757600080fd5b82359150602083013567ffffffffffffffff8111156145b557600080fd5b6145c185828601614564565b9150509250929050565b6000806000606084860312156145e057600080fd5b6145e984614456565b9250602084013591506145fe60408501614456565b90509250925092565b8035801515811461446d57600080fd5b600080600080600080600060e0888a03121561463257600080fd5b873567ffffffffffffffff81111561464957600080fd5b6146558a828b01614564565b97505061466460208901614456565b95506040880135945061467960608901614456565b935061468760808901614607565b925060a0880135915061469c60c08901614607565b905092959891949750929550565b6000806000606084860312156146bf57600080fd5b6146c884614456565b92506146d660208501614456565b9150604084013590509250925092565b600080604083850312156146f957600080fd5b823567ffffffffffffffff8082111561471157600080fd5b61471d86838701614564565b9350602085013591508082111561473357600080fd5b506145c185828601614564565b60608152600061475360608301866143fe565b828103602084015261476581866143fe565b9150508215156040830152949350505050565b60c08152600061478b60c08301896143fe565b876020840152861515604084015282810360608401526147ab81876143fe565b9415156080840152505090151560a090910152949350505050565b600080600080608085870312156147dc57600080fd5b843593506147ec60208601614456565b92506147fa60408601614607565b9396929550929360600135925050565b6000806040838503121561481d57600080fd5b8235915061482d60208401614456565b90509250929050565b6000806040838503121561484957600080fd5b50508035926020909101359150565b6020808252825182820181905260009190848201906040850190845b8181101561489057835183529284019291840191600101614874565b50909695505050505050565b60c0815260006148af60c08301896143fe565b82810360208401526148c181896143fe565b905082810360408401526148d581886143fe565b905082810360608401526148e981876143fe565b905082810360808401526148fd81866143fe565b91505082151560a0830152979650505050505050565b6000806040838503121561492657600080fd5b61492f83614456565b915061482d60208401614607565b60008060006060848603121561495257600080fd5b8335925060208401359150604084013567ffffffffffffffff81111561497757600080fd5b61498386828701614564565b9150509250925092565b600080600080608085870312156149a357600080fd5b6149ac85614456565b93506149ba60208601614456565b925060408501359150606085013567ffffffffffffffff8111156149dd57600080fd5b8501601f810187136149ee57600080fd5b6149fd87823560208401614526565b91505092959194509250565b60008060408385031215614a1c57600080fd5b614a2583614456565b915061482d60208401614456565b600181811c90821680614a4757607f821691505b602082108114156134d457634e487b7160e01b600052602260045260246000fd5b6020808252600a908201526927b7363c9030b236b4b760b11b604082015260600190565b60208082526010908201526f13db9b1e481a59881d5b9b1bd8dad95960821b604082015260600190565b6020808252601c908201527f4f6e6c7920617274697374206f72205261696e626f776c697374656400000000604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008219821115614b1657614b16614aed565b500190565b60208082526012908201527113db9b1e4814985a5b989bdddb1a5cdd195960721b604082015260600190565b60008351614b598184602088016143d2565b835190830190614b6d8183602088016143d2565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b6020808252600b908201526a13db9b1e48185c9d1a5cdd60aa1b604082015260600190565b600060208284031215614bc357600080fd5b815167ffffffffffffffff811115614bda57600080fd5b8201601f81018413614beb57600080fd5b8051614bf9614534826144fe565b818152856020838501011115614c0e57600080fd5b6110cd8260208301602086016143d2565b600082821015614c3157614c31614aed565b500390565b6000816000190483118215151615614c5057614c50614aed565b500290565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090614c88908301846143fe565b9695505050505050565b600060208284031215614ca457600080fd5b81516143cb81614398565b6000600019821415614cc357614cc3614aed565b5060010190565b600082614ce757634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff84168060ff03821115614d0957614d09614aed565b019392505050565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220fb18f0986350b3e9b05f9a7d25b3840ea8d032b8e802a4014b8527ac7989ed0164736f6c63430008090033
Verified Source Code Partial Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: Yes (200 runs)
NtentArt.sol 996 lines
// SPDX-License-Identifier: MIT
// File contracts/libs/IERC165.sol
// File: openzeppelin-solidity/contracts/introspection/IERC165.sol
pragma solidity ^0.8.9;
/**
* @dev Interface of the ERC165 standard, as defined in the
* [EIP](https://eips.ethereum.org/EIPS/eip-165).
*
* 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
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File contracts/libs/ERC165.sol
// File: openzeppelin-solidity/contracts/introspection/ERC165.sol
pragma solidity ^0.8.9;
/**
* @dev Implementation of the `IERC165` interface.
*
* Contracts may inherit from this and call `_registerInterface` to declare
* their support of an interface.
*/
contract ERC165 is IERC165 {
/*
* bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7
*/
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* @dev Mapping of interface ids to whether or not it's supported.
*/
mapping(bytes4 => bool) private _supportedInterfaces;
constructor () {
// Derived contracts need only register support for their own interfaces,
// we register support for ERC165 itself here
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev See `IERC165.supportsInterface`.
*
* Time complexity O(1), guaranteed to always use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) override external view returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev Registers the contract as an implementer of the interface defined by
* `interfaceId`. Support of the actual ERC165 interface is automatic and
* registering its interface id is not required.
*
* See `IERC165.supportsInterface`.
*
* Requirements:
*
* - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
*/
function _registerInterface(bytes4 interfaceId) internal {
require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
_supportedInterfaces[interfaceId] = true;
}
}
// File contracts/libs/IERC721.sol
// File: openzeppelin-solidity/contracts/token/ERC721/IERC721.sol
pragma solidity ^0.8.9;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
abstract contract IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of NFTs in `owner`'s account.
*/
function balanceOf(address owner) public virtual view returns (uint256 balance);
/**
* @dev Returns the owner of the NFT specified by `tokenId`.
*/
function ownerOf(uint256 tokenId) public virtual view returns (address owner);
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
*
*
* Requirements:
* - `from`, `to` cannot be zero.
* - `tokenId` must be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this
* NFT by either `approve` or `setApproveForAll`.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual;
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
* Requirements:
* - If the caller is not `from`, it must be approved to move this NFT by
* either `approve` or `setApproveForAll`.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual;
function approve(address to, uint256 tokenId) public virtual;
function getApproved(uint256 tokenId) public virtual view returns (address operator);
function setApprovalForAll(address operator, bool _approved) public virtual;
function isApprovedForAll(address owner, address operator) public virtual view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual;
}
// File contracts/libs/Address.sol
// File: openzeppelin-solidity/contracts/utils/Address.sol
pragma solidity ^0.8.9;
/**
* @dev Collection of functions related to the address type,
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* This test is non-exhaustive, and there may be false-negatives: during the
* execution of a contract's constructor, its address will be reported as
* not containing a contract.
*
* > It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
// File contracts/libs/Counters.sol
// File: openzeppelin-solidity/contracts/drafts/Counters.sol
pragma solidity ^0.8.9;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
* Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath
* overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never
* directly accessed.
*/
library Counters {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
counter._value += 1;
}
function decrement(Counter storage counter) internal {
counter._value = counter._value - 1;
}
}
// File contracts/libs/IERC721Receiver.sol
// File: openzeppelin-solidity/contracts/token/ERC721/IERC721Receiver.sol
pragma solidity ^0.8.9;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
abstract contract IERC721Receiver {
function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public virtual returns (bytes4);
}
// File contracts/libs/ERC721.sol
// File: openzeppelin-solidity/contracts/token/ERC721/ERC721.sol
pragma solidity ^0.8.9;
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is ERC165, IERC721 {
using Address for address;
using Counters for Counters.Counter;
// Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
// which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`
bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;
// Mapping from token ID to owner
mapping (uint256 => address) private _tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping from owner to number of owned token
mapping (address => Counters.Counter) private _ownedTokensCount;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
constructor () {
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
}
function balanceOf(address owner) public override view returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
function ownerOf(uint256 tokenId) public override view returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function approve(address to, uint256 tokenId) public override virtual {
address owner = ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(msg.sender == owner || isApprovedForAll(owner, msg.sender),
"ERC721: approve caller is not owner nor approved for all"
);
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public override view returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address to, bool approved) public override {
require(to != msg.sender, "ERC721: approve to caller");
_operatorApprovals[msg.sender][to] = approved;
emit ApprovalForAll(msg.sender, to, approved);
}
function isApprovedForAll(address owner, address operator) public override view returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(address from, address to, uint256 tokenId) public override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved");
_transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public override {
transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view returns (bool) {
address owner = _tokenOwner[tokenId];
return owner != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_tokenOwner[tokenId] = to;
_ownedTokensCount[to].increment();
emit Transfer(address(0), to, tokenId);
}
function _burn(address owner, uint256 tokenId) internal virtual {
require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own");
_clearApproval(tokenId);
_ownedTokensCount[owner].decrement();
_tokenOwner[tokenId] = address(0);
emit Transfer(owner, address(0), tokenId);
}
function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
function _transferFrom(address from, address to, uint256 tokenId) internal virtual {
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
_clearApproval(tokenId);
_ownedTokensCount[from].decrement();
_ownedTokensCount[to].increment();
_tokenOwner[tokenId] = to;
emit Transfer(from, to, tokenId);
}
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data)
internal returns (bool)
{
if (!to.isContract()) {
return true;
}
bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data);
return (retval == _ERC721_RECEIVED);
}
function _clearApproval(uint256 tokenId) private {
if (_tokenApprovals[tokenId] != address(0)) {
_tokenApprovals[tokenId] = address(0);
}
}
}
// File contracts/libs/IERC721Enumerable.sol
// File: openzeppelin-solidity/contracts/token/ERC721/IERC721Enumerable.sol
pragma solidity ^0.8.9;
abstract contract IERC721Enumerable is IERC721 {
function totalSupply() public virtual view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256 tokenId);
function tokenByIndex(uint256 index) public virtual view returns (uint256);
}
// File contracts/libs/ERC721Enumerable.sol
// File: openzeppelin-solidity/contracts/token/ERC721/ERC721Enumerable.sol
pragma solidity ^0.8.9;
contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => uint256[]) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
constructor () {
// register the supported interface to conform to ERC721Enumerable via ERC165
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
function tokenOfOwnerByIndex(address owner, uint256 index) public override view returns (uint256) {
require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
function totalSupply() public override view returns (uint256) {
return _allTokens.length;
}
function tokenByIndex(uint256 index) public override view returns (uint256) {
require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
function _transferFrom(address from, address to, uint256 tokenId) override internal {
super._transferFrom(from, to, tokenId);
_removeTokenFromOwnerEnumeration(from, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
}
function _mint(address to, uint256 tokenId) override internal {
super._mint(to, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
_addTokenToAllTokensEnumeration(tokenId);
}
function _burn(address owner, uint256 tokenId) override internal {
super._burn(owner, tokenId);
_removeTokenFromOwnerEnumeration(owner, tokenId);
// Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund
_ownedTokensIndex[tokenId] = 0;
_removeTokenFromAllTokensEnumeration(tokenId);
}
function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
return _ownedTokens[owner];
}
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
_ownedTokensIndex[tokenId] = _ownedTokens[to].length;
_ownedTokens[to].push(tokenId);
}
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _ownedTokens[from].length - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
_ownedTokens[from].pop();
// Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by
// lastTokenId, or just over the end of the array if the token was the last one).
}
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
_allTokens.pop();
_allTokensIndex[tokenId] = 0;
}
}
// File contracts/libs/CustomERC721Metadata.sol
// File: contracts/CustomERC721Metadata.sol
pragma solidity ^0.8.9;
/**
* ERC721 base contract without the concept of tokenUri as this is managed by the parent
*/
contract CustomERC721Metadata is ERC721Enumerable {
// Token name
string private _name;
// Token symbol
string private _symbol;
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/**
* @dev Constructor function
*/
constructor (string memory nm, string memory sym) {
_name = nm;
_symbol = sym;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721_METADATA);
}
/**
* @dev Gets the token name
* @return string representing the token name
*/
function name() external view returns (string memory) {
return _name;
}
/**
* @dev Gets the token symbol
* @return string representing the token symbol
*/
function symbol() external view returns (string memory) {
return _symbol;
}
}
pragma solidity ^0.8.9;
interface NtentTokenUri {
function tokenUri(uint256 _tokenId) external view returns(string memory);
}
contract NtentArt is CustomERC721Metadata {
event Mint(
address indexed _to,
uint256 indexed _tokenId,
uint256 indexed _projectId
);
struct Project {
string name;
string artist;
string description;
string website;
string license;
address purchaseContract;
address dataContract;
address tokenUriContract;
bool acceptsMintPass;
uint256 mintPassProjectId;
bool dynamic;
string projectBaseURI;
string projectBaseIpfsURI;
uint256 invocations;
uint256 maxInvocations;
string scriptJSON;
mapping(uint256 => string) scripts;
uint scriptCount;
uint256 tokensBurned;
string ipfsHash;
bool useHashString;
bool useIpfs;
bool active;
bool locked;
bool paused;
}
uint256 constant ONE_MILLION = 1_000_000;
mapping(uint256 => Project) projects;
//All financial functions are stripped from struct for visibility
mapping(uint256 => address) public projectIdToArtistAddress;
mapping(uint256 => uint256) public projectIdToPricePerTokenInWei;
address public ntentAddress;
uint256 public ntentPercentage = 10;
mapping(uint256 => string) public staticIpfsImageLink;
mapping(uint256 => uint256) public tokenIdToProjectId;
mapping(uint256 => uint256[]) internal projectIdToTokenIds;
mapping(uint256 => bytes32) public tokenIdToHash;
mapping(bytes32 => uint256) public hashToTokenId;
address public admin;
mapping(address => bool) public isRainbowlisted;
mapping(address => bool) public isMintRainbowlisted;
uint256 public nextProjectId = 1;
modifier onlyValidTokenId(uint256 _tokenId) {
require(_exists(_tokenId), "Token ID not exists");
_;
}
modifier onlyUnlocked(uint256 _projectId) {
require(!projects[_projectId].locked, "Only if unlocked");
_;
}
modifier onlyArtist(uint256 _projectId) {
require(msg.sender == projectIdToArtistAddress[_projectId], "Only artist");
_;
}
modifier onlyAdmin() {
require(msg.sender == admin, "Only admin");
_;
}
modifier onlyRainbowlisted() {
require(isRainbowlisted[msg.sender], "Only Rainbowlisted");
_;
}
modifier onlyArtistOrRainbowlisted(uint256 _projectId) {
require(isRainbowlisted[msg.sender] || msg.sender == projectIdToArtistAddress[_projectId], "Only artist or Rainbowlisted");
_;
}
constructor(string memory _tokenName, string memory _tokenSymbol) CustomERC721Metadata(_tokenName, _tokenSymbol) {
admin = msg.sender;
isRainbowlisted[msg.sender] = true;
ntentAddress = msg.sender;
}
function concatenate(string memory a,string memory b) public pure returns (string memory){
return string(abi.encodePacked(a,b));
}
function uint2str(uint _i) internal pure returns (string memory _uintAsString) {
if (_i == 0) {
return "0";
}
uint j = _i;
uint len;
while (j != 0) {
len++;
j /= 10;
}
bytes memory bstr = new bytes(len);
uint k = len;
while (_i != 0) {
k = k-1;
uint8 temp = (48 + uint8(_i - _i / 10 * 10));
bytes1 b1 = bytes1(temp);
bstr[k] = b1;
_i /= 10;
}
return string(bstr);
}
function mint(address _to, uint256 _projectId, address _by) external returns (uint256 _tokenId) {
require(isMintRainbowlisted[msg.sender], "Must mint from Rainbowlisted minter");
require(projects[_projectId].invocations + 1 <= projects[_projectId].maxInvocations, "Exceeds max invocations");
require(projects[_projectId].active || _by == projectIdToArtistAddress[_projectId], "Proj must exist and be active");
require(!projects[_projectId].paused || _by == projectIdToArtistAddress[_projectId], "Purchases are paused");
uint256 tokenId = _mintToken(_to, _projectId);
return tokenId;
}
function _mintToken(address _to, uint256 _projectId) internal returns (uint256 _tokenId) {
uint256 tokenIdToBe = (_projectId * ONE_MILLION) + projects[_projectId].invocations;
projects[_projectId].invocations = projects[_projectId].invocations + 1;
bytes32 hash = keccak256(abi.encodePacked(projects[_projectId].invocations, block.number, blockhash(block.number - 1), msg.sender, _tokenId));
tokenIdToHash[tokenIdToBe]=hash;
hashToTokenId[hash] = tokenIdToBe;
_mint(_to, tokenIdToBe);
tokenIdToProjectId[tokenIdToBe] = _projectId;
projectIdToTokenIds[_projectId].push(tokenIdToBe);
emit Mint(_to, tokenIdToBe, _projectId);
return tokenIdToBe;
}
function burn(address ownerAddress, uint256 tokenId) external returns(uint256 _tokenId) {
require(isMintRainbowlisted[msg.sender], "Must burn from Rainbowlisted minter");
_burn(ownerAddress, tokenId);
projects[tokenIdToProjectId[tokenId]].tokensBurned = projects[tokenIdToProjectId[tokenId]].tokensBurned + 1;
return tokenId;
}
function updateNtentAddress(address _ntentAddress) public onlyAdmin {
ntentAddress = _ntentAddress;
}
function updateNtentPercentage(uint256 _ntentPercentage) public onlyAdmin {
require(_ntentPercentage <= 50, "Max of 50%");
ntentPercentage = _ntentPercentage;
}
function addRainbowlisted(address _address) public onlyAdmin {
isRainbowlisted[_address] = true;
}
function removeRainbowlisted(address _address) public onlyAdmin {
isRainbowlisted[_address] = false;
}
function addMintRainbowlisted(address _address) public onlyAdmin {
isMintRainbowlisted[_address] = true;
}
function removeMintRainbowlisted(address _address) public onlyAdmin {
isMintRainbowlisted[_address] = false;
}
function getPricePerTokenInWei(uint256 _projectId) public view returns (uint256 price) {
return projectIdToPricePerTokenInWei[_projectId];
}
function toggleProjectIsLocked(uint256 _projectId) public onlyRainbowlisted onlyUnlocked(_projectId) {
projects[_projectId].locked = true;
}
function toggleProjectIsActive(uint256 _projectId) public onlyRainbowlisted {
projects[_projectId].active = !projects[_projectId].active;
}
function updateProjectArtistAddress(uint256 _projectId, address _artistAddress) public onlyArtistOrRainbowlisted(_projectId) {
projectIdToArtistAddress[_projectId] = _artistAddress;
}
function toggleProjectIsPaused(uint256 _projectId) public onlyArtistOrRainbowlisted(_projectId) {
projects[_projectId].paused = !projects[_projectId].paused;
}
function addProject(string memory _projectName, address _artistAddress, uint256 _pricePerTokenInWei, address _purchaseContract, bool _acceptsMintPass, uint256 _mintPassProjectId, bool _dynamic) public onlyRainbowlisted {
uint256 projectId = nextProjectId;
projectIdToArtistAddress[projectId] = _artistAddress;
projects[projectId].name = _projectName;
projects[projectId].purchaseContract = _purchaseContract;
projects[projectId].acceptsMintPass = _acceptsMintPass;
projects[projectId].mintPassProjectId = _mintPassProjectId;
projectIdToPricePerTokenInWei[projectId] = _pricePerTokenInWei;
projects[projectId].paused=true;
projects[projectId].tokensBurned=0;
projects[projectId].dynamic=_dynamic;
projects[projectId].maxInvocations = ONE_MILLION;
if (!_dynamic) {
projects[projectId].useHashString = false;
} else {
projects[projectId].useHashString = true;
}
nextProjectId = nextProjectId + 1;
}
function updateProjectPricePerTokenInWei(uint256 _projectId, uint256 _pricePerTokenInWei) onlyArtist(_projectId) public {
projectIdToPricePerTokenInWei[_projectId] = _pricePerTokenInWei;
}
function updateProjectName(uint256 _projectId, string memory _projectName) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
projects[_projectId].name = _projectName;
}
function updateProjectArtistName(uint256 _projectId, string memory _projectArtistName) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
projects[_projectId].artist = _projectArtistName;
}
function updateProjectPurchaseContractInfo(uint256 _projectId, address _projectPurchaseContract, bool _acceptsMintPass, uint256 _mintPassProjectId) onlyUnlocked(_projectId) onlyRainbowlisted public {
projects[_projectId].purchaseContract = _projectPurchaseContract;
projects[_projectId].acceptsMintPass = _acceptsMintPass;
projects[_projectId].mintPassProjectId = _mintPassProjectId;
}
function updateProjectDataContractInfo(uint256 _projectId, address _projectDataContract) onlyUnlocked(_projectId) onlyRainbowlisted public {
projects[_projectId].dataContract = _projectDataContract;
}
function updateProjectTokenUriContractInfo(uint256 _projectId, address _projectTokenUriContract) onlyUnlocked(_projectId) onlyRainbowlisted public {
projects[_projectId].tokenUriContract = _projectTokenUriContract;
}
function updateProjectDescription(uint256 _projectId, string memory _projectDescription) onlyArtist(_projectId) public {
projects[_projectId].description = _projectDescription;
}
function updateProjectWebsite(uint256 _projectId, string memory _projectWebsite) onlyArtist(_projectId) public {
projects[_projectId].website = _projectWebsite;
}
function updateProjectLicense(uint256 _projectId, string memory _projectLicense) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
projects[_projectId].license = _projectLicense;
}
function updateProjectMaxInvocations(uint256 _projectId, uint256 _maxInvocations) onlyArtist(_projectId) public {
require((!projects[_projectId].locked || _maxInvocations<projects[_projectId].maxInvocations), "Only if unlocked");
require(_maxInvocations > projects[_projectId].invocations, "Max invocations exceeds current");
require(_maxInvocations <= ONE_MILLION, "Cannot exceed 1000000");
projects[_projectId].maxInvocations = _maxInvocations;
}
function toggleProjectUseHashString(uint256 _projectId) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
require(projects[_projectId].invocations == 0, "Cannot modify after token is minted.");
projects[_projectId].useHashString = !projects[_projectId].useHashString;
}
function addProjectScript(uint256 _projectId, string memory _script) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
projects[_projectId].scripts[projects[_projectId].scriptCount] = _script;
projects[_projectId].scriptCount = projects[_projectId].scriptCount + 1;
}
function updateProjectScript(uint256 _projectId, uint256 _scriptId, string memory _script) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
require(_scriptId < projects[_projectId].scriptCount, "scriptId out of range");
projects[_projectId].scripts[_scriptId] = _script;
}
function removeProjectLastScript(uint256 _projectId) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
require(projects[_projectId].scriptCount > 0, "there are no scripts to remove");
delete projects[_projectId].scripts[projects[_projectId].scriptCount - 1];
projects[_projectId].scriptCount = projects[_projectId].scriptCount + 1;
}
function updateProjectScriptJSON(uint256 _projectId, string memory _projectScriptJSON) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
projects[_projectId].scriptJSON = _projectScriptJSON;
}
function updateProjectIpfsHash(uint256 _projectId, string memory _ipfsHash) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
projects[_projectId].ipfsHash = _ipfsHash;
}
function updateProjectBaseURI(uint256 _projectId, string memory _newBaseURI) onlyArtist(_projectId) public {
projects[_projectId].projectBaseURI = _newBaseURI;
}
function updateProjectBaseIpfsURI(uint256 _projectId, string memory _projectBaseIpfsURI) onlyArtist(_projectId) public {
projects[_projectId].projectBaseIpfsURI = _projectBaseIpfsURI;
}
function toggleProjectUseIpfsForStatic(uint256 _projectId) onlyArtistOrRainbowlisted(_projectId) public {
require(!projects[_projectId].dynamic, "can only set static IPFS hash for static projects");
projects[_projectId].useIpfs = !projects[_projectId].useIpfs;
}
function toggleProjectIsDynamic(uint256 _projectId) onlyUnlocked(_projectId) onlyArtistOrRainbowlisted(_projectId) public {
require(projects[_projectId].invocations == 0, "Can not switch after a token is minted.");
if (projects[_projectId].dynamic) {
projects[_projectId].useHashString = false;
} else {
projects[_projectId].useHashString = true;
}
projects[_projectId].dynamic = !projects[_projectId].dynamic;
}
function overrideTokenDynamicImageWithIpfsLink(uint256 _tokenId, string memory _ipfsHash) onlyArtistOrRainbowlisted(tokenIdToProjectId[_tokenId]) public {
staticIpfsImageLink[_tokenId] = _ipfsHash;
}
function clearTokenIpfsImageUri(uint256 _tokenId) onlyArtistOrRainbowlisted(tokenIdToProjectId[_tokenId]) public {
delete staticIpfsImageLink[tokenIdToProjectId[_tokenId]];
}
function projectDetails(uint256 _projectId) view public returns (string memory projectName, string memory artist, string memory description, string memory website, string memory license, bool dynamic) {
projectName = projects[_projectId].name;
artist = projects[_projectId].artist;
description = projects[_projectId].description;
website = projects[_projectId].website;
license = projects[_projectId].license;
dynamic = projects[_projectId].dynamic;
}
function projectTokenInfo(uint256 _projectId) view public returns (address artistAddress, uint256 pricePerTokenInWei, uint256 invocations, uint256 maxInvocations, bool active, address purchaseContract, address dataContract, address tokenUriContract, bool acceptsMintPass, uint256 mintPassProjectId) {
artistAddress = projectIdToArtistAddress[_projectId];
pricePerTokenInWei = projectIdToPricePerTokenInWei[_projectId];
invocations = projects[_projectId].invocations;
maxInvocations = projects[_projectId].maxInvocations;
active = projects[_projectId].active;
purchaseContract = projects[_projectId].purchaseContract;
dataContract = projects[_projectId].dataContract;
tokenUriContract = projects[_projectId].tokenUriContract;
acceptsMintPass = projects[_projectId].acceptsMintPass;
mintPassProjectId = projects[_projectId].mintPassProjectId;
}
function projectScriptInfo(uint256 _projectId) view public returns (string memory scriptJSON, uint256 scriptCount, bool useHashString, string memory ipfsHash, bool locked, bool paused) {
scriptJSON = projects[_projectId].scriptJSON;
scriptCount = projects[_projectId].scriptCount;
useHashString = projects[_projectId].useHashString;
ipfsHash = projects[_projectId].ipfsHash;
locked = projects[_projectId].locked;
paused = projects[_projectId].paused;
}
function projectScriptByIndex(uint256 _projectId, uint256 _index) view public returns (string memory){
return projects[_projectId].scripts[_index];
}
function projectURIInfo(uint256 _projectId) view public returns (string memory projectBaseURI, string memory projectBaseIpfsURI, bool useIpfs) {
projectBaseURI = projects[_projectId].projectBaseURI;
projectBaseIpfsURI = projects[_projectId].projectBaseIpfsURI;
useIpfs = projects[_projectId].useIpfs;
}
function projectShowAllTokens(uint _projectId) public view returns (uint256[] memory){
return projectIdToTokenIds[_projectId];
}
function tokensOfOwner(address owner) external view returns (uint256[] memory) {
return _tokensOfOwner(owner);
}
function tokenURI(uint256 _tokenId) external view onlyValidTokenId(_tokenId) returns (string memory) {
//check if custom tokenUri contract, if so, use that.
if(projects[tokenIdToProjectId[_tokenId]].tokenUriContract != address(0)){
NtentTokenUri ntentTokenUri = NtentTokenUri(projects[tokenIdToProjectId[_tokenId]].tokenUriContract);
return ntentTokenUri.tokenUri(_tokenId);
}
//check if tokenId has a specified image link
if (bytes(staticIpfsImageLink[_tokenId]).length > 0) {
return concatenate(projects[tokenIdToProjectId[_tokenId]].projectBaseIpfsURI, staticIpfsImageLink[_tokenId]);
}
//check if the project has a single overall token Uri (mintpass, etc)
if (!projects[tokenIdToProjectId[_tokenId]].dynamic && projects[tokenIdToProjectId[_tokenId]].useIpfs) {
return concatenate(projects[tokenIdToProjectId[_tokenId]].projectBaseIpfsURI, projects[tokenIdToProjectId[_tokenId]].ipfsHash);
}
return concatenate(projects[tokenIdToProjectId[_tokenId]].projectBaseURI, uint2str(_tokenId));
}
}
Read Contract
admin 0xf851a440 → address
balanceOf 0x70a08231 → uint256
concatenate 0x266001d3 → string
getApproved 0x081812fc → address
getPricePerTokenInWei 0x742ff77a → uint256
hashToTokenId 0xf51f74a9 → uint256
isApprovedForAll 0xe985e9c5 → bool
isMintRainbowlisted 0x810051d7 → bool
isRainbowlisted 0x2002f713 → bool
name 0x06fdde03 → string
nextProjectId 0xe935b7b1 → uint256
ntentAddress 0x4ae9a738 → address
ntentPercentage 0x21c0da79 → uint256
ownerOf 0x6352211e → address
projectDetails 0x8dd91a56 → string, string, string, string, string, bool
projectIdToArtistAddress 0xa47d29cb → address
projectIdToPricePerTokenInWei 0xf70c0f04 → uint256
projectScriptByIndex 0x8c3c9cdd → string
projectScriptInfo 0x4aa6d417 → string, uint256, bool, string, bool, bool
projectShowAllTokens 0xbee04f9c → uint256[]
projectTokenInfo 0x8c2c3622 → address, uint256, uint256, uint256, bool, address, address, address, bool, uint256
projectURIInfo 0x2d9c0205 → string, string, bool
staticIpfsImageLink 0x261eb4e5 → string
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenIdToHash 0x621a1f74 → bytes32
tokenIdToProjectId 0x1b689c0b → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
tokensOfOwner 0x8462151c → uint256[]
totalSupply 0x18160ddd → uint256
Write Contract 40 functions
These functions modify contract state and require a wallet transaction to execute.
addMintRainbowlisted 0x0b8f4d2d
address _address
addProject 0x1afe39f8
string _projectName
address _artistAddress
uint256 _pricePerTokenInWei
address _purchaseContract
bool _acceptsMintPass
uint256 _mintPassProjectId
bool _dynamic
addProjectScript 0xacad0124
uint256 _projectId
string _script
addRainbowlisted 0x43fa7f44
address _address
approve 0x095ea7b3
address to
uint256 tokenId
burn 0x9dc29fac
address ownerAddress
uint256 tokenId
returns: uint256
clearTokenIpfsImageUri 0x27901822
uint256 _tokenId
mint 0x0d4d1513
address _to
uint256 _projectId
address _by
returns: uint256
overrideTokenDynamicImageWithIpfsLink 0x93961c66
uint256 _tokenId
string _ipfsHash
removeMintRainbowlisted 0x3f383cb8
address _address
removeProjectLastScript 0xdb2ff861
uint256 _projectId
removeRainbowlisted 0xbcd4f244
address _address
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address to
bool approved
toggleProjectIsActive 0xd03c390c
uint256 _projectId
toggleProjectIsDynamic 0x3bdbd5c4
uint256 _projectId
toggleProjectIsLocked 0x8ba8f14d
uint256 _projectId
toggleProjectIsPaused 0xa11ec70a
uint256 _projectId
toggleProjectUseHashString 0xdce5d858
uint256 _projectId
toggleProjectUseIpfsForStatic 0x5c088dcc
uint256 _projectId
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
updateNtentAddress 0x360d223a
address _ntentAddress
updateNtentPercentage 0x70a8a0ad
uint256 _ntentPercentage
updateProjectArtistAddress 0x69d14faf
uint256 _projectId
address _artistAddress
updateProjectArtistName 0xb7b04fae
uint256 _projectId
string _projectArtistName
updateProjectBaseIpfsURI 0x6bd5d591
uint256 _projectId
string _projectBaseIpfsURI
updateProjectBaseURI 0x3e48e848
uint256 _projectId
string _newBaseURI
updateProjectDataContractInfo 0xa784d5c1
uint256 _projectId
address _projectDataContract
updateProjectDescription 0xa3b2cca6
uint256 _projectId
string _projectDescription
updateProjectIpfsHash 0x3fef6c2a
uint256 _projectId
string _ipfsHash
updateProjectLicense 0x25b75d68
uint256 _projectId
string _projectLicense
updateProjectMaxInvocations 0x826fc391
uint256 _projectId
uint256 _maxInvocations
updateProjectName 0x0d170673
uint256 _projectId
string _projectName
updateProjectPricePerTokenInWei 0x97dc86cf
uint256 _projectId
uint256 _pricePerTokenInWei
updateProjectPurchaseContractInfo 0x672b17e9
uint256 _projectId
address _projectPurchaseContract
bool _acceptsMintPass
uint256 _mintPassProjectId
updateProjectScript 0xb1656ba3
uint256 _projectId
uint256 _scriptId
string _script
updateProjectScriptJSON 0xc6d73231
uint256 _projectId
string _projectScriptJSON
updateProjectTokenUriContractInfo 0xc26aff0f
uint256 _projectId
address _projectTokenUriContract
updateProjectWebsite 0x37859963
uint256 _projectId
string _projectWebsite
Recent Transactions
No transactions found for this address