Address Contract Verified
Address
0x52263E871674FB1C71f4a4b3575c0cc43d027dd7
Balance
0 ETH
Nonce
1
Code Size
10870 bytes
Creator
0xB5D4b9C8...9463 at tx 0x6e7982dc...fac622
Indexed Transactions
0
Contract Bytecode
10870 bytes
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c806366a16cad1161010f578063a22cb465116100a2578063ce3ab21111610071578063ce3ab21114610492578063dd62ed3e146104a5578063e985e9c5146104d0578063f2fde38b146104fe57600080fd5b8063a22cb46514610446578063a9059cbb14610459578063b88d4fde1461046c578063c87b56dd1461047f57600080fd5b80638da5cb5b116100de5780638da5cb5b146103e857806395d89b41146104085780639b19251a14610410578063a0bcfc7f1461043357600080fd5b806366a16cad1461038a5780636c7b4ef81461039d57806370a08231146103c05780638456cb59146103e057600080fd5b80633f4ba83a11610187578063504334c211610156578063504334c21461034657806353d6fd59146103595780635c975abb1461036c5780636352211e1461037757600080fd5b80633f4ba83a1461030f57806340c10f191461031757806342842e0e1461032a5780634f02c4201461033d57600080fd5b806323b872dd116101c357806323b872dd146102a85780632b968958146102bd578063313ce567146102c557806332cb6b0c146102fe57600080fd5b806306fdde03146101f5578063081812fc14610213578063095ea7b31461026e57806318160ddd14610291575b600080fd5b6101fd610511565b60405161020a9190612689565b60405180910390f35b6102496102213660046124cb565b60076020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161020a565b61028161027c3660046123ab565b61059f565b604051901515815260200161020a565b61029a60035481565b60405190815260200161020a565b6102bb6102b63660046122aa565b610756565b005b6102bb610771565b6102ec7f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff909116815260200161020a565b61029a69021e19e0c9bab240000081565b6102bb610816565b6102bb6103253660046123ab565b610871565b6102bb6103383660046122aa565b610a16565b61029a60045481565b6102bb610354366004612467565b610b5e565b6102bb610367366004612381565b610bbd565b600d5460ff16610281565b6102496103853660046124cb565b610c64565b6102bb610398366004612381565b610cc5565b6102816103ab36600461225c565b600f6020526000908152604090205460ff1681565b61029a6103ce36600461225c565b60056020526000908152604090205481565b6102bb610d9e565b6000546102499073ffffffffffffffffffffffffffffffffffffffff1681565b6101fd610df7565b61028161041e36600461225c565b600c6020526000908152604090205460ff1681565b6102bb610441366004612432565b610e04565b6102bb610454366004612381565b610e68565b6102816104673660046123ab565b610ef8565b6102bb61047a3660046122e6565b610f16565b6101fd61048d3660046124cb565b611053565b6102bb6104a03660046123d5565b6110f9565b61029a6104b3366004612277565b600660209081526000928352604080842090915290825290205481565b6102816104de366004612277565b600860209081526000928352604080842090915290825290205460ff1681565b6102bb61050c36600461225c565b6111ae565b6001805461051e906128b4565b80601f016020809104026020016040519081016040528092919081815260200182805461054a906128b4565b80156105975780601f1061056c57610100808354040283529160200191610597565b820191906000526020600020905b81548152906001019060200180831161057a57829003601f168201915b505050505081565b600060045482111580156105b35750600082115b156106e35760008281526009602052604090205473ffffffffffffffffffffffffffffffffffffffff1633811480159061061e575073ffffffffffffffffffffffffffffffffffffffff8116600090815260086020908152604080832033845290915290205460ff16155b15610655576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008381526007602090815260409182902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8881169182179092559251868152908416917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35061074c565b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff881680855290835292819020869055518581529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35b5060015b92915050565b6107618383836112bc565b61076c8383836112f4565b505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107c2576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560405133907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3565b60005473ffffffffffffffffffffffffffffffffffffffff163314610867576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61086f6117d8565b565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108c2576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6108ed7f0000000000000000000000000000000000000000000000000000000000000012600a612767565b6108f79082612830565b905069021e19e0c9bab2400000816003600082825461091691906126da565b9250508190551115610989576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f4572726f723a20616d6f756e740000000000000000000000000000000000000060448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040812080548392906109be9084906126da565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fe59fdd36d0d223c0c7d996db7ad796880f45e1936cb0bb7ac102e7082e031487906020015b60405180910390a35050565b610a21838383610756565b73ffffffffffffffffffffffffffffffffffffffff82163b15801590610b2757506040517f150b7a020000000000000000000000000000000000000000000000000000000080825233600483015273ffffffffffffffffffffffffffffffffffffffff858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a401602060405180830381600087803b158015610aca57600080fd5b505af1158015610ade573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0291906123f0565b7fffffffff000000000000000000000000000000000000000000000000000000001614155b1561076c576040517f3da6393100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005473ffffffffffffffffffffffffffffffffffffffff163314610baf576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610bb982826118b9565b5050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610c0e576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff919091166000908152600c6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60008181526009602052604090205473ffffffffffffffffffffffffffffffffffffffff1680610cc0576040517fc5723b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610d16576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166000908152600f602052604090205460ff16151581151514610bb95773ffffffffffffffffffffffffffffffffffffffff82166000908152600f6020526040902080548215157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091161790555050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610def576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61086f6118e0565b6002805461051e906128b4565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e55576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8051610bb990600e9060208401906120e4565b33600081815260086020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101610a0a565b6000610f053384846112bc565b610f0f83836119a0565b9392505050565b610f21858585610756565b73ffffffffffffffffffffffffffffffffffffffff84163b1580159061101557506040517f150b7a02000000000000000000000000000000000000000000000000000000008082529073ffffffffffffffffffffffffffffffffffffffff86169063150b7a0290610f9e9033908a9089908990899060040161260a565b602060405180830381600087803b158015610fb857600080fd5b505af1158015610fcc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff091906123f0565b7fffffffff000000000000000000000000000000000000000000000000000000001614155b1561104c576040517f3da6393100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b60606000600e8054611064906128b4565b905011156110c057600e61109961271061107f60018661286d565b6110899190612941565b6110949060016126da565b6119ad565b6040516020016110aa929190612500565b6040516020818303038152906040529050919050565b505060408051808201909152600481527f6e756c6c00000000000000000000000000000000000000000000000000000000602082015290565b3360009081526005602052604090205415611170576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f42616c616e6365203e20300000000000000000000000000000000000000000006044820152606401610980565b336000908152600c6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146111ff576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff811661124c576040517f49e27cff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604090205460ff1661076c5761076c838383611ae7565b60045481116117395760008181526009602052604090205473ffffffffffffffffffffffffffffffffffffffff84811691161461135d576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166113aa576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff841614801590611401575073ffffffffffffffffffffffffffffffffffffffff8316600090815260086020908152604080832033845290915290205460ff16155b8015611431575060008181526007602052604090205473ffffffffffffffffffffffffffffffffffffffff163314155b15611468576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611470611b54565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260056020526040812080549091906114a590849061286d565b909155506114b39050611b54565b73ffffffffffffffffffffffffffffffffffffffff808416600081815260056020908152604080832080549096019095558582526009815284822080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690941790556007815284822080549093169092559186168252600a905290812080546115429060019061286d565b81548110611552576115526129e2565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff87168352600a82526040808420868552600b909352909220548154929350839281106115a3576115a36129e2565b600091825260208083209091019290925573ffffffffffffffffffffffffffffffffffffffff86168152600a909152604090208054806115e5576115e56129b3565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101839055909201909255838252600b81526040808320548484528184205573ffffffffffffffffffffffffffffffffffffffff8616808452600a83529083208054600181810183558286529385200186905592529054611674919061286d565b6000838152600b6020526040808220929092559051839173ffffffffffffffffffffffffffffffffffffffff80871692908816917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a48273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fe59fdd36d0d223c0c7d996db7ad796880f45e1936cb0bb7ac102e7082e031487611722611b54565b60405190815260200160405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff831660009081526006602090815260408083203384529091529020547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146117cd5761179b828261286d565b73ffffffffffffffffffffffffffffffffffffffff851660009081526006602090815260408083203384529091529020555b61104c848484611b86565b600d5460ff16611844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f74207061757365640000000000000000000000006044820152606401610980565b600d80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b81516118cc9060019060208501906120e4565b50805161076c9060029060208401906120e4565b600d5460ff161561194d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a20706175736564000000000000000000000000000000006044820152606401610980565b600d80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861188f3390565b6000610f0f338484611b86565b6060816119ed57505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115611a175780611a0181612908565b9150611a109050600a836126f2565b91506119f1565b60008167ffffffffffffffff811115611a3257611a32612a11565b6040519080825280601f01601f191660200182016040528015611a5c576020820181803683370190505b5090505b8415611adf57611a7160018361286d565b9150611a7e600a86612941565b611a899060306126da565b60f81b818381518110611a9e57611a9e6129e2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350611ad8600a866126f2565b9450611a60565b949350505050565b600d5460ff161561076c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433430345061757361626c653a207472616e7366657220706175736564006044820152606401610980565b6000611b817f0000000000000000000000000000000000000000000000000000000000000012600a612767565b905090565b600080611b91611b54565b73ffffffffffffffffffffffffffffffffffffffff8087166000818152600560205260408082208054948a1683529082205492825293945091929091869190611bda838661286d565b909155505073ffffffffffffffffffffffffffffffffffffffff808716600090815260056020908152604080832080548a019055928a168252600c9052205460ff16611c905773ffffffffffffffffffffffffffffffffffffffff8716600090815260056020526040812054611c519085906126f2565b611c5b85856126f2565b611c65919061286d565b905060005b81811015611c8d57611c7b89611da3565b80611c8581612908565b915050611c6a565b50505b73ffffffffffffffffffffffffffffffffffffffff86166000908152600c602052604090205460ff16611d2f576000611cc984836126f2565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260056020526040902054611cfa9086906126f2565b611d04919061286d565b905060005b81811015611d2c57611d1a88611f5b565b80611d2481612908565b915050611d09565b50505b8573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fe59fdd36d0d223c0c7d996db7ad796880f45e1936cb0bb7ac102e7082e03148787604051611d8e91815260200190565b60405180910390a35060019695505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116611df0576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602052604081208054611e239060019061286d565b81548110611e3357611e336129e2565b90600052602060002001549050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480611e8e57611e8e6129b3565b6000828152602080822083017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff908101839055909201909255828252600b815260408083208390556009825280832080547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909155600790925280832080549092169091555182919073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b73ffffffffffffffffffffffffffffffffffffffff8116611fa8576040517f9c8d2cd200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600480546001019081905560008181526009602052604090205473ffffffffffffffffffffffffffffffffffffffff161561200f576040517f23369fa600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600081815260096020908152604080832080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8716908117909155808452600a8352908320805460018181018355828652938520018590559252905461208c919061286d565b6000828152600b6020526040808220929092559051829173ffffffffffffffffffffffffffffffffffffffff8516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b8280546120f0906128b4565b90600052602060002090601f0160209004810192826121125760008555612158565b82601f1061212b57805160ff1916838001178555612158565b82800160010185558215612158579182015b8281111561215857825182559160200191906001019061213d565b50612164929150612168565b5090565b5b808211156121645760008155600101612169565b803573ffffffffffffffffffffffffffffffffffffffff81168114610cc057600080fd5b80358015158114610cc057600080fd5b600082601f8301126121c257600080fd5b813567ffffffffffffffff808211156121dd576121dd612a11565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561222357612223612a11565b8160405283815286602085880101111561223c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561226e57600080fd5b610f0f8261217d565b6000806040838503121561228a57600080fd5b6122938361217d565b91506122a16020840161217d565b90509250929050565b6000806000606084860312156122bf57600080fd5b6122c88461217d565b92506122d66020850161217d565b9150604084013590509250925092565b6000806000806000608086880312156122fe57600080fd5b6123078661217d565b94506123156020870161217d565b935060408601359250606086013567ffffffffffffffff8082111561233957600080fd5b818801915088601f83011261234d57600080fd5b81358181111561235c57600080fd5b89602082850101111561236e57600080fd5b9699959850939650602001949392505050565b6000806040838503121561239457600080fd5b61239d8361217d565b91506122a1602084016121a1565b600080604083850312156123be57600080fd5b6123c78361217d565b946020939093013593505050565b6000602082840312156123e757600080fd5b610f0f826121a1565b60006020828403121561240257600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610f0f57600080fd5b60006020828403121561244457600080fd5b813567ffffffffffffffff81111561245b57600080fd5b611adf848285016121b1565b6000806040838503121561247a57600080fd5b823567ffffffffffffffff8082111561249257600080fd5b61249e868387016121b1565b935060208501359150808211156124b457600080fd5b506124c1858286016121b1565b9150509250929050565b6000602082840312156124dd57600080fd5b5035919050565b600081516124f6818560208601612884565b9290920192915050565b600080845481600182811c91508083168061251c57607f831692505b6020808410821415612555577f4e487b710000000000000000000000000000000000000000000000000000000086526022600452602486fd5b8180156125695760018114612598576125c5565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008616895284890196506125c5565b60008b81526020902060005b868110156125bd5781548b8201529085019083016125a4565b505084890196505b5050505050506126016125d882866124e4565b7f2e6a736f6e000000000000000000000000000000000000000000000000000000815260050190565b95945050505050565b600073ffffffffffffffffffffffffffffffffffffffff808816835280871660208401525084604083015260806060830152826080830152828460a0840137600060a0848401015260a07fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f85011683010190509695505050505050565b60208152600082518060208401526126a8816040850160208701612884565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b600082198211156126ed576126ed612955565b500190565b60008261270157612701612984565b500490565b600181815b8085111561275f57817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561274557612745612955565b8085161561275257918102915b93841c939080029061270b565b509250929050565b6000610f0f60ff84168360008261278057506001610750565b8161278d57506000610750565b81600181146127a357600281146127ad576127c9565b6001915050610750565b60ff8411156127be576127be612955565b50506001821b610750565b5060208310610133831016604e8410600b84101617156127ec575081810a610750565b6127f68383612706565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561282857612828612955565b029392505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561286857612868612955565b500290565b60008282101561287f5761287f612955565b500390565b60005b8381101561289f578181015183820152602001612887565b838111156128ae576000848401525b50505050565b600181811c908216806128c857607f821691505b60208210811415612902577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561293a5761293a612955565b5060010190565b60008261295057612950612984565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea2646970667358221220c1c6132d003c42c7403102a7aca1fb1db1db5503d19157b71b0a7ccc5033835a64736f6c63430008070033
Verified Source Code Full Match
Compiler: v0.8.7+commit.e28d00a7
EVM: istanbul
Optimization: Yes (999999 runs)
BitcoinCats404.sol 65 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Strings.sol";
import "./ERC404/ERC404PlusPausable.sol";
contract BitcoinCats404 is ERC404PlusPausable {
uint256 public constant MAX_SUPPLY = 10000 * 1E18;
string private _baseUri;
mapping(address => bool) public whitelistTransfer;
constructor() ERC404Plus("BitcoinCats404", "404Cats", 18, 0, msg.sender) {
whitelistTransfer[address(0)] = true;
emit ERC20Transfer(address(0), msg.sender, balanceOf[msg.sender] = 0);
}
function mint(address to, uint256 amount) public onlyOwner {
amount = amount * (10 ** decimals);
require((totalSupply += amount) <= MAX_SUPPLY, 'Error: amount');
balanceOf[to] += amount;
emit ERC20Transfer(address(0), to, amount);
}
function setBaseUri(string memory newUri) public onlyOwner {
_baseUri = newUri;
}
function setNameSymbol(
string memory _name,
string memory _symbol
) public onlyOwner {
_setNameSymbol(_name, _symbol);
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
if (bytes(_baseUri).length > 0) {
return string(abi.encodePacked(_baseUri, Strings.toString((tokenId - 1) % 10000 + 1), ".json"));
} else {
return 'null';
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amountOrId
) internal virtual override {
if (!whitelistTransfer[from]) super._beforeTokenTransfer(from, to, amountOrId);
}
function setWhitelistTransfer(address account, bool isAdd) public onlyOwner {
if (whitelistTransfer[account] != isAdd) {
whitelistTransfer[account] = isAdd;
}
}
function pause() public onlyOwner {
_pause();
}
function unpause() public onlyOwner {
_unpause();
}
}
Ownable.sol 38 lines
pragma solidity ^0.8.0;
abstract contract Ownable {
event OwnershipTransferred(address indexed user, address indexed newOwner);
error Unauthorized();
error InvalidOwner();
address public owner;
modifier onlyOwner() virtual {
if (msg.sender != owner) revert Unauthorized();
_;
}
constructor(address _owner) {
if (_owner == address(0)) revert InvalidOwner();
owner = _owner;
emit OwnershipTransferred(address(0), _owner);
}
function transferOwnership(address _owner) public virtual onlyOwner {
if (_owner == address(0)) revert InvalidOwner();
owner = _owner;
emit OwnershipTransferred(msg.sender, _owner);
}
function revokeOwnership() public virtual onlyOwner {
owner = address(0);
emit OwnershipTransferred(msg.sender, address(0));
}
}
ERC404Plus.sol 338 lines
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "./Ownable.sol";
import "./ERC721Receiver.sol";
abstract contract ERC404Plus is Ownable {
// Events
event ERC20Transfer(
address indexed from,
address indexed to,
uint256 amount
);
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
event Transfer(
address indexed from,
address indexed to,
uint256 indexed id
);
event ERC721Approval(
address indexed owner,
address indexed spender,
uint256 indexed id
);
event ApprovalForAll(
address indexed owner,
address indexed operator,
bool approved
);
// Errors
error NotFound();
error AlreadyExists();
error InvalidRecipient();
error InvalidSender();
error UnsafeRecipient();
// Metadata
/// @dev Token name
string public name;
/// @dev Token symbol
string public symbol;
/// @dev Decimals for fractional representation
uint8 public immutable decimals;
/// @dev Total supply in fractionalized representation
uint256 public totalSupply;
/// @dev Current mint counter, monotonically increasing to ensure accurate ownership
uint256 public minted;
// Mappings
/// @dev Balance of user in fractional representation
mapping(address => uint256) public balanceOf;
/// @dev Allowance of user in fractional representation
mapping(address => mapping(address => uint256)) public allowance;
/// @dev Approval in native representaion
mapping(uint256 => address) public getApproved;
/// @dev Approval for all in native representation
mapping(address => mapping(address => bool)) public isApprovedForAll;
/// @dev Owner of id in native representation
mapping(uint256 => address) internal _ownerOf;
/// @dev Array of owned ids in native representation
mapping(address => uint256[]) internal _owned;
/// @dev Tracks indices for the _owned mapping
mapping(uint256 => uint256) internal _ownedIndex;
/// @dev Addresses whitelisted from minting / burning for gas savings (pairs, routers, etc)
mapping(address => bool) public whitelist;
// Constructor
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
uint256 _totalNativeSupply,
address _owner
) Ownable(_owner) {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalNativeSupply * (10 ** _decimals);
}
/// @notice Initialization function to set pairs / etc
/// saving gas by avoiding mint / burn on unnecessary targets
function setWhitelist(address target, bool state) public onlyOwner {
whitelist[target] = state;
}
function setSelfWhitelist(bool state) public {
require(balanceOf[msg.sender] == 0,'Balance > 0');
whitelist[msg.sender] = state;
}
/// @notice Function to find owner of a given native token
function ownerOf(uint256 id) public view virtual returns (address owner) {
owner = _ownerOf[id];
if (owner == address(0)) {
revert NotFound();
}
}
/// @notice tokenURI must be implemented by child contract
function tokenURI(uint256 id) public view virtual returns (string memory);
/// @notice Function for token approvals
/// @dev This function assumes id / native if amount less than or equal to current max id
function approve(
address spender,
uint256 amountOrId
) public virtual returns (bool) {
if (amountOrId <= minted && amountOrId > 0) {
address owner = _ownerOf[amountOrId];
if (msg.sender != owner && !isApprovedForAll[owner][msg.sender]) {
revert Unauthorized();
}
getApproved[amountOrId] = spender;
emit Approval(owner, spender, amountOrId);
} else {
allowance[msg.sender][spender] = amountOrId;
emit Approval(msg.sender, spender, amountOrId);
}
return true;
}
/// @notice Function native approvals
function setApprovalForAll(address operator, bool approved) public virtual {
isApprovedForAll[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
/// @notice Function for mixed transfers
/// @dev This function assumes id / native if amount less than or equal to current max id
function transferFrom(
address from,
address to,
uint256 amountOrId
) public virtual {
if (amountOrId <= minted) {
if (from != _ownerOf[amountOrId]) {
revert InvalidSender();
}
if (to == address(0)) {
revert InvalidRecipient();
}
if (
msg.sender != from &&
!isApprovedForAll[from][msg.sender] &&
msg.sender != getApproved[amountOrId]
) {
revert Unauthorized();
}
balanceOf[from] -= _getUnit();
unchecked {
balanceOf[to] += _getUnit();
}
_ownerOf[amountOrId] = to;
delete getApproved[amountOrId];
// update _owned for sender
uint256 updatedId = _owned[from][_owned[from].length - 1];
_owned[from][_ownedIndex[amountOrId]] = updatedId;
// pop
_owned[from].pop();
// update index for the moved id
_ownedIndex[updatedId] = _ownedIndex[amountOrId];
// push token to to owned
_owned[to].push(amountOrId);
// update index for to owned
_ownedIndex[amountOrId] = _owned[to].length - 1;
emit Transfer(from, to, amountOrId);
emit ERC20Transfer(from, to, _getUnit());
} else {
uint256 allowed = allowance[from][msg.sender];
if (allowed != type(uint256).max)
allowance[from][msg.sender] = allowed - amountOrId;
_transfer(from, to, amountOrId);
}
}
/// @notice Function for fractional transfers
function transfer(
address to,
uint256 amount
) public virtual returns (bool) {
return _transfer(msg.sender, to, amount);
}
/// @notice Function for native transfers with contract support
function safeTransferFrom(
address from,
address to,
uint256 id
) public virtual {
transferFrom(from, to, id);
if (
to.code.length != 0 &&
ERC721Receiver(to).onERC721Received(msg.sender, from, id, "") !=
ERC721Receiver.onERC721Received.selector
) {
revert UnsafeRecipient();
}
}
/// @notice Function for native transfers with contract support and callback data
function safeTransferFrom(
address from,
address to,
uint256 id,
bytes calldata data
) public virtual {
transferFrom(from, to, id);
if (
to.code.length != 0 &&
ERC721Receiver(to).onERC721Received(msg.sender, from, id, data) !=
ERC721Receiver.onERC721Received.selector
) {
revert UnsafeRecipient();
}
}
/// @notice Internal function for fractional transfers
function _transfer(
address from,
address to,
uint256 amount
) internal returns (bool) {
uint256 unit = _getUnit();
uint256 balanceBeforeSender = balanceOf[from];
uint256 balanceBeforeReceiver = balanceOf[to];
balanceOf[from] -= amount;
unchecked {
balanceOf[to] += amount;
}
// Skip burn for certain addresses to save gas
if (!whitelist[from]) {
uint256 tokens_to_burn = (balanceBeforeSender / unit) -
(balanceOf[from] / unit);
for (uint256 i = 0; i < tokens_to_burn; i++) {
_burn(from);
}
}
// Skip minting for certain addresses to save gas
if (!whitelist[to]) {
uint256 tokens_to_mint = (balanceOf[to] / unit) -
(balanceBeforeReceiver / unit);
for (uint256 i = 0; i < tokens_to_mint; i++) {
_mint(to);
}
}
emit ERC20Transfer(from, to, amount);
return true;
}
// Internal utility logic
function _getUnit() internal view returns (uint256) {
return 10 ** decimals;
}
function _mint(address to) internal virtual {
if (to == address(0)) {
revert InvalidRecipient();
}
unchecked {
minted++;
}
uint256 id = minted;
if (_ownerOf[id] != address(0)) {
revert AlreadyExists();
}
_ownerOf[id] = to;
_owned[to].push(id);
_ownedIndex[id] = _owned[to].length - 1;
emit Transfer(address(0), to, id);
}
function _burn(address from) internal virtual {
if (from == address(0)) {
revert InvalidSender();
}
uint256 id = _owned[from][_owned[from].length - 1];
_owned[from].pop();
delete _ownedIndex[id];
delete _ownerOf[id];
delete getApproved[id];
emit Transfer(from, address(0), id);
}
function _setNameSymbol(
string memory _name,
string memory _symbol
) internal {
name = _name;
symbol = _symbol;
}
}
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;
}
}
Strings.sol 67 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
ERC721Receiver.sol 12 lines
pragma solidity ^0.8.0;
abstract contract ERC721Receiver {
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external virtual returns (bytes4) {
return ERC721Receiver.onERC721Received.selector;
}
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!paused(), "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(paused(), "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
ERC404PlusPausable.sol 32 lines
pragma solidity ^0.8.0;
import "./ERC404Plus.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
abstract contract ERC404PlusPausable is ERC404Plus, Pausable {
function _beforeTokenTransfer(
address from,
address to,
uint256 amountOrId
) internal virtual {
require(!paused(), "ERC404Pausable: transfer paused");
}
function transferFrom(
address from,
address to,
uint256 amountOrId
) public virtual override {
_beforeTokenTransfer(from, to, amountOrId);
super.transferFrom(from, to, amountOrId);
}
function transfer(
address to,
uint256 amount
) public virtual override returns (bool) {
_beforeTokenTransfer(msg.sender, to, amount);
return super.transfer(to, amount);
}
}
Read Contract
MAX_SUPPLY 0x32cb6b0c → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
minted 0x4f02c420 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
whitelist 0x9b19251a → bool
whitelistTransfer 0x6c7b4ef8 → bool
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amountOrId
returns: bool
mint 0x40c10f19
address to
uint256 amount
pause 0x8456cb59
No parameters
revokeOwnership 0x2b968958
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 id
safeTransferFrom 0xb88d4fde
address from
address to
uint256 id
bytes data
setApprovalForAll 0xa22cb465
address operator
bool approved
setBaseUri 0xa0bcfc7f
string newUri
setNameSymbol 0x504334c2
string _name
string _symbol
setSelfWhitelist 0xce3ab211
bool state
setWhitelist 0x53d6fd59
address target
bool state
setWhitelistTransfer 0x66a16cad
address account
bool isAdd
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amountOrId
transferOwnership 0xf2fde38b
address _owner
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address