Address Contract Partially Verified
Address
0xDb7E971d39367b20BCf4df5aE2da0fa4261BF0E8
Balance
0.008000 ETH ($17.18)
Nonce
1
Code Size
23531 bytes
Creator
0x02A522D9...80ab at tx 0x2117f045...1b39cf
Indexed Transactions
0 (1 on-chain, 0.7% indexed)
Contract Bytecode
23531 bytes
0x6080604052600436106101d8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301ffc9a71461024657806306fdde03146102b8578063081812fc14610348578063095ea7b3146103c35780630c6a595a1461041e5780630dc014db1461044957806318160ddd146104b25780631995771b146104dd5780632164f5f21461053457806323b872dd1461057a5780632f745c59146105f557806332f191891461066457806340e05d08146106bb57806342842e0e146106d25780634f6ccce71461074d5780635bacc8641461079c57806360c6d8ae146108705780636352211e1461089b578063664ab18e1461091657806370a0823114610945578063715018a6146109aa578063747b41cf146109c15780638da5cb5b14610a2d5780638f32d59b14610a8457806395d89b4114610ab3578063a22cb46514610b43578063a694fc3a14610ba0578063abc0a6db14610be6578063b20a480914610ce4578063b88d4fde14610d4d578063c21d0a6114610e5f578063c4c6fe8714610eae578063c87b56dd14610f05578063c9f5808b14610fb9578063d4e9329214611022578063e985e9c514611051578063f2fde38b146110da578063f834aabb1461112b575b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f506c656173652063616c6c20612066756e6374696f6e0000000000000000000081525060200191505060405180910390fd5b34801561025257600080fd5b5061029e6004803603602081101561026957600080fd5b8101908080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916906020019092919050505061116d565b604051808215151515815260200191505060405180910390f35b3480156102c457600080fd5b506102cd6111d4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561030d5780820151818401526020810190506102f2565b50505050905090810190601f16801561033a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561035457600080fd5b506103816004803603602081101561036b57600080fd5b8101908080359060200190929190505050611276565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103cf57600080fd5b5061041c600480360360408110156103e657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611356565b005b34801561042a57600080fd5b506104336115b9565b6040518082815260200191505060405180910390f35b34801561045557600080fd5b506104986004803603602081101561046c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115bf565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104c76116ea565b6040518082815260200191505060405180910390f35b3480156104e957600080fd5b506104f26116f7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105606004803603602081101561054a57600080fd5b810190808035906020019092919050505061171d565b604051808215151515815260200191505060405180910390f35b34801561058657600080fd5b506105f36004803603606081101561059d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611bc1565b005b34801561060157600080fd5b5061064e6004803603604081101561061857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c75565b6040518082815260200191505060405180910390f35b34801561067057600080fd5b50610679611d7b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c757600080fd5b506106d0611da1565b005b3480156106de57600080fd5b5061074b600480360360608110156106f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e49565b005b34801561075957600080fd5b506107866004803603602081101561077057600080fd5b8101908080359060200190929190505050611e6a565b6040518082815260200191505060405180910390f35b3480156107a857600080fd5b506107d5600480360360208110156107bf57600080fd5b8101908080359060200190929190505050611f31565b604051808060200186815260200185815260200184815260200183151515158152602001828103825287818151815260200191508051906020019080838360005b83811015610831578082015181840152602081019050610816565b50505050905090810190601f16801561085e5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b34801561087c57600080fd5b5061088561200c565b6040518082815260200191505060405180910390f35b3480156108a757600080fd5b506108d4600480360360208110156108be57600080fd5b8101908080359060200190929190505050612012565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561092257600080fd5b5061092b61211f565b604051808215151515815260200191505060405180910390f35b34801561095157600080fd5b506109946004803603602081101561096857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612132565b6040518082815260200191505060405180910390f35b3480156109b657600080fd5b506109bf61224c565b005b3480156109cd57600080fd5b506109d6612389565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a195780820151818401526020810190506109fe565b505050509050019250505060405180910390f35b348015610a3957600080fd5b50610a426123e8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a9057600080fd5b50610a99612412565b604051808215151515815260200191505060405180910390f35b348015610abf57600080fd5b50610ac861246a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b08578082015181840152602081019050610aed565b50505050905090810190601f168015610b355780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610b4f57600080fd5b50610b9e60048036036040811015610b6657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080351515906020019092919050505061250c565b005b610bcc60048036036020811015610bb657600080fd5b81019080803590602001909291905050506126b1565b604051808215151515815260200191505060405180910390f35b348015610bf257600080fd5b50610cca60048036036080811015610c0957600080fd5b8101908080359060200190640100000000811115610c2657600080fd5b820183602082011115610c3857600080fd5b80359060200191846001830284011164010000000083111715610c5a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001909291908035906020019092919080359060200190929190505050612b7f565b604051808215151515815260200191505060405180910390f35b348015610cf057600080fd5b50610d3360048036036020811015610d0757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e3b565b604051808215151515815260200191505060405180910390f35b348015610d5957600080fd5b50610e5d60048036036080811015610d7057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610dd757600080fd5b820183602082011115610de957600080fd5b80359060200191846001830284011164010000000083111715610e0b57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050612f66565b005b348015610e6b57600080fd5b50610e9860048036036020811015610e8257600080fd5b810190808035906020019092919050505061301d565b6040518082815260200191505060405180910390f35b348015610eba57600080fd5b50610ec3613035565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f1157600080fd5b50610f3e60048036036020811015610f2857600080fd5b810190808035906020019092919050505061305b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610f7e578082015181840152602081019050610f63565b50505050905090810190601f168015610fab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610fc557600080fd5b5061100860048036036020811015610fdc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131b3565b604051808215151515815260200191505060405180910390f35b34801561102e57600080fd5b506110376132de565b604051808215151515815260200191505060405180910390f35b34801561105d57600080fd5b506110c06004803603604081101561107457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061358d565b604051808215151515815260200191505060405180910390f35b3480156110e657600080fd5b50611129600480360360208110156110fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613621565b005b6111576004803603602081101561114157600080fd5b81019080803590602001909291905050506136a9565b6040518082815260200191505060405180910390f35b6000806000837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002060009054906101000a900460ff169050919050565b606060098054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561126c5780601f106112415761010080835404028352916020019161126c565b820191906000526020600020905b81548152906001019060200180831161124f57829003601f168201915b5050505050905090565b60006112818261380f565b151561131b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f4552433732313a20617070726f76656420717565727920666f72206e6f6e657881526020017f697374656e7420746f6b656e000000000000000000000000000000000000000081525060400191505060405180910390fd5b6002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600061136182612012565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561142d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6581526020017f720000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061146d575061146c813361358d565b5b1515611507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001807f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7781526020017f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000081525060400191505060405180910390fd5b826002600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550818373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a4505050565b60155481565b60006115c9612412565b151561163d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600780549050905090565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080601360008481526020019081526020016000205411801561176157506014600083815260200190815260200160002060040160009054906101000a900460ff165b15156117d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4e4654206e6f74206275726e61626c652079657400000000000000000000000081525060200191505060405180910390fd5b6117df3383613881565b1515611879576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7781526020017f6e6572206e6f7220617070726f7665640000000000000000000000000000000081525060400191505060405180910390fd5b600061189760136000858152602001908152602001600020546139ba565b905060006118a430613b4d565b905060006118bb8284613cf490919063ffffffff16565b9050601360008681526020019081526020016000205481101515611947576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f466565206973206d6f7265207468616e205374616b656456616c75650000000081525060200191505060405180910390fd5b600061196f826013600089815260200190815260200160002054613d7e90919063ffffffff16565b905061199a601460008881526020019081526020016000206003015482613d7e90919063ffffffff16565b9050806119a5613e09565b10151515611a1b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f42616c616e636520636865636b206661696c656400000000000000000000000081525060200191505060405180910390fd5b60006014600088815260200190815260200160002060040160006101000a81548160ff021916908315150217905550611a5386613f83565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611b1857600080fd5b505af1158015611b2c573d6000803e3d6000fd5b505050506040513d6020811015611b4257600080fd5b81019080805190602001909291905050501515611b5e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff167f23ff0e75edf108e3d0392d92e13e8c8a868ef19001bd49f9e94876dc46dff87f8288604051808381526020018281526020019250505060405180910390a26001945050505050919050565b611bcb3382613881565b1515611c65576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f81526020017f776e6572206e6f7220617070726f76656400000000000000000000000000000081525060400191505060405180910390fd5b611c70838383613f98565b505050565b6000611c8083612132565b82101515611d1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001807f455243373231456e756d657261626c653a206f776e657220696e646578206f7581526020017f74206f6620626f756e647300000000000000000000000000000000000000000081525060400191505060405180910390fd5b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515611d6857fe5b9060005260206000200154905092915050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611da9612412565b1515611e1d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600f60149054906101000a900460ff1615600f60146101000a81548160ff021916908315150217905550565b611e658383836020604051908101604052806000815250612f66565b505050565b6000611e746116ea565b82101515611f10576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f81526020017f7574206f6620626f756e6473000000000000000000000000000000000000000081525060400191505060405180910390fd5b600782815481101515611f1f57fe5b90600052602060002001549050919050565b6014602052806000526040600020600091509050806000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fdd5780601f10611fb257610100808354040283529160200191611fdd565b820191906000526020600020905b815481529060010190602001808311611fc057829003601f168201915b5050505050908060010154908060020154908060030154908060040160009054906101000a900460ff16905085565b60165481565b6000806001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612116576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001807f4552433732313a206f776e657220717565727920666f72206e6f6e657869737481526020017f656e7420746f6b656e000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80915050919050565b600f60149054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156121fe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a8152602001807f4552433732313a2062616c616e636520717565727920666f7220746865207a6581526020017f726f20616464726573730000000000000000000000000000000000000000000081525060400191505060405180910390fd5b612245600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020613fbc565b9050919050565b612254612412565b15156122c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606061239433613fca565b8054806020026020016040519081016040528092919081815260200182805480156123de57602002820191906000526020600020905b8154815260200190600101908083116123ca575b5050505050905090565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b6060600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156125025780601f106124d757610100808354040283529160200191612502565b820191906000526020600020905b8154815290600101906020018083116124e557829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156125b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f4552433732313a20617070726f766520746f2063616c6c65720000000000000081525060200191505060405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051808215151515815260200191505060405180910390a35050565b600060011515600f60149054906101000a900460ff1615151415156126d557600080fd5b600060146000848152602001908152602001600020600301541015801561270f575060006013600084815260200190815260200160002054145b1515612783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f43616e2774207374616b6520746f207468697320746f6b656e2100000000000081525060200191505060405180910390fd5b60006127c460146000858152602001908152602001600020600301546014600086815260200190815260200160002060020154613cf490919063ffffffff16565b905060006127d1826139ba565b905060006127fe826014600088815260200190815260200160002060030154613d7e90919063ffffffff16565b905061281581601654613cf490919063ffffffff16565b601681905550600061282633613b4d565b9050600061283d8285613cf490919063ffffffff16565b90506128528186613d7e90919063ffffffff16565b945061285e3386614012565b15156128d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f4e6f7420656e6f75676820616c6c6f77616e636500000000000000000000000081525060200191505060405180910390fd5b6128dc33866141c4565b1515612950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f5472616e7366657220444758206661696c65640000000000000000000000000081525060200191505060405180910390fd5b606061295b8861430f565b905061299c601460008a815260200190815260200160002060030154601460008b815260200190815260200160002060020154613cf490919063ffffffff16565b86837f3427af3b0383cda10bb1d2828953ff66f55355531757f5aa631be29e795c394560405160405180910390a48186111515612a41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f4d61746820696e76616c6964000000000000000000000000000000000000000081525060200191505060405180910390fd5b612a4c33898361452a565b1515612ac0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4d696e74696e67204e4654206661696c6564000000000000000000000000000081525060200191505060405180910390fd5b85601360008a8152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f1449c6dd7851abc30abf37f57715f492010519147cc2652fbc38202c18a6ee90601360008b8152602001908152602001600020548a604051808381526020018281526020019250505060405180910390a26001601460008a815260200190815260200160002060040160006101000a81548160ff02191690831515021790555060019650505050505050919050565b6000612b89612412565b1515612bfd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60011515600f60149054906101000a900460ff161515141515612c1f57600080fd5b612c276123e8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612cc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f4f6e6c79204f776e65720000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600060155490506000612ce760155487613cf490919063ffffffff16565b905060008290505b81811015612d9c5787601460008381526020019081526020016000206000019080519060200190612d21929190615aa6565b50866014600083815260200190815260200160002060010181905550856014600083815260200190815260200160002060020181905550846014600083815260200190815260200160002060030181905550612d896001601554613cf490919063ffffffff16565b6015819055508080600101915050612cef565b5085876040518082805190602001908083835b602083101515612dd45780518252602082019150602081019050602083039250612daf565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207f82dd50d000a324db3e3b2bd31cbf327fa37f7d9e966cc33581e9f71ae7babcec60405160405180910390a3600192505050949350505050565b6000612e45612412565b1515612eb9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b612f71848484611bc1565b612f7d8484848461454b565b1515613017576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f4552433732313a207472616e7366657220746f206e6f6e20455243373231526581526020017f63656976657220696d706c656d656e746572000000000000000000000000000081525060400191505060405180910390fd5b50505050565b60136020528060005260406000206000915090505481565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60606130668261380f565b1515613100576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001807f4552433732314d657461646174613a2055524920717565727920666f72206e6f81526020017f6e6578697374656e7420746f6b656e000000000000000000000000000000000081525060400191505060405180910390fd5b600b60008381526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156131a75780601f1061317c576101008083540402835291602001916131a7565b820191906000526020600020905b81548152906001019060200180831161318a57829003601f168201915b50505050509050919050565b60006131bd612412565b1515613231576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b60006132e8612412565b151561335c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60001515600f60149054906101000a900460ff16151514151561337e57600080fd5b6000613388613e09565b9050601654811015151561342a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260338152602001807f4e6f7420656e6f7567682062616c616e636520746f207769746864726177616c81526020017f20746865206665657320636f6c6c65637465640000000000000000000000000081525060400191505060405180910390fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336016546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156134f157600080fd5b505af1158015613505573d6000803e3d6000fd5b505050506040513d602081101561351b57600080fd5b8101908080519060200190929190505050151561353757600080fd5b6016543373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b6560405160405180910390a36000601681905550600191505090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b613629612412565b151561369d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6136a68161476e565b50565b6000806136f36136ee60146000868152602001908152602001600020600301546014600087815260200190815260200160002060020154613cf490919063ffffffff16565b6139ba565b9050600061370030613b4d565b905060006137178284613cf490919063ffffffff16565b9050600061376c8261375e601460008a815260200190815260200160002060030154601460008b815260200190815260200160002060020154613cf490919063ffffffff16565b613d7e90919063ffffffff16565b9050613797601460008881526020019081526020016000206003015482613d7e90919063ffffffff16565b9050806137d96014600089815260200190815260200160002060030154601460008a815260200190815260200160002060020154613cf490919063ffffffff16565b837f3427af3b0383cda10bb1d2828953ff66f55355531757f5aa631be29e795c394560405160405180910390a450505050919050565b6000806001600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415915050919050565b600061388c8261380f565b1515613926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657881526020017f697374656e7420746f6b656e000000000000000000000000000000000000000081525060400191505060405180910390fd5b600061393183612012565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806139a057508373ffffffffffffffffffffffffffffffffffffffff1661398884611276565b73ffffffffffffffffffffffffffffffffffffffff16145b806139b157506139b0818561358d565b5b91505092915050565b600080600080600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ae4aadbb6040518163ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040160a060405180830381600087803b158015613a4957600080fd5b505af1158015613a5d573d6000803e3d6000fd5b505050506040513d60a0811015613a7357600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050945094509450945094508115613aca57600095505050505050613b48565b613aef85613ae189876148f990919063ffffffff16565b6149c690919063ffffffff16565b7fae6e4988ea12053752487a87a04d67427641cb242cdafec0938a1cc9402c088f60405160405180910390a2613b4085613b3289876148f990919063ffffffff16565b6149c690919063ffffffff16565b955050505050505b919050565b6000806000806000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663293f9a9c6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401608060405180830381600087803b158015613bdb57600080fd5b505af1158015613bef573d6000803e3d6000fd5b505050506040513d6080811015613c0557600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919050505093509350935093508015613c4f576000945050505050613cef565b6000613c5a87614a59565b90506000613c718242613d7e90919063ffffffff16565b90506000613cb562015180613ca784613c998b6305f5e1008c026149c690919063ffffffff16565b6148f990919063ffffffff16565b6149c690919063ffffffff16565b9050807fcdfaef3a99d9154e75bde11cbd0604f2ce589ce70c6cc3216ad5d5875df9aed560405160405180910390a2809750505050505050505b919050565b6000808284019050838110151515613d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000828211151515613df8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015613ec757600080fd5b505afa158015613edb573d6000803e3d6000fd5b505050506040513d6020811015613ef157600080fd5b81019080805190602001909291905050509050600081111515613f7c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5265766572743a2042616c616e6365206973203021000000000000000000000081525060200191505060405180910390fd5b8091505090565b613f95613f8f82612012565b82614c52565b50565b613fa3838383614cb1565b613fad8382614f96565b613fb7828261513a565b505050565b600081600001549050919050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050919050565b600080600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e85306040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561410457600080fd5b505afa158015614118573d6000803e3d6000fd5b505050506040513d602081101561412e57600080fd5b810190808051906020019092919050505090508281101515156141b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5265766572743a2042616c616e6365206973203021000000000000000000000081525060200191505060405180910390fd5b600191505092915050565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156142bf57600080fd5b505af11580156142d3573d6000803e3d6000fd5b505050506040513d60208110156142e957600080fd5b8101908080519060200190929190505050151561430557600080fd5b6001905092915050565b606061431a82615201565b15156143b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f4552433732313a20617070726f76656420717565727920666f72206e6f6e657881526020017f697374656e7420746f6b656e000000000000000000000000000000000000000081525060400191505060405180910390fd5b6060601460008481526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156144605780601f1061443557610100808354040283529160200191614460565b820191906000526020600020905b81548152906001019060200180831161444357829003601f168201915b505050505090508060405160200180807f68747470733a2f2f6170702e62756c6c696f6e69782e696f2f6d65746164617481526020017f612f00000000000000000000000000000000000000000000000000000000000081525060220182805190602001908083835b6020831015156144ee57805182526020820191506020810190506020830392506144c9565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052915050919050565b60006145368484615376565b6145408383615397565b600190509392505050565b600061456c8473ffffffffffffffffffffffffffffffffffffffff16615466565b151561457b5760019050614766565b60008473ffffffffffffffffffffffffffffffffffffffff1663150b7a02338887876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015614672578082015181840152602081019050614657565b50505050905090810190601f16801561469f5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b1580156146c157600080fd5b505af11580156146d5573d6000803e3d6000fd5b505050506040513d60208110156146eb57600080fd5b8101908080519060200190929190505050905063150b7a027c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149150505b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515614839576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008083141561490c57600090506149c0565b6000828402905082848281151561491f57fe5b041415156149bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b809150505b92915050565b60008082111515614a3f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b60008284811515614a4c57fe5b0490508091505092915050565b6000806000806000806000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166339d20a5f896040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060c060405180830381600087803b158015614b2157600080fd5b505af1158015614b35573d6000803e3d6000fd5b505050506040513d60c0811015614b4b57600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505095509550955095509550955060008410158015614baa57504284105b1515614c44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4c617374207061796d656e742074696d657374616d7020697320696e76616c6981526020017f640000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b839650505050505050919050565b614c5c8282615479565b6000600b6000838152602001908152602001600020805460018160011615610100020316600290049050141515614cad57600b60008281526020019081526020016000206000614cac9190615b26565b5b5050565b8273ffffffffffffffffffffffffffffffffffffffff16614cd182612012565b73ffffffffffffffffffffffffffffffffffffffff16141515614d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001807f4552433732313a207472616e73666572206f6620746f6b656e2074686174206981526020017f73206e6f74206f776e000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515614e4d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f4552433732313a207472616e7366657220746f20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b614e56816154b3565b614e9d600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020615573565b614ee4600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020615596565b816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000614fee6001600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613d7e90919063ffffffff16565b905060006006600084815260200190815260200160002054905081811415156150e1576000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110151561505f57fe5b9060005260206000200154905080600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156150b957fe5b9060005260206000200181905550816006600083815260200190815260200160002081905550505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054809190600190036151339190615b6e565b5050505050565b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506006600083815260200190815260200160002081905550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190806001815401808255809150509060018203906000526020600020016000909192909190915055505050565b60006060601460008481526020019081526020016000206000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156152af5780601f10615284576101008083540402835291602001916152af565b820191906000526020600020905b81548152906001019060200180831161529257829003601f168201915b5050505050905060608190506001815110158290151561536a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561532f578082015181840152602081019050615314565b50505050905090810190601f16801561535c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600192505050919050565b61538082826155ac565b61538a828261513a565b615393816157c8565b5050565b6153a08261380f565b151561543a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f4552433732314d657461646174613a2055524920736574206f66206e6f6e657881526020017f697374656e7420746f6b656e000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600b60008481526020019081526020016000209080519060200190615461929190615aa6565b505050565b600080823b905060008111915050919050565b6154838282615814565b61548d8282614f96565b600060066000838152602001908152602001600020819055506154af816159e8565b5050565b600073ffffffffffffffffffffffffffffffffffffffff166002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156155705760006002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b61558b60018260000154613d7e90919063ffffffff16565b816000018190555050565b6001816000016000828254019250508190555050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515615651576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4552433732313a206d696e7420746f20746865207a65726f206164647265737381525060200191505060405180910390fd5b61565a8161380f565b1515156156cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081525060200191505060405180910390fd5b816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550615768600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020615596565b808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6007805490506008600083815260200190815260200160002081905550600781908060018154018082558091505090600182039060005260206000200160009091929091909150555050565b8173ffffffffffffffffffffffffffffffffffffffff1661583482612012565b73ffffffffffffffffffffffffffffffffffffffff161415156158e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f4552433732313a206275726e206f6620746f6b656e2074686174206973206e6f81526020017f74206f776e00000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6158ee816154b3565b615935600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020615573565b60006001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6000615a036001600780549050613d7e90919063ffffffff16565b90506000600860008481526020019081526020016000205490506000600783815481101515615a2e57fe5b9060005260206000200154905080600783815481101515615a4b57fe5b90600052602060002001819055508160086000838152602001908152602001600020819055506007805480919060019003615a869190615b6e565b506000600860008681526020019081526020016000208190555050505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10615ae757805160ff1916838001178555615b15565b82800160010185558215615b15579182015b82811115615b14578251825591602001919060010190615af9565b5b509050615b229190615b9a565b5090565b50805460018160011615610100020316600290046000825580601f10615b4c5750615b6b565b601f016020900490600052602060002090810190615b6a9190615b9a565b5b50565b815481835581811115615b9557818360005260206000209182019101615b949190615b9a565b5b505050565b615bbc91905b80821115615bb8576000816000905550600101615ba0565b5090565b9056fea165627a7a723058209e29c2b9772bae59069786f351d83589a54d5be9e521bbe11add6cc9dc20317e0029
Verified Source Code Partial Match
Compiler: v0.5.0+commit.1d4f565a
EVM: byzantium
Optimization: No
BullionixGenerator.sol 1603 lines
pragma solidity ^0.5.0;
/**
* @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;
}
}
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot 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, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
pragma solidity ^0.5.0;
/**
* @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 {
using SafeMath for uint256;
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.sub(1);
}
}
pragma solidity ^0.5.0;
/**
* @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);
}
pragma solidity ^0.5.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface DGXinterface {
/// @dev read transfer configurations
/// @return {
/// "_base": "denominator for calculating transfer fees",
/// "_rate": "numerator for calculating transfer fees",
/// "_collector": "the ethereum address of the transfer fees collector",
/// "_no_transfer_fee": "true if transfer fees is turned off globally",
/// "_minimum_transfer_amount": "minimum amount of DGX that can be transferred"
/// }
function showTransferConfigs()
external
returns (uint256 _base, uint256 _rate, address _collector, bool _no_transfer_fee, uint256 _minimum_transfer_amount);
/// @dev read the demurrage configurations
/// @return {
/// "_base": "denominator for calculating demurrage fees",
/// "_rate": "numerator for calculating demurrage fees",
/// "_collector": "ethereum address of the demurrage fees collector"
/// "_no_demurrage_fee": "true if demurrage fees is turned off globally"
/// }
function showDemurrageConfigs()
external
returns (uint256 _base, uint256 _rate, address _collector, bool _no_demurrage_fee);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through `transferFrom`. This is
* zero by default.
*
* This value changes when `approve` or `transferFrom` are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* > Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an `Approval` event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
@dev Returns the user data for an account
* Specifically calling this to get the last time of transfer to calculate demurrage fees
*
*
* Returns bool _exists,
* Returns uint256 _raw_balance,
* Returns uint256 _payment_date,
* Returns bool _no_demurrage_fee,
* Returns bool _no_recast_fee,
* Returns bool _no_transfer_fee
*
* Emits a `Transfer` event.
**/
function read_user(address _account)
external
returns (
bool _exists,
uint256 _raw_balance,
uint256 _payment_date,
bool _no_demurrage_fee,
bool _no_recast_fee,
bool _no_transfer_fee
);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to `approve`. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
pragma solidity ^0.5.0;
/**
* @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 () internal {
// 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) 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;
}
}
pragma solidity ^0.5.0;
/**
* @dev Required interface of an ERC721 compliant contract.
*/
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 view returns (uint256 balance);
/**
* @dev Returns the owner of the NFT specified by `tokenId`.
*/
function ownerOf(uint256 tokenId) public 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;
/**
* @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;
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 safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;
}
pragma solidity ^0.5.0;
/**
* @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 `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`
*/
function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)
public returns (bytes4);
}
pragma solidity ^0.5.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
contract IERC721Enumerable is IERC721 {
function totalSupply() public view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);
function tokenByIndex(uint256 index) public view returns (uint256);
}
pragma solidity ^0.5.0;
/**
* @title ERC721 Non-Fungible Token Standard basic implementation
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721 is ERC165, IERC721 {
using SafeMath for uint256;
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(keccak256('balanceOf(address)')) == 0x70a08231
* bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e
* bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3
* bytes4(keccak256('getApproved(uint256)')) == 0x081812fc
* bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465
* bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c
* bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd
* bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e
* bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde
*
* => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^
* 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd
*/
bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd;
constructor () public {
// register the supported interfaces to conform to ERC721 via ERC165
_registerInterface(_INTERFACE_ID_ERC721);
}
/**
* @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), "ERC721: balance query for the zero address");
return _ownedTokensCount[owner].current();
}
/**
* @dev Gets the owner of the specified token ID.
* @param tokenId uint256 ID of the token to query the owner of
* @return 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), "ERC721: owner query for nonexistent token");
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 {
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);
}
/**
* @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), "ERC721: approved query for nonexistent token");
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 {
require(to != msg.sender, "ERC721: approve to caller");
_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 {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved");
_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), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether the specified token exists.
* @param tokenId uint256 ID of the token to query the existence of
* @return bool 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) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
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
*/
function _mint(address to, uint256 tokenId) internal {
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);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use _burn(uint256) instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
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);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* @param tokenId uint256 ID of the token being burned
*/
function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
/**
* @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, "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);
}
/**
* @dev Internal function to invoke `onERC721Received` on a target address.
* The call is not executed if the target address is not a contract.
*
* This function is deprecated.
* @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 bool 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);
}
}
}
pragma solidity ^0.5.0;
/**
* @title ERC-721 Non-Fungible Token with optional enumeration extension logic
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
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(keccak256('totalSupply()')) == 0x18160ddd
* bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59
* bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7
*
* => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63
*/
bytes4 private constant _INTERFACE_ID_ERC721_ENUMERABLE = 0x780e9d63;
/**
* @dev Constructor function.
*/
constructor () public {
// register the supported interface to conform to ERC721Enumerable via ERC165
_registerInterface(_INTERFACE_ID_ERC721_ENUMERABLE);
}
/**
* @dev Gets the token ID at a given index of the tokens list of the requested owner.
* @param owner address owning the tokens list to be accessed
* @param index uint256 representing the index to be accessed of the requested tokens list
* @return uint256 token ID at the given index of the tokens list owned by the requested address
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @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 _allTokens.length;
}
/**
* @dev Gets the token ID at a given index of all the tokens in this contract
* Reverts if the index is greater or equal to the total number of tokens.
* @param index uint256 representing the index to be accessed of the tokens list
* @return uint256 token ID at the given index of the tokens list
*/
function tokenByIndex(uint256 index) public view returns (uint256) {
require(index < totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @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 {
super._transferFrom(from, to, tokenId);
_removeTokenFromOwnerEnumeration(from, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
}
/**
* @dev Internal function to mint a new token.
* Reverts if the given token ID already exists.
* @param to address the beneficiary that will own the minted token
* @param tokenId uint256 ID of the token to be minted
*/
function _mint(address to, uint256 tokenId) internal {
super._mint(to, tokenId);
_addTokenToOwnerEnumeration(to, tokenId);
_addTokenToAllTokensEnumeration(tokenId);
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use _burn(uint256) instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) 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);
}
/**
* @dev Gets the list of token IDs of the requested owner.
* @param owner address owning the tokens
* @return uint256[] List of token IDs owned by the requested address
*/
function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {
return _ownedTokens[owner];
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
_ownedTokensIndex[tokenId] = _ownedTokens[to].length;
_ownedTokens[to].push(tokenId);
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the _ownedTokensIndex mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
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.sub(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].length--;
// 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).
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
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.sub(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.length--;
_allTokensIndex[tokenId] = 0;
}
}
pragma solidity ^0.5.0;
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
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);
}
pragma solidity ^0.5.0;
contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
// Token name
string private _name;
// Token symbol
string private _symbol;
// Optional mapping for token URIs
mapping(uint256 => string) private _tokenURIs;
/*
* bytes4(keccak256('name()')) == 0x06fdde03
* bytes4(keccak256('symbol()')) == 0x95d89b41
* bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd
*
* => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f
*/
bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f;
/**
* @dev Constructor function
*/
constructor (string memory name, string memory symbol) public {
_name = name;
_symbol = symbol;
// 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;
}
/**
* @dev Returns an 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), "ERC721Metadata: URI query for nonexistent token");
return _tokenURIs[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), "ERC721Metadata: URI set of nonexistent token");
_tokenURIs[tokenId] = uri;
}
/**
* @dev Internal function to burn a specific token.
* Reverts if the token does not exist.
* Deprecated, use _burn(uint256) instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned by the msg.sender
*/
function _burn(address owner, uint256 tokenId) internal {
super._burn(owner, tokenId);
// Clear metadata (if any)
if (bytes(_tokenURIs[tokenId]).length != 0) {
delete _tokenURIs[tokenId];
}
}
}
pragma solidity ^0.5.0;
/**
* @title Full ERC721 Token
* This implementation includes all the required and some optional functionality of the ERC721 standard
* Moreover, it includes approve all functionality using operator terminology
* @dev see https://eips.ethereum.org/EIPS/eip-721
*/
contract ERC721Full is ERC721, ERC721Enumerable, ERC721Metadata {
constructor (string memory name, string memory symbol) public ERC721Metadata(name, symbol) {
// solhint-disable-previous-line no-empty-blocks
}
}
pragma solidity ^0.5.0;
/**
* @title ERC721MetadataMintable
* @dev ERC721 minting logic with metadata.
*/
contract ERC721MetadataMintable is ERC721, ERC721Metadata {
/**
* @dev Function to mint tokens.
* @param to The address that will receive the minted tokens.
* @param tokenId The token id to mint.
* @param tokenURI The token URI of the minted token.
* @return A boolean that indicates if the operation was successful.
*/
function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) internal returns (bool) {
_mint(to, tokenId);
_setTokenURI(tokenId, tokenURI);
return true;
}
}
pragma solidity ^0.5.0;
/**
* @title ERC721 Burnable Token
* @dev ERC721 Token that can be irreversibly burned (destroyed).
*/
contract ERC721Burnable is ERC721 {
/**
* @dev Burns a specific ERC721 token.
* @param tokenId uint256 id of the ERC721 token to be burned.
*/
function burn(uint256 tokenId) internal {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721Burnable: caller is not owner nor approved");
_burn(tokenId);
}
}
pragma solidity >=0.4.22 <0.6.0;
//Deployed using 0.5.0.commit1d4f56
//optimization enabled
//kovan deployed at - 0xf7E80D70963cc97566BA25E5A22F24837d59CE4e
contract BullionixGenerator is
ERC721Enumerable,
ERC721MetadataMintable,
ERC721Burnable,
Ownable
{
modifier isActive {
require(isOnline == true);
_;
}
using SafeMath for uint256;
/*
* @dev Beginning state and init values
**/
DGXinterface dgx;
DGXinterface dgxStorage;
DGXinterface dgxToken;
bool public isOnline = false;
/*
Kovan KDGX token contract - 0xAEd4fc9663420eC8a6c892065BBA49c935581Dce
Kovan Storage contract - 0x3c5E7435190ecd13C88F3600Ca317A1A5FdD2Ae6
Kovan TokenInformation - 0x2651586330d05411e6bcecF9c4ff48341E6d02D5
Mainnet (storage) = 0xc672ec9cf3be7ad06be4c5650812aec23bbfb7e1
Mainnet (token) = 0x4f3afec4e5a3f2a6a1a411def7d7dfe50ee057bf
Mainnet (token information) = 0xbb246ee3fa95b88b3b55a796346313738c6e0150
Mainnet storage contract - 0xC672EC9CF3Be7Ad06Be4C5650812aEc23BBfB7E1
*/
address payable public DGXTokenContract = 0x4f3AfEC4E5a3F2A6a1A411DEF7D7dFe50eE057bF;
address payable public DGXContract = 0xBB246ee3FA95b88B3B55A796346313738c6E0150; //To be filled in
address payable public DGXTokenStorage = 0xC672EC9CF3Be7Ad06Be4C5650812aEc23BBfB7E1; //To be filled in
string constant name = "Bullionix";
string constant title = "Bullionix"; //To be filled in
string constant symbol = "BLX"; //To be filled in
string constant version = "Bullionix v0.2";
mapping(uint256 => uint256) public StakedValue;
mapping(uint256 => seriesData) public seriesToTokenId;
uint256 public totalSeries = 0;
uint256 public totalFeesCollected = 0;
struct seriesData {
string url;
uint256 numberInSeries;
uint256 DGXcost;
uint256 fee;
bool alive;
}
/*
* @dev Events
* @dev Events to read when things happen
**/
event NewSeriesMade(string indexed url, uint256 indexed numberToMint);
event Staked(address indexed _sender, uint256 _amount, uint256 tokenStaked);
event Burned(address indexed _sender, uint256 _amount, uint256 _tokenId);
event Withdrawal(address indexed _receiver, uint256 indexed _amount);
event TransferFee(uint256 indexed transferFee);
event DemurrageFee(uint256 indexed demurrageFee);
event CheckFees(
uint256 indexed feeValue,
uint256 indexed stakedValue,
uint256 indexed _totalWithdrawal
);
/*
* @dev Constructor() and storge init
* @dev Sets state
**/
constructor() public ERC721Metadata(name, symbol) {
if (
address(DGXContract) != address(0x0) &&
address(DGXTokenStorage) != address(0x0)
) {
isOnline = true;
dgx = DGXinterface(DGXContract);
dgxStorage = DGXinterface(DGXTokenStorage);
dgxToken = DGXinterface(DGXTokenContract);
}
}
/*
* @dev changes online status to disable contract, must be current owner
*
**/
function toggleOnline() external onlyOwner {
isOnline = !isOnline;
}
/**
* @dev Create a new series of NFTs.
* @param _url location of metadata on backend server. Will be tacked onto the end of set url using returnURL().
* @param _numberToMint The token number for this series. 10 would make 10 tokens avaliable
* @param _DGXcost The amount of DGX to send
* @param _fee Bullionix fee for generation
* @return A boolean that indicates if the operation was successful.
*/
function createNewSeries(
string memory _url,
uint256 _numberToMint,
uint256 _DGXcost,
uint256 _fee
) public onlyOwner isActive returns (bool _success) {
//takes input from admin to create a new nft series. Will have to define how many tokens to make, how much DGX they cost, and the url from s3.
require(msg.sender == owner(), "Only Owner"); //optional as onlyOwner Modifier is used
uint256 total = totalSeries;
uint256 tempNumber = _numberToMint.add(totalSeries);
for (uint256 i = total; i < tempNumber; i++) {
seriesToTokenId[i].url = _url;
seriesToTokenId[i].numberInSeries = _numberToMint;
seriesToTokenId[i].DGXcost = _DGXcost;
seriesToTokenId[i].fee = _fee;
totalSeries = totalSeries.add(1);
}
emit NewSeriesMade(_url, _numberToMint);
return true;
...
// [truncated — 60944 bytes total]
Read Contract
DGXContract 0xc4c6fe87 → address
DGXTokenContract 0x32f19189 → address
DGXTokenStorage 0x1995771b → address
StakedValue 0xc21d0a61 → uint256
balanceOf 0x70a08231 → uint256
getApproved 0x081812fc → address
isApprovedForAll 0xe985e9c5 → bool
isOnline 0x664ab18e → bool
isOwner 0x8f32d59b → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
ownerOf 0x6352211e → address
seriesToTokenId 0x5bacc864 → string, uint256, uint256, uint256, bool
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
tokenByIndex 0x4f6ccce7 → uint256
tokenOfOwnerByIndex 0x2f745c59 → uint256
tokenURI 0xc87b56dd → string
totalFeesCollected 0x60c6d8ae → uint256
totalSeries 0x0c6a595a → uint256
totalSupply 0x18160ddd → uint256
viewYourTokens 0x747b41cf → uint256[]
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address to
uint256 tokenId
burnStake 0x2164f5f2
uint256 _tokenId
returns: bool
checkFeesForBurn 0xf834aabb
uint256 _tokenId
returns: uint256
createNewSeries 0xabc0a6db
string _url
uint256 _numberToMint
uint256 _DGXcost
uint256 _fee
returns: bool
renounceOwnership 0x715018a6
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
setDGXContract 0x0dc014db
address newAddress
returns: bool
setDGXStorage 0xc9f5808b
address newAddress
returns: bool
setDGXTokenContract 0xb20a4809
address newAddress
returns: bool
stake 0xa694fc3a
uint256 _tokenToBuy
returns: bool
toggleOnline 0x40e05d08
No parameters
transferFrom 0x23b872dd
address from
address to
uint256 tokenId
transferOwnership 0xf2fde38b
address newOwner
withdrawal 0xd4e93292
No parameters
returns: bool
Recent Transactions
This address has 1 on-chain transactions, but only 0.7% of the chain is indexed. Transactions will appear as indexing progresses. View on Etherscan →