Address Contract Partially Verified
Address
0xc4c7Ea4FAB34BD9fb9a5e1B1a98Df76E26E6407c
Balance
0 ETH
Nonce
1
Code Size
16068 bytes
Creator
0x0842E032...2b6d at tx 0x0dbb0d52...270a02
Indexed Transactions
0
Contract Bytecode
16068 bytes
0x608060405260043610610180576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610185578063095ea7b31461021557806318160ddd1461028857806323b872dd146102b35780632e0f2625146103465780632e3ab672146103775780632ff2e9dc146103f2578063313ce5671461041d57806331d42bf21461044e578063395093511461049f5780633976bd1d146105125780633ea42676146105635780633f4ba83a146105de57806346fbf68e146105f55780635c975abb1461065e5780636ef8d66d1461068d57806370a08231146106a4578063715018a61461070957806382dc1ec4146107205780638456cb59146107715780638da5cb5b146107885780638f32d59b146107df57806395d89b411461080e578063981417121461089e578063a457c2d7146108ef578063a9059cbb14610962578063db5009a5146109d5578063dd62ed3e14610a26578063f2fde38b14610aab578063f3ff496114610afc575b600080fd5b34801561019157600080fd5b5061019a610b65565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101da5780820151818401526020810190506101bf565b50505050905090810190601f1680156102075780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022157600080fd5b5061026e6004803603604081101561023857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c07565b604051808215151515815260200191505060405180910390f35b34801561029457600080fd5b5061029d610c25565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b5061032c600480360360608110156102d657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c2f565b604051808215151515815260200191505060405180910390f35b34801561035257600080fd5b5061035b611041565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038357600080fd5b506103b06004803603602081101561039a57600080fd5b8101908080359060200190929190505050611046565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103fe57600080fd5b50610407611084565b6040518082815260200191505060405180910390f35b34801561042957600080fd5b50610432611095565b604051808260ff1660ff16815260200191505060405180910390f35b34801561045a57600080fd5b5061049d6004803603602081101561047157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110ac565b005b3480156104ab57600080fd5b506104f8600480360360408110156104c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114c6565b604051808215151515815260200191505060405180910390f35b34801561051e57600080fd5b506105616004803603602081101561053557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611579565b005b34801561056f57600080fd5b5061059c6004803603602081101561058657600080fd5b8101908080359060200190929190505050611a08565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105ea57600080fd5b506105f3611a46565b005b34801561060157600080fd5b506106446004803603602081101561061857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bfb565b604051808215151515815260200191505060405180910390f35b34801561066a57600080fd5b50610673611c18565b604051808215151515815260200191505060405180910390f35b34801561069957600080fd5b506106a2611c2f565b005b3480156106b057600080fd5b506106f3600480360360208110156106c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c41565b6040518082815260200191505060405180910390f35b34801561071557600080fd5b5061071e611c89565b005b34801561072c57600080fd5b5061076f6004803603602081101561074357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dc6565b005b34801561077d57600080fd5b50610786611e7c565b005b34801561079457600080fd5b5061079d612032565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107eb57600080fd5b506107f461205c565b604051808215151515815260200191505060405180910390f35b34801561081a57600080fd5b506108236120bb565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610863578082015181840152602081019050610848565b50505050905090810190601f1680156108905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108aa57600080fd5b506108ed600480360360208110156108c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061215d565b005b3480156108fb57600080fd5b506109486004803603604081101561091257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612577565b604051808215151515815260200191505060405180910390f35b34801561096e57600080fd5b506109bb6004803603604081101561098557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612688565b604051808215151515815260200191505060405180910390f35b3480156109e157600080fd5b50610a24600480360360208110156109f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612871565b005b348015610a3257600080fd5b50610a9560048036036040811015610a4957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d00565b6040518082815260200191505060405180910390f35b348015610ab757600080fd5b50610afa60048036036020811015610ace57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d87565b005b348015610b0857600080fd5b50610b4b60048036036020811015610b1f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e0f565b604051808215151515815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bfd5780601f10610bd257610100808354040283529160200191610bfd565b820191906000526020600020905b815481529060010190602001808311610be057829003601f168201915b5050505050905090565b6000610c1b610c14613072565b848461307a565b6001905092915050565b6000600254905090565b600060011515610c3d611c18565b15151415610e3c576000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151515610d23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f636f6e747261637420697320696e20207061757365642c2063616e277420747281526020017f616e73666572000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e37576000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151515610e36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f636f6e747261637420697320696e20207061757365642c2063616e277420747281526020017f616e73666572000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5b61102d565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515610f19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f6164647265737320696e20626c61636b206c6973742c2063616e27742074726181526020017f6e7366657200000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561102c576000600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561102b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f6164647265737320696e20626c61636b206c6973742c2063616e27742074726181526020017f6e7366657200000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5b5b6110388484846132fb565b90509392505050565b601281565b60098181548110151561105557fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601260ff16600a0a6305f5e1000281565b6000600560009054906101000a900460ff16905090565b6110b461205c565b1515611128576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f61646472657373206973206e6f7420307830000000000000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611272576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f61646472657373206973206e6f7420636f6e747261637400000000000000000081525060200191505060405180910390fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515611329576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f68617320696e20626c61636b206c69737400000000000000000000000000000081525060200191505060405180910390fd5b60006009805490509050640100000000811015156113af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f626c61636b206c69737420697320746f6f206c6f6e670000000000000000000081525060200191505060405180910390fd5b60016009818180549050019150816113c79190613e47565b50826009828154811015156113d857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018101600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fc476158237ccbc15520902c2dde98207da751a8ed354f6ac5a0fc7bf6367539f60405160405180910390a3505050565b600061156f6114d3613072565b8461156a85600160006114e4613072565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461341890919063ffffffff16565b61307a565b6001905092915050565b61158161205c565b15156115f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561169b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f61646472657373206973206e6f7420307830000000000000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561173f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f61646472657373206973206e6f7420636f6e747261637400000000000000000081525060200191505060405180910390fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515156117f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6e6f7420696e20626c61636b206c69737400000000000000000000000000000081525060200191505060405180910390fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506009805490508114156118665760016009818180549050039150816118609190613e47565b50611966565b6000600960016009805490500381548110151561187f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050806009600184038154811015156118bf57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160098181805490500391508161191f9190613e47565b5081600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090558273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ff5313ac47c999dc2ae75dfcccccfaf58315f81db55e56a9f484fcc9a02cc559860405160405180910390a3505050565b600b81815481101515611a1757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611a56611a51613072565b611bfb565b1515611af0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f506175736572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f207468652050617573657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b600760009054906101000a900460ff161515611b74576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600760006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611bb8613072565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000611c118260066134a290919063ffffffff16565b9050919050565b6000600760009054906101000a900460ff16905090565b611c3f611c3a613072565b6135c5565b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611c9161205c565b1515611d05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611dd6611dd1613072565b611bfb565b1515611e70576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f506175736572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f207468652050617573657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b611e798161361f565b50565b611e8c611e87613072565b611bfb565b1515611f26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001807f506175736572526f6c653a2063616c6c657220646f6573206e6f74206861766581526020017f207468652050617573657220726f6c650000000000000000000000000000000081525060400191505060405180910390fd5b600760009054906101000a900460ff16151515611fab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600760006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611fef613072565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661209f613072565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121535780601f1061212857610100808354040283529160200191612153565b820191906000526020600020905b81548152906001019060200180831161213657829003601f168201915b5050505050905090565b61216561205c565b15156121d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561227f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f61646472657373206973206e6f7420307830000000000000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612323576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f61646472657373206973206e6f7420636f6e747261637400000000000000000081525060200191505060405180910390fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415156123da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f68617320696e207768697465206c69737400000000000000000000000000000081525060200191505060405180910390fd5b6000600b80549050905064010000000081101515612460576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f7768697465206c69737420697320746f6f206c6f6e670000000000000000000081525060200191505060405180910390fd5b6001600b818180549050019150816124789190613e47565b5082600b8281548110151561248957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060018101600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f70a380f431974c4a702597b5a84db4fd82b46c6c22bbece2f7a2ace9b4f2407160405160405180910390a3505050565b600061267e612584613072565b8461267985606060405190810160405280602581526020017f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7781526020017f207a65726f000000000000000000000000000000000000000000000000000000815250600160006125f2613072565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136799092919063ffffffff16565b61307a565b6001905092915050565b600060011515612696611c18565b15151415612781576000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415151561277c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f636f6e747261637420697320696e207061757365642c206f6e6c7920696e207781526020017f68697465206c6973742063616e207472616e736665720000000000000000000081525060400191505060405180910390fd5b61285f565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561285e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f6164647265737320696e20626c61636b206c6973742c2063616e27742074726181526020017f6e7366657200000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b5b612869838361373b565b905092915050565b61287961205c565b15156128ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612993576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f61646472657373206973206e6f7420307830000000000000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612a37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f61646472657373206973206e6f7420636f6e747261637400000000000000000081525060200191505060405180910390fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151515612aef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6e6f7420696e207768697465206c69737400000000000000000000000000000081525060200191505060405180910390fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600b80549050811415612b5e576001600b81818054905003915081612b589190613e47565b50612c5e565b6000600b6001600b8054905003815481101515612b7757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905080600b60018403815481101515612bb757fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600b81818054905003915081612c179190613e47565b5081600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090558273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4a1cd3dad39d738320ad544b9d523ba6ee01375228a912e5ebbe7ed7f52c3c0c60405160405180910390a3505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612d8f61205c565b1515612e03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612e0c81613759565b50565b6000612e1961205c565b1515612e8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612f33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f61646472657373206973206e6f7420307830000000000000000000000000000081525060200191505060405180910390fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612fd7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f61646472657373206973206e6f7420636f6e747261637400000000000000000081525060200191505060405180910390fd5b6000612fe230611c41565b905060008111151561305c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f6e6f7420656e6f7567682062616c616e6365000000000000000000000000000081525060200191505060405180910390fd5b6130673085836138e4565b600192505050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515613145576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515613210576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b60006133088484846138e4565b61340d84613314613072565b61340885606060405190810160405280602881526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206181526020017f6c6c6f77616e6365000000000000000000000000000000000000000000000000815250600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006133be613072565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136799092919063ffffffff16565b61307a565b600190509392505050565b6000808284019050838110151515613498576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561356e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f526f6c65733a206163636f756e7420697320746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6135d9816006613c6890919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b613633816006613d6a90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b60008383111582901515613728576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156136ed5780820151818401526020810190506136d2565b50505050905090810190601f16801561371a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600061374f613748613072565b84846138e4565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515613824576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600760016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156139af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515613a7a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b613b2981606060405190810160405280602681526020017f45524332303a207472616e7366657220616d6f756e742065786365656473206281526020017f616c616e636500000000000000000000000000000000000000000000000000008152506000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136799092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613bbc816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461341890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b613c7282826134a2565b1515613d0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c81526020017f650000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b613d7482826134a2565b151515613de9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b815481835581811115613e6e57818360005260206000209182019101613e6d9190613e73565b5b505050565b613e9591905b80821115613e91576000816000905550600101613e79565b5090565b9056fea165627a7a7230582089af3d494921bd45f9d2ceffcb10114c5b2402e7c5c30e3d7587779b140b05110029
Verified Source Code Partial Match
Compiler: v0.5.0+commit.1d4f565a
EVM: byzantium
Optimization: No
CocosToken.sol 964 lines
// File: @openzeppelin/contracts/GSN/Context.sol
pragma solidity ^0.5.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
interface IERC20 {
/**
* @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.
*
* IMPORTANT: 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 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);
}
// File: @openzeppelin/contracts/math/SafeMath.sol
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) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
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-contracts/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) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message 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.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
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) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20.sol
pragma solidity ^0.5.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20Mintable}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See {_burn} and {_approve}.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
// File: @openzeppelin/contracts/token/ERC20/ERC20Detailed.sol
pragma solidity ^0.5.0;
/**
* @dev Optional functions from the ERC20 standard.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
/**
* @dev Sets the values for `name`, `symbol`, and `decimals`. All three of
* these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
// File: @openzeppelin/contracts/access/Roles.sol
pragma solidity ^0.5.0;
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
/**
* @dev Give an account access to this role.
*/
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
/**
* @dev Remove an account's access to this role.
*/
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
/**
* @dev Check if an account has this role.
* @return bool
*/
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
// File: @openzeppelin/contracts/access/roles/PauserRole.sol
pragma solidity ^0.5.0;
contract PauserRole is Context {
using Roles for Roles.Role;
event PauserAdded(address indexed account);
event PauserRemoved(address indexed account);
Roles.Role private _pausers;
constructor () internal {
_addPauser(_msgSender());
}
modifier onlyPauser() {
require(isPauser(_msgSender()), "PauserRole: caller does not have the Pauser role");
_;
}
function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
}
function addPauser(address account) public onlyPauser {
_addPauser(account);
}
function renouncePauser() public {
_removePauser(_msgSender());
}
function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
}
function _removePauser(address account) internal {
_pausers.remove(account);
emit PauserRemoved(account);
}
}
// File: @openzeppelin/contracts/lifecycle/Pausable.sol
pragma solidity ^0.5.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context, PauserRole {
/**
* @dev Emitted when the pause is triggered by a pauser (`account`).
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by a pauser (`account`).
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state. Assigns the Pauser role
* to the deployer.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Called by a pauser to pause, triggers stopped state.
*/
function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Called by a pauser to unpause, returns to normal state.
*/
function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: @openzeppelin/contracts/ownership/Ownable.sol
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 applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @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 _msgSender() == _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;
}
}
// File: contracts/token/CocosToken.sol
pragma solidity ^0.5.0;
/// @title CocosToken Contract
/// For more information about this token please visit https://cocosbcx.io
contract CocosToken is ERC20, ERC20Detailed, Pausable, Ownable {
using SafeMath for uint;
/// Constant token specific fields
uint8 public constant DECIMALS = 18;
uint256 public constant INITIAL_SUPPLY = 100000000 * (10 ** uint256(DECIMALS));
// black list
mapping(address => uint) blackAccountMap;
address[] public blackAccounts;
// white list
mapping(address => uint) whiteAccountMap;
address[] public whiteAccounts;
event TransferMuti(uint256 len, uint256 amount);
event AddWhiteAccount(address indexed operator, address indexed whiteAccount);
event AddBlackAccount(address indexed operator, address indexed blackAccount);
event DelWhiteAccount(address indexed operator, address indexed whiteAccount);
event DelBlackAccount(address indexed operator, address indexed blackAccount);
modifier validAddress( address addr ) {
require(addr != address(0x0), "address is not 0x0");
require(addr != address(this), "address is not contract");
_;
}
/**
* CONSTRUCTOR
*
* @dev Initialize the Cocos Token
*/
constructor () public ERC20Detailed("CocosTokenV2", "COCOS", DECIMALS) {
pause();
_mint(msg.sender, INITIAL_SUPPLY);
}
function() external payable {
revert();
}
function transfer(address _to, uint256 _value) public returns (bool) {
if (paused() == true) {
// , only white list pass
require(whiteAccountMap[msg.sender] != 0, "contract is in paused, only in white list can transfer");
}
else {
// check black list
require(blackAccountMap[msg.sender] == 0,"address in black list, can't transfer");
}
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
if (paused() == true) {
// frozen contract , only white list pass
require(whiteAccountMap[msg.sender] != 0, "contract is in paused, can't transfer");
if (msg.sender != _from) {
require(whiteAccountMap[_from] != 0, "contract is in paused, can't transfer");
}
}
else {
// check black list
require(blackAccountMap[msg.sender] == 0, "address in black list, can't transfer");
if (msg.sender != _from) {
require(blackAccountMap[_from] == 0,"address in black list, can't transfer");
}
}
return super.transferFrom(_from, _to, _value);
}
// people will transfer cocos to contract, fix it
function withdrawFromContract(address _to) public onlyOwner validAddress(_to) returns (bool) {
uint256 contractBalance = balanceOf(address(this));
require(contractBalance > 0, "not enough balance");
_transfer(address(this), _to, contractBalance);
return true;
}
function addWhiteAccount(address _whiteAccount) public
onlyOwner
validAddress(_whiteAccount){
require(whiteAccountMap[_whiteAccount]==0, "has in white list");
uint256 index = whiteAccounts.length;
require(index < 4294967296, "white list is too long");
whiteAccounts.length += 1;
whiteAccounts[index] = _whiteAccount;
whiteAccountMap[_whiteAccount] = index + 1;
emit AddWhiteAccount(msg.sender,_whiteAccount);
}
function delWhiteAccount(address _whiteAccount) public
onlyOwner
validAddress(_whiteAccount){
require(whiteAccountMap[_whiteAccount]!=0,"not in white list");
uint256 index = whiteAccountMap[_whiteAccount];
if (index == whiteAccounts.length)
{
whiteAccounts.length -= 1;
}else{
address lastaddress = whiteAccounts[whiteAccounts.length-1];
whiteAccounts[index-1] = lastaddress;
whiteAccounts.length -= 1;
whiteAccountMap[lastaddress] = index;
}
delete whiteAccountMap[_whiteAccount];
emit DelWhiteAccount(msg.sender,_whiteAccount);
}
function addBlackAccount(address _blackAccount) public
onlyOwner
validAddress(_blackAccount){
require(blackAccountMap[_blackAccount]==0, "has in black list");
uint256 index = blackAccounts.length;
require(index < 4294967296, "black list is too long");
blackAccounts.length += 1;
blackAccounts[index] = _blackAccount;
blackAccountMap[_blackAccount] = index + 1;
emit AddBlackAccount(msg.sender, _blackAccount);
}
function delBlackAccount(address _blackAccount) public
onlyOwner
validAddress(_blackAccount){
require(blackAccountMap[_blackAccount]!=0,"not in black list");
uint256 index = blackAccountMap[_blackAccount];
if (index == blackAccounts.length)
{
blackAccounts.length -= 1;
}else{
address lastaddress = blackAccounts[blackAccounts.length-1];
blackAccounts[index-1] = lastaddress;
blackAccounts.length -= 1;
blackAccountMap[lastaddress] = index;
}
delete blackAccountMap[_blackAccount];
emit DelBlackAccount(msg.sender, _blackAccount);
}
}
Read Contract
DECIMALS 0x2e0f2625 → uint8
INITIAL_SUPPLY 0x2ff2e9dc → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
blackAccounts 0x2e3ab672 → address
decimals 0x313ce567 → uint8
isOwner 0x8f32d59b → bool
isPauser 0x46fbf68e → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
whiteAccounts 0x3ea42676 → address
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
addBlackAccount 0x31d42bf2
address _blackAccount
addPauser 0x82dc1ec4
address account
addWhiteAccount 0x98141712
address _whiteAccount
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
delBlackAccount 0x3976bd1d
address _blackAccount
delWhiteAccount 0xdb5009a5
address _whiteAccount
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
renouncePauser 0x6ef8d66d
No parameters
transfer 0xa9059cbb
address _to
uint256 _value
returns: bool
transferFrom 0x23b872dd
address _from
address _to
uint256 _value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdrawFromContract 0xf3ff4961
address _to
returns: bool
Recent Transactions
No transactions found for this address