Address Contract Partially Verified
Address
0x8E44eBb62Ef1d1191eDA8E5f1cB2FFC279182C5B
Balance
0 ETH
Nonce
1
Code Size
12210 bytes
Creator
0x5d8876c4...4316 at tx 0xd47573d2...6554f4
Indexed Transactions
0
Contract Bytecode
12210 bytes
0x608060405260043610610185576000357c01000000000000000000000000000000000000000000000000000000009004806301ffc9a71461018a57806306fdde03146101fc578063081812fc1461028c578063095ea7b314610307578063162094c41461036257806318160ddd1461043457806323b872dd1461045f57806324af9942146104da57806330176e13146104f15780633f4ba83a146105b957806342842e0e146105d057806346fbf68e1461064b5780634f558e79146106b45780635c975abb146107075780636352211e146107365780636ef8d66d146107b157806370a08231146107c857806382dc1ec41461082d5780638456cb591461087e57806395d89b4114610895578063983b2d56146109255780639865027514610976578063a22cb4651461098d578063aa271e1a146109ea578063b88d4fde14610a53578063be65d75114610b65578063c87b56dd14610bb4578063d547cfb714610c68578063e725f87714610cf8578063e86f636714610dac578063e985e9c514610f3f575b600080fd5b34801561019657600080fd5b506101e2600480360360208110156101ad57600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610fc8565b604051808215151515815260200191505060405180910390f35b34801561020857600080fd5b5061021161102f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610251578082015181840152602081019050610236565b50505050905090810190601f16801561027e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029857600080fd5b506102c5600480360360208110156102af57600080fd5b81019080803590602001909291905050506110d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561031357600080fd5b506103606004803603604081101561032a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611122565b005b34801561036e57600080fd5b506104326004803603604081101561038557600080fd5b8101908080359060200190929190803590602001906401000000008111156103ac57600080fd5b8201836020820111156103be57600080fd5b803590602001918460018302840111640100000000831117156103e057600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611283565b005b34801561044057600080fd5b506104496112c1565b6040518082815260200191505060405180910390f35b34801561046b57600080fd5b506104d86004803603606081101561048257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112cb565b005b3480156104e657600080fd5b506104ef61130c565b005b3480156104fd57600080fd5b506105b76004803603602081101561051457600080fd5b810190808035906020019064010000000081111561053157600080fd5b82018360208201111561054357600080fd5b8035906020019184600183028401116401000000008311171561056557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061133d565b005b3480156105c557600080fd5b506105ce61136b565b005b3480156105dc57600080fd5b50610649600480360360608110156105f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061141a565b005b34801561065757600080fd5b5061069a6004803603602081101561066e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061143b565b604051808215151515815260200191505060405180910390f35b3480156106c057600080fd5b506106ed600480360360208110156106d757600080fd5b8101908080359060200190929190505050611458565b604051808215151515815260200191505060405180910390f35b34801561071357600080fd5b5061071c61146a565b604051808215151515815260200191505060405180910390f35b34801561074257600080fd5b5061076f6004803603602081101561075957600080fd5b8101908080359060200190929190505050611481565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107bd57600080fd5b506107c66114ff565b005b3480156107d457600080fd5b50610817600480360360208110156107eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061150a565b6040518082815260200191505060405180910390f35b34801561083957600080fd5b5061087c6004803603602081101561085057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061158e565b005b34801561088a57600080fd5b506108936115ae565b005b3480156108a157600080fd5b506108aa61165e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108ea5780820151818401526020810190506108cf565b50505050905090810190601f1680156109175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561093157600080fd5b506109746004803603602081101561094857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611700565b005b34801561098257600080fd5b5061098b611720565b005b34801561099957600080fd5b506109e8600480360360408110156109b057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061172b565b005b3480156109f657600080fd5b50610a3960048036036020811015610a0d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611883565b604051808215151515815260200191505060405180910390f35b348015610a5f57600080fd5b50610b6360048036036080811015610a7657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610add57600080fd5b820183602082011115610aef57600080fd5b80359060200191846001830284011164010000000083111715610b1157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506118a0565b005b348015610b7157600080fd5b50610b9e60048036036020811015610b8857600080fd5b81019080803590602001909291905050506118c8565b6040518082815260200191505060405180910390f35b348015610bc057600080fd5b50610bed60048036036020811015610bd757600080fd5b81019080803590602001909291905050506118f9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610c2d578082015181840152602081019050610c12565b50505050905090810190601f168015610c5a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610c7457600080fd5b50610c7d611a13565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610cbd578082015181840152602081019050610ca2565b50505050905090810190601f168015610cea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610d0457600080fd5b50610d3160048036036020811015610d1b57600080fd5b8101908080359060200190929190505050611ab5565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610d71578082015181840152602081019050610d56565b50505050905090810190601f168015610d9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610db857600080fd5b50610f3d600480360360a0811015610dcf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610e1657600080fd5b820183602082011115610e2857600080fd5b80359060200191846001830284011164010000000083111715610e4a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919080359060200190640100000000811115610eb757600080fd5b820183602082011115610ec957600080fd5b80359060200191846001830284011164010000000083111715610eeb57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050611b7e565b005b348015610f4b57600080fd5b50610fae60048036036040811015610f6257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bd5565b604051808215151515815260200191505060405180910390f35b6000806000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110c75780601f1061109c576101008083540402835291602001916110c7565b820191906000526020600020905b8154815290600101906020018083116110aa57829003601f168201915b5050505050905090565b60006110dc82611c69565b15156110e757600080fd5b600a600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600260009054906101000a900460ff1615151561113e57600080fd5b600061114982611481565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561118657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111c657506111c58133611bd5565b5b15156111d157600080fd5b82600a600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b61128c33611883565b151561129757600080fd5b600760009054906101000a900460ff161515156112b357600080fd5b6112bd8282611cdb565b5050565b6000600854905090565b600260009054906101000a900460ff161515156112e757600080fd5b6112f13382611db8565b15156112fc57600080fd5b611307838383611e4d565b505050565b61131533611883565b151561132057600080fd5b6001600760006101000a81548160ff021916908315150217905550565b61134633611883565b151561135157600080fd5b8060069080519060200190611367929190612ee1565b5050565b6113743361143b565b151561137f57600080fd5b600260009054906101000a900460ff16151561139a57600080fd5b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b61143683838360206040519081016040528060008152506118a0565b505050565b60006114518260016120b290919063ffffffff16565b9050919050565b600061146382611c69565b9050919050565b6000600260009054906101000a900460ff16905090565b6000806009600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114f657600080fd5b80915050919050565b61150833612146565b565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561154757600080fd5b600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6115973361143b565b15156115a257600080fd5b6115ab816121a0565b50565b6115b73361143b565b15156115c257600080fd5b600260009054906101000a900460ff161515156115de57600080fd5b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116f65780601f106116cb576101008083540402835291602001916116f6565b820191906000526020600020905b8154815290600101906020018083116116d957829003601f168201915b5050505050905090565b61170933611883565b151561171457600080fd5b61171d816121fa565b50565b61172933612254565b565b600260009054906101000a900460ff1615151561174757600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561178257600080fd5b80600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051808215151515815260200191505060405180910390a35050565b60006118998260036120b290919063ffffffff16565b9050919050565b6118ab8484846112cb565b6118b7848484846122ae565b15156118c257600080fd5b50505050565b60006118d382611c69565b15156118de57600080fd5b600c6000838152602001908152602001600020549050919050565b606061190482611c69565b151561190f57600080fd5b6000600b600084815260200190815260200160002080546001816001161561010002031660029004905011156119f257600b60008381526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119e65780601f106119bb576101008083540402835291602001916119e6565b820191906000526020600020905b8154815290600101906020018083116119c957829003601f168201915b50505050509050611a0e565b611a0b6119fd611a13565b611a06846124d1565b61262a565b90505b919050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611aab5780601f10611a8057610100808354040283529160200191611aab565b820191906000526020600020905b815481529060010190602001808311611a8e57829003601f168201915b5050505050905090565b6060611ac082611c69565b1515611acb57600080fd5b600d60008381526020019081526020016000208054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b725780601f10611b4757610100808354040283529160200191611b72565b820191906000526020600020905b815481529060010190602001808311611b5557829003601f168201915b50505050509050919050565b611b8733611883565b1515611b9257600080fd5b60008410158015611ba5575061270f8411155b1515611bb057600080fd5b611bbd8585858585612671565b60016008600082825401925050819055505050505050565b6000600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000806009600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415915050919050565b611ce482611c69565b1515611cef57600080fd5b80600b60008481526020019081526020016000209080519060200190611d16929190612ee1565b50817fe9dd2c01379f6033709e315d41f1a58fcbd937ae2512da16462852d1082e7b73826040518080602001828103825283818151815260200191508051906020019080838360005b83811015611d7a578082015181840152602081019050611d5f565b50505050905090810190601f168015611da75780820380516001836020036101000a031916815260200191505b509250505060405180910390a25050565b600080611dc483611481565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611e3357508373ffffffffffffffffffffffffffffffffffffffff16611e1b846110d1565b73ffffffffffffffffffffffffffffffffffffffff16145b80611e445750611e438185611bd5565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611e6d82611481565b73ffffffffffffffffffffffffffffffffffffffff16141515611e8f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611ecb57600080fd5b611ed481612857565b611f276001600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461291790919063ffffffff16565b600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fbd6001600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461293990919063ffffffff16565b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816009600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156120ef57600080fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b61215a81600161295a90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b6121b4816001612a0990919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b61220e816003612a0990919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61226881600361295a90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60006122cf8473ffffffffffffffffffffffffffffffffffffffff16612ab9565b15156122de57600190506124c9565b60008473ffffffffffffffffffffffffffffffffffffffff1663150b7a02338887876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156123d55780820151818401526020810190506123ba565b50505050905090810190601f1680156124025780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15801561242457600080fd5b505af1158015612438573d6000803e3d6000fd5b505050506040513d602081101561244e57600080fd5b8101908080519060200190929190505050905063150b7a027c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150505b949350505050565b60606000821415612519576040805190810160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050612625565b600082905060005b600082141515612547578080600101915050600a8281151561253f57fe5b049150612521565b6060816040519080825280601f01601f19166020018201604052801561257c5781602001600182028038833980820191505090505b50905060006001830390505b60008614151561261d57600a8681151561259e57fe5b066030017f0100000000000000000000000000000000000000000000000000000000000000028282806001900393508151811015156125d957fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a8681151561261557fe5b049550612588565b819450505050505b919050565b60606126698383602060405190810160405280600081525060206040519081016040528060008152506020604051908101604052806000815250612acc565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156126ad57600080fd5b6126b684611c69565b1515156126c257600080fd5b846009600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506127676001600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461293990919063ffffffff16565b600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127b48484611cdb565b81600c60008681526020019081526020016000208190555080600d600086815260200190815260200160002090805190602001906127f3929190612ee1565b50838573ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b600073ffffffffffffffffffffffffffffffffffffffff16600a600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612914576000600a600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b600082821115151561292857600080fd5b600082840390508091505092915050565b600080828401905083811015151561295057600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561299657600080fd5b6129a082826120b2565b15156129ab57600080fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612a4557600080fd5b612a4f82826120b2565b151515612a5b57600080fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600080823b905060008111915050919050565b6060808690506060869050606086905060608690506060869050606081518351855187518951010101016040519080825280601f01601f191660200182016040528015612b285781602001600182028038833980820191505090505b50905060008090506000809050600090505b8751811015612bed578781815181101515612b5157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515612bb057fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612b3a565b600090505b8651811015612ca5578681815181101515612c0957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515612c6857fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612bf2565b600090505b8551811015612d5d578581815181101515612cc157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515612d2057fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612caa565b600090505b8451811015612e15578481815181101515612d7957fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515612dd857fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612d62565b600090505b8351811015612ecd578381815181101515612e3157fe5b9060200101517f010000000000000000000000000000000000000000000000000000000000000090047f0100000000000000000000000000000000000000000000000000000000000000028383806001019450815181101515612e9057fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050612e1a565b829850505050505050505095945050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10612f2257805160ff1916838001178555612f50565b82800160010185558215612f50579182015b82811115612f4f578251825591602001919060010190612f34565b5b509050612f5d9190612f61565b5090565b612f8391905b80821115612f7f576000816000905550600101612f67565b5090565b9056fea165627a7a723058205f5c05bb5479cc79b54a291332ccd8e9a69e4cd62d71beebcdee3507a0ecb3d80029
Verified Source Code Partial Match
Compiler: v0.5.1+commit.c8a2cb62
EVM: byzantium
Optimization: No
etherstar.sol 894 lines
pragma solidity ^0.5.0;
/**
* @title IERC165
* @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
*/
interface IERC165 {
/**
* @notice Query if a contract implements an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @dev Interface identification is specified in ERC-165. This function
* uses less than 30,000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/**
* @title ERC165
* @author Matt Condon (@shrugs)
* @dev Implements ERC165 using a lookup table.
*/
contract ERC165 is IERC165 {
bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7;
/**
* 0x01ffc9a7 ===
* bytes4(keccak256('supportsInterface(bytes4)'))
*/
/**
* @dev a mapping of interface id to whether or not it's supported
*/
mapping(bytes4 => bool) private _supportedInterfaces;
/**
* @dev A contract implementing SupportsInterfaceWithLookup
* implement ERC165 itself
*/
constructor () internal {
_registerInterface(_INTERFACE_ID_ERC165);
}
/**
* @dev implement supportsInterface(bytes4) using a lookup table
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool) {
return _supportedInterfaces[interfaceId];
}
/**
* @dev internal method for registering an interface
*/
function _registerInterface(bytes4 interfaceId) internal {
require(interfaceId != 0xffffffff);
_supportedInterfaces[interfaceId] = true;
}
}
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
contract IERC721Receiver {
/**
* @notice Handle the receipt of an NFT
* @dev The ERC721 smart contract calls this function on the recipient
* after a `safeTransfer`. This function MUST return the function selector,
* otherwise the caller will revert the transaction. The selector to be
* returned can be obtained as `this.onERC721Received.selector`. This
* function MAY throw to revert and reject the transfer.
* Note: the ERC721 contract address is always the message sender.
* @param operator The address which called `safeTransferFrom` function
* @param from The address which previously owned the token
* @param tokenId The NFT identifier which is being transferred
* @param data Additional data with no specified format
* @return `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public returns (bytes4);
}
/**
* @title ERC721 Non-Fungible Token Standard basic interface
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
*/
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);
function balanceOf(address owner) public view returns (uint256 balance);
function ownerOf(uint256 tokenId) public view returns (address owner);
function approve(address to, uint256 tokenId) public;
function getApproved(uint256 tokenId) public view returns (address operator);
function setApprovalForAll(address operator, bool _approved) public;
function isApprovedForAll(address owner, address operator) public view returns (bool);
function transferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId) public;
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
*/
contract IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0));
return role.bearer[account];
}
}
contract PauserRole {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private _pausers;
constructor () internal {
_addPauser(msg.sender);
}
modifier onlyPauser() {
require(isPauser(msg.sender));
_;
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function renouncePauser() public {
_removePauser(msg.sender);
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is PauserRole {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
contract MinterRole {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(msg.sender);
}
modifier onlyMinter() {
require(isMinter(msg.sender));
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(msg.sender);
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* Utility library of inline functions on addresses
*/
library Address {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param account address of the account to check
* @return whether the target address is a contract
*/
function isContract(address account) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
library Strings {
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d, string memory _e) internal pure returns (string memory _concatenatedString) {
bytes memory _ba = bytes(_a);
bytes memory _bb = bytes(_b);
bytes memory _bc = bytes(_c);
bytes memory _bd = bytes(_d);
bytes memory _be = bytes(_e);
bytes memory babcde = new bytes(_ba.length + _bb.length + _bc.length + _bd.length + _be.length);
uint k = 0;
uint i = 0;
for (i = 0; i < _ba.length; i++) {
babcde[k++] = _ba[i];
}
for (i = 0; i < _bb.length; i++) {
babcde[k++] = _bb[i];
}
for (i = 0; i < _bc.length; i++) {
babcde[k++] = _bc[i];
}
for (i = 0; i < _bd.length; i++) {
babcde[k++] = _bd[i];
}
for (i = 0; i < _be.length; i++) {
babcde[k++] = _be[i];
}
return string(babcde);
}
function strConcat(string memory _a, string memory _b, string memory _c, string memory _d) internal pure returns (string memory) {
return strConcat(_a, _b, _c, _d, "");
}
function strConcat(string memory _a, string memory _b, string memory _c) internal pure returns (string memory) {
return strConcat(_a, _b, _c, "", "");
}
function strConcat(string memory _a, string memory _b) internal pure returns (string memory) {
return strConcat(_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 - 1;
while (_i != 0) {
bstr[k--] = byte(uint8(48 + _i % 10));
_i /= 10;
}
return string(bstr);
}
function split(bytes memory _base, uint8[] memory _lengths) internal pure returns (bytes[] memory arr) {
uint _offset = 0;
bytes[] memory splitArr = new bytes[](_lengths.length);
for(uint i = 0; i < _lengths.length; i++) {
bytes memory _tmpBytes = new bytes(_lengths[i]);
for(uint j = 0; j < _lengths[i]; j++)
_tmpBytes[j] = _base[_offset+j];
splitArr[i] = _tmpBytes;
_offset += _lengths[i];
}
return splitArr;
}
}
/**
* @title Non-Fungible Token
* @dev see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
*/
contract etherstar is ERC165, IERC721, IERC721Metadata, Pausable, MinterRole {
using SafeMath for uint256;
using Address for address;
using Strings for string;
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
/*
* 0x80ac58cd ===
* bytes4(keccak256('balanceOf(address)')) ^
* bytes4(keccak256('ownerOf(uint256)')) ^
* bytes4(keccak256('approve(address,uint256)')) ^
* bytes4(keccak256('getApproved(uint256)')) ^
* bytes4(keccak256('setApprovalForAll(address,bool)')) ^
* bytes4(keccak256('isApprovedForAll(address,address)')) ^
* bytes4(keccak256('transferFrom(address,address,uint256)')) ^
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) ^
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)'))
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/**
* 0x5b5e139f ===
* bytes4(keccak256('name()')) ^
* bytes4(keccak256('symbol()')) ^
* bytes4(keccak256('tokenURI(uint256)'))
*/
// 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;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Token URI prefix
string private _baseTokenURI;
// Flag representing if metadata migrated to IPFS
bool private _ipfsMigrated;
// Token total Supply
uint256 private _totalSupply;
// Mapping from token ID to owner
mapping (uint256 => address) private _tokenOwner;
// Mapping from token ID to approved address
mapping (uint256 => address) private _tokenApprovals;
// Mapping Mapping from token ID to token URI
mapping(uint256 => string) private _tokenURIs;
// Mapping Mapping from token ID to token DNAs
mapping (uint256 => uint256) private _dnas;
// Mapping Mapping from token ID to token Name
mapping (uint256 => string) private _tokenNames;
// Mapping from owner to number of owned token
mapping (address => uint256) private _ownedTokensCount;
// Mapping from owner to operator approvals
mapping (address => mapping (address => bool)) private _operatorApprovals;
event TokenURI(uint256 indexed tokenId, string uri);
/**
* @dev Constructor function
*/
constructor (string memory name, string memory symbol, string memory baseTokenURI) public {
_name = name;
_symbol = symbol;
_totalSupply = 0;
_baseTokenURI = baseTokenURI;
_ipfsMigrated = false;
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
_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;
}
/**
* @dev Gets the total amount of tokens stored by the contract
* @return uint256 representing the total amount of tokens
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Returns whether the specified token exists
* @param tokenId uint256 ID of the token to query the existence of
* @return whether the token exists
*/
function exists(uint256 tokenId) external view returns (bool) {
return _exists(tokenId);
}
/**
* @dev Sets IPFS migration flag true
*/
function ipfsMigrationDone() public onlyMinter {
_ipfsMigrated = true;
}
/**
* @dev public function to set the token URI for a given token
* Reverts if the token ID does not exist or metadata has migrated to IPFS
* @param tokenId uint256 ID of the token to set its URI
* @param uri string URI to assign
*/
function setTokenURI(uint256 tokenId, string memory uri) public onlyMinter {
require(!_ipfsMigrated);
_setTokenURI(tokenId, uri);
}
/**
* @dev Returns the URI for a given token ID
* Throws if the token ID does not exist. May return an empty string.
* @param tokenId uint256 ID of the token to query
*/
function tokenURI(uint256 tokenId) external view returns (string memory) {
require(_exists(tokenId));
if (bytes(_tokenURIs[tokenId]).length > 0)
return _tokenURIs[tokenId];
return Strings.strConcat(baseTokenURI(),Strings.uint2str(tokenId));
}
/**
* @dev Sets the prefix of token URI
* @param baseTokenURI token URI prefix to be set
*/
function setBaseTokenURI(string memory baseTokenURI) public onlyMinter {
_baseTokenURI = baseTokenURI;
}
/**
* @dev Returns prefix of token URI
* @return string representing the token URI prefix
*/
function baseTokenURI() public view returns (string memory) {
return _baseTokenURI;
}
/**
* @dev Returns the DNA for a given token ID
* Throws if the token ID does not exist.
* @param tokenId uint256 ID of the token to query
*/
function tokenDNA(uint256 tokenId) public view returns (uint256) {
require(_exists(tokenId));
return _dnas[tokenId];
}
/**
* @dev Returns the tokenName for a given token ID
* Throws if the token ID does not exist.
* @param tokenId uint256 ID of the token to query
*/
function tokenName(uint256 tokenId) public view returns (string memory) {
require(_exists(tokenId));
return _tokenNames[tokenId];
}
/**
* @dev Gets the balance of the specified address
* @param owner address to query the balance of
* @return uint256 representing the amount owned by the passed address
*/
function balanceOf(address owner) public view returns (uint256) {
require(owner != address(0));
return _ownedTokensCount[owner];
}
/**
* @dev Gets the owner of the specified token ID
* @param tokenId uint256 ID of the token to query the owner of
* @return owner address currently marked as the owner of the given token ID
*/
function ownerOf(uint256 tokenId) public view returns (address) {
address owner = _tokenOwner[tokenId];
require(owner != address(0));
return owner;
}
/**
* @dev Approves another address to transfer the given token ID
* The zero address indicates there is no approved address.
* There can only be one approved address per token at a given time.
* Can only be called by the token owner or an approved operator.
* @param to address to be approved for the given token ID
* @param tokenId uint256 ID of the token to be approved
*/
function approve(address to, uint256 tokenId) public whenNotPaused {
address owner = ownerOf(tokenId);
require(to != owner);
require(msg.sender == owner || isApprovedForAll(owner, msg.sender));
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
/**
* @dev Gets the approved address for a token ID, or zero if no address set
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to query the approval of
* @return address currently approved for the given token ID
*/
function getApproved(uint256 tokenId) public view returns (address) {
require(_exists(tokenId));
return _tokenApprovals[tokenId];
}
/**
* @dev Sets or unsets the approval of a given operator
* An operator is allowed to transfer all tokens of the sender on their behalf
* @param to operator address to set the approval
* @param approved representing the status of the approval to be set
*/
function setApprovalForAll(address to, bool approved) public whenNotPaused {
require(to != msg.sender);
_operatorApprovals[msg.sender][to] = approved;
emit ApprovalForAll(msg.sender, to, approved);
}
/**
* @dev Tells whether an operator is approved by a given owner
* @param owner owner address which you want to query the approval of
* @param operator operator address which you want to query the approval of
* @return bool whether the given operator is approved by the given owner
*/
function isApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev Transfers the ownership of a given token ID to another address
* Usage of this method is discouraged, use `safeTransferFrom` whenever possible
* Requires the msg sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function transferFrom(address from, address to, uint256 tokenId) public whenNotPaused {
require(_isApprovedOrOwner(msg.sender, tokenId));
_transferFrom(from, to, tokenId);
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement `onERC721Received`,
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
*
* Requires the msg sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev Safely transfers the ownership of a given token ID to another address
* If the target address is a contract, it must implement `onERC721Received`,
* which is called upon a safe transfer, and return the magic value
* `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`; otherwise,
* the transfer is reverted.
* Requires the msg sender to be the owner, approved, or operator
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes data to send along with a safe transfer check
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {
transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data));
}
/**
* @dev Public function to mint a new token
* Reverts if the given token ID already exists
* @param to address The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
* @param uri string Metadata URI of the token to be minted
* @param dna uint256 DNAs of the token to be minted
*/
function mint(address to, uint256 tokenId, string memory uri, uint256 dna , string memory tokenNms)
public onlyMinter
{
require(tokenId >= 0 && tokenId <= 9999);
_mint(to, tokenId, uri, dna, tokenNms);
_totalSupply += 1;
}
/**
* @dev Returns whether the specified token exists
* @param tokenId uint256 ID of the token to query the existence of
* @return whether the token exists
*/
function _exists(uint256 tokenId) internal view returns (bool) {
address owner = _tokenOwner[tokenId];
return owner != address(0);
}
/**
* @dev Returns whether the given spender can transfer a given token ID
* @param spender address of the spender to query
* @param tokenId uint256 ID of the token to be transferred
* @return bool whether the msg.sender is approved for the given token ID,
* is an operator of the owner, or is the owner of the token
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {
address owner = ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
/**
* @dev Internal function to mint a new token
* Reverts if the given token ID already exists
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted
* @param uri string URI of the token to be minted metadata
* @param dna uint256 DNAs of the token to be minted
*/
function _mint(address to, uint256 tokenId, string memory uri, uint256 dna , string memory tokenNms) internal {
require(to != address(0));
require(!_exists(tokenId));
_tokenOwner[tokenId] = to;
_ownedTokensCount[to] = _ownedTokensCount[to].add(1);
_setTokenURI(tokenId, uri);
_dnas[tokenId] = dna ;
_tokenNames[tokenId] = tokenNms;
emit Transfer(address(0), to, tokenId);
}
/**
* @dev Internal function to set the token URI for a given token
* Reverts if the token ID does not exist
* @param tokenId uint256 ID of the token to set its URI
* @param uri string URI to assign
*/
function _setTokenURI(uint256 tokenId, string memory uri) internal {
require(_exists(tokenId));
_tokenURIs[tokenId] = uri;
emit TokenURI(tokenId, uri);
}
/**
* @dev Internal function to transfer ownership of a given token ID to another address.
* As opposed to transferFrom, this imposes no restrictions on msg.sender.
* @param from current owner of the token
* @param to address to receive the ownership of the given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function _transferFrom(address from, address to, uint256 tokenId) internal {
require(ownerOf(tokenId) == from);
require(to != address(0));
_clearApproval(tokenId);
_ownedTokensCount[from] = _ownedTokensCount[from].sub(1);
_ownedTokensCount[to] = _ownedTokensCount[to].add(1);
_tokenOwner[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Internal function to invoke `onERC721Received` on a target address
* The call is not executed if the target address is not a contract
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return whether the call correctly returned the expected magic value
*/
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);
}
/**
* @dev Private function to clear current approval of a given token ID
* @param tokenId uint256 ID of the token to be transferred
*/
function _clearApproval(uint256 tokenId) private {
if (_tokenApprovals[tokenId] != address(0)) {
_tokenApprovals[tokenId] = address(0);
}
}
}
Read Contract
balanceOf 0x70a08231 → uint256
baseTokenURI 0xd547cfb7 → string
exists 0x4f558e79 → bool
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
isMinter 0xaa271e1a → bool
isPauser 0x46fbf68e → bool
name 0x06fdde03 → string
ownerOf 0x6352211e → address
paused 0x5c975abb → bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenDNA 0xbe65d751 → uint256
tokenName 0xe725f877 → string
tokenURI 0xc87b56dd → string
totalSupply 0x18160ddd → uint256
Write Contract 15 functions
These functions modify contract state and require a wallet transaction to execute.
addMinter 0x983b2d56
address account
addPauser 0x82dc1ec4
address account
approve 0x095ea7b3
address to
uint256 tokenId
ipfsMigrationDone 0x24af9942
No parameters
mint 0xe86f6367
address to
uint256 tokenId
string uri
uint256 dna
string tokenNms
pause 0x8456cb59
No parameters
renounceMinter 0x98650275
No parameters
renouncePauser 0x6ef8d66d
No parameters
safeTransferFrom 0x42842e0e
address from
address to
uint256 tokenId
safeTransferFrom 0xb88d4fde
address from
address to
uint256 tokenId
bytes _data
setApprovalForAll 0xa22cb465
address to
bool approved
setBaseTokenURI 0x30176e13
string baseTokenURI
setTokenURI 0x162094c4
uint256 tokenId
string uri
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address