Address Contract Partially Verified
Address
0x7061583c8106D726ce7196f7bc33a7F06E32fE3C
Balance
0 ETH
Nonce
1
Code Size
13741 bytes
Creator
0x65d62ef3...00B6 at tx 0xf0fcc37f...bd9267
Indexed Transactions
0
Contract Bytecode
13741 bytes
0x60806040526004361061019c5760003560e01c806370a08231116100ec578063986502751161008a578063aa271e1a11610064578063aa271e1a146108da578063d54f9d0914610943578063dd62ed3e1461094d578063e6b9e897146109d25761019c565b806398650275146107dd578063a457c2d7146107f4578063a9059cbb146108675761019c565b8063841815ef116100c6578063841815ef146106b65780638456cb59146106e557806395d89b41146106fc578063983b2d561461078c5761019c565b806370a08231146105a557806379cc67901461060a57806382dc1ec4146106655761019c565b8063395093511161015957806342966c681161013357806342966c68146104bb57806346fbf68e146104f65780635c975abb1461055f5780636ef8d66d1461058e5761019c565b806339509351146103be5780633f4ba83a1461043157806340c10f19146104485761019c565b806306fdde03146101a1578063095ea7b31461023157806318160ddd146102a457806323b872dd146102cf578063313ce56714610362578063355274ea14610393575b600080fd5b3480156101ad57600080fd5b506101b6610a23565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f65780820151818401526020810190506101db565b50505050905090810190601f1680156102235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023d57600080fd5b5061028a6004803603604081101561025457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac5565b604051808215151515815260200191505060405180910390f35b3480156102b057600080fd5b506102b9610b5c565b6040518082815260200191505060405180910390f35b3480156102db57600080fd5b50610348600480360360608110156102f257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b66565b604051808215151515815260200191505060405180910390f35b34801561036e57600080fd5b50610377610bff565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039f57600080fd5b506103a8610c16565b6040518082815260200191505060405180910390f35b3480156103ca57600080fd5b50610417600480360360408110156103e157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c20565b604051808215151515815260200191505060405180910390f35b34801561043d57600080fd5b50610446610cb7565b005b34801561045457600080fd5b506104a16004803603604081101561046b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e25565b604051808215151515815260200191505060405180910390f35b3480156104c757600080fd5b506104f4600480360360208110156104de57600080fd5b8101908080359060200190929190505050610ea0565b005b34801561050257600080fd5b506105456004803603602081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb4565b604051808215151515815260200191505060405180910390f35b34801561056b57600080fd5b50610574610ed1565b604051808215151515815260200191505060405180910390f35b34801561059a57600080fd5b506105a3610ee8565b005b3480156105b157600080fd5b506105f4600480360360208110156105c857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610efa565b6040518082815260200191505060405180910390f35b34801561061657600080fd5b506106636004803603604081101561062d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f43565b005b34801561067157600080fd5b506106b46004803603602081101561068857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f51565b005b3480156106c257600080fd5b506106cb610fc2565b604051808215151515815260200191505060405180910390f35b3480156106f157600080fd5b506106fa610fd9565b005b34801561070857600080fd5b50610711611148565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610751578082015181840152602081019050610736565b50505050905090810190601f16801561077e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079857600080fd5b506107db600480360360208110156107af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111ea565b005b3480156107e957600080fd5b506107f261125b565b005b34801561080057600080fd5b5061084d6004803603604081101561081757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061126d565b604051808215151515815260200191505060405180910390f35b34801561087357600080fd5b506108c06004803603604081101561088a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611304565b604051808215151515815260200191505060405180910390f35b3480156108e657600080fd5b50610929600480360360208110156108fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061139b565b604051808215151515815260200191505060405180910390f35b61094b6113b8565b005b34801561095957600080fd5b506109bc6004803603604081101561097057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a4565b6040518082815260200191505060405180910390f35b3480156109de57600080fd5b50610a21600480360360208110156109f557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061192b565b005b606060008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610abb5780601f10610a9057610100808354040283529160200191610abb565b820191906000526020600020905b815481529060010190602001808311610a9e57829003601f168201915b5050505050905090565b6000600960009054906101000a900460ff1615610b4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610b548383611fc1565b905092915050565b6000600554905090565b6000600960009054906101000a900460ff1615610beb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610bf6848484611fdf565b90509392505050565b6000600260009054906101000a900460ff16905090565b6000600754905090565b6000600960009054906101000a900460ff1615610ca5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b610caf83836120b8565b905092915050565b610cc7610cc261216b565b610eb4565b610d1c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061321c6030913960400191505060405180910390fd5b600960009054906101000a900460ff16610d9e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600960006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa610de261216b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000610e37610e3261216b565b61139b565b610e8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061334a6030913960400191505060405180910390fd5b610e968383612173565b6001905092915050565b610eb1610eab61216b565b82612212565b50565b6000610eca8260086123cc90919063ffffffff16565b9050919050565b6000600960009054906101000a900460ff16905090565b610ef8610ef361216b565b6124aa565b565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610f4d8282612504565b5050565b610f61610f5c61216b565b610eb4565b610fb6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061321c6030913960400191505060405180910390fd5b610fbf816125d3565b50565b6000600960159054906101000a900460ff16905090565b610fe9610fe461216b565b610eb4565b61103e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061321c6030913960400191505060405180910390fd5b600960009054906101000a900460ff16156110c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6001600960006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861110561216b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111e05780601f106111b5576101008083540402835291602001916111e0565b820191906000526020600020905b8154815290600101906020018083116111c357829003601f168201915b5050505050905090565b6111fa6111f561216b565b61139b565b61124f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061334a6030913960400191505060405180910390fd5b6112588161262d565b50565b61126b61126661216b565b612687565b565b6000600960009054906101000a900460ff16156112f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6112fc83836126e1565b905092915050565b6000600960009054906101000a900460ff1615611389576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61139383836127ae565b905092915050565b60006113b18260066123cc90919063ffffffff16565b9050919050565b600960159054906101000a900460ff161561141e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061329f6025913960400191505060405180910390fd5b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d7a97c7f6040518163ffffffff1660e01b815260040160206040518083038186803b15801561148657600080fd5b505afa15801561149a573d6000803e3d6000fd5b505050506040513d60208110156114b057600080fd5b8101908080519060200190929190505050611516576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604081526020018061339b6040913960400191505060405180910390fd5b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b871a57e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561157e57600080fd5b505afa158015611592573d6000803e3d6000fd5b505050506040513d60208110156115a857600080fd5b810190808051906020019092919050505061160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603081526020018061331a6030913960400191505060405180910390fd5b60003411611667576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604b8152602001806134dd604b913960600191505060405180910390fd5b600061167233610efa565b9050600081116116cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806131ca6030913960400191505060405180910390fd5b6116d5610c16565b811061172c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180613528602c913960400191505060405180910390fd5b611760600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661175b33610efa565b611304565b506000600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631cdc34013433856040518463ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506020604051808303818588803b15801561180c57600080fd5b505af1158015611820573d6000803e3d6000fd5b50505050506040513d602081101561183757600080fd5b81019080805190602001909291905050509050806118a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061346a602a913960400191505060405180910390fd5b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600081905060008173ffffffffffffffffffffffffffffffffffffffff16634faf28386040518163ffffffff1660e01b815260040160206040518083038186803b15801561197857600080fd5b505afa15801561198c573d6000803e3d6000fd5b505050506040513d60208110156119a257600080fd5b8101908080519060200190929190505050905080611a1b578173ffffffffffffffffffffffffffffffffffffffff1663767c56a26040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611a0257600080fd5b505af1158015611a16573d6000803e3d6000fd5b505050505b8080611aa457508173ffffffffffffffffffffffffffffffffffffffff16634faf28386040518163ffffffff1660e01b815260040160206040518083038186803b158015611a6857600080fd5b505afa158015611a7c573d6000803e3d6000fd5b505050506040513d6020811015611a9257600080fd5b81019080805190602001909291905050505b611af9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260308152602001806132ea6030913960400191505060405180910390fd5b6000611b0433610efa565b90506000811180611bc057508273ffffffffffffffffffffffffffffffffffffffff16636dce6c5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611b5657600080fd5b505afa158015611b6a573d6000803e3d6000fd5b505050506040513d6020811015611b8057600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611c15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603181526020018061326e6031913960400191505060405180910390fd5b60016002811115611c2257fe5b8373ffffffffffffffffffffffffffffffffffffffff1663237297a46040518163ffffffff1660e01b815260040160206040518083038186803b158015611c6857600080fd5b505afa158015611c7c573d6000803e3d6000fd5b505050506040513d6020811015611c9257600080fd5b81019080805190602001909291905050506002811115611cae57fe5b148015611d6757508273ffffffffffffffffffffffffffffffffffffffff16636dce6c5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611cfc57600080fd5b505afa158015611d10573d6000803e3d6000fd5b505050506040513d6020811015611d2657600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b80611ebe5750600280811115611d7957fe5b8373ffffffffffffffffffffffffffffffffffffffff1663237297a46040518163ffffffff1660e01b815260040160206040518083038186803b158015611dbf57600080fd5b505afa158015611dd3573d6000803e3d6000fd5b505050506040513d6020811015611de957600080fd5b81019080805190602001909291905050506002811115611e0557fe5b148015611ebd57508273ffffffffffffffffffffffffffffffffffffffff16636dce6c5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611e5357600080fd5b505afa158015611e67573d6000803e3d6000fd5b505050506040513d6020811015611e7d57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b5b611f13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260428152602001806131656042913960600191505060405180910390fd5b611f1c81610ea0565b8273ffffffffffffffffffffffffffffffffffffffff16632012517682336040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b158015611fa357600080fd5b505af1158015611fb7573d6000803e3d6000fd5b5050505050505050565b6000611fd5611fce61216b565b84846127cc565b6001905092915050565b6000611fec8484846129c3565b6120ad84611ff861216b565b6120a8856040518060600160405280602881526020016133db60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061205e61216b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7d9092919063ffffffff16565b6127cc565b600190509392505050565b60006121616120c561216b565b8461215c85600460006120d661216b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d3d90919063ffffffff16565b6127cc565b6001905092915050565b600033905090565b60075461219082612182610b5c565b612d3d90919063ffffffff16565b1115612204576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f45524332304361707065643a206361702065786365656465640000000000000081525060200191505060405180910390fd5b61220e8282612dc5565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612298576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806134496021913960400191505060405180910390fd5b612304816040518060600160405280602281526020016131fa60229139600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7d9092919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235c81600554612f8290919063ffffffff16565b600581905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612453576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806134036022913960400191505060405180910390fd5b8260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6124be816008612fcc90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e60405160405180910390a250565b61250e8282612212565b6125cf8261251a61216b565b6125ca8460405180606001604052806024815260200161342560249139600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061258061216b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7d9092919063ffffffff16565b6127cc565b5050565b6125e781600861308990919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f860405160405180910390a250565b61264181600661308990919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f660405160405180910390a250565b61269b816006612fcc90919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff167fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669260405160405180910390a250565b60006127a46126ee61216b565b8461279f85604051806060016040528060258152602001613554602591396004600061271861216b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7d9092919063ffffffff16565b6127cc565b6001905092915050565b60006127c26127bb61216b565b84846129c3565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612852576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806134b96024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156128d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061324c6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a49576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806134946025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612acf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806131a76023913960400191505060405180910390fd5b612b3b816040518060600160405280602681526020016132c460269139600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c7d9092919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612bd081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d3d90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290612d2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612cef578082015181840152602081019050612cd4565b50505050905090810190601f168015612d1c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015612dbb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b612e7d81600554612d3d90919063ffffffff16565b600581905550612ed581600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d3d90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000612fc483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612c7d565b905092915050565b612fd682826123cc565b61302b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061337a6021913960400191505060405180910390fd5b60008260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b61309382826123cc565b15613106576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f526f6c65733a206163636f756e7420616c72656164792068617320726f6c650081525060200191505060405180910390fd5b60018260000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505056fe5b6275726e416e64436f6c6c65637445746865725d204163636f756e7420646f6573206e6f74206861766520726967687420746f20636f6c6c65637420657468657245524332303a207472616e7366657220746f20746865207a65726f20616464726573735b6c6f636b536861726473416e64436c61696d5d204163636f756e7420646f6573206e6f74206f776e2053686172647345524332303a206275726e20616d6f756e7420657863656564732062616c616e6365506175736572526f6c653a2063616c6c657220646f6573206e6f742068617665207468652050617573657220726f6c6545524332303a20617070726f766520746f20746865207a65726f20616464726573735b6275726e416e64436f6c6c65637445746865725d204163636f756e7420646f6573206e6f74206f776e205368617264735b6c6f636b536861726473416e64436c61696d5d2053686f7467756e2064697361626c656445524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63655b6275726e416e64436f6c6c65637445746865725d2053686f7467756e20436c61757365206e6f7420656e61637465645b6c6f636b536861726473416e64436c61696d5d2053686f7467756e20616c726561647920696e2070726f67726573734d696e746572526f6c653a2063616c6c657220646f6573206e6f74206861766520746865204d696e74657220726f6c65526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c655b6c6f636b536861726473416e64436c61696d5d204e4654206e6f74206c6f636b65642c2053686f7467756e2063616e6e6f742062652074726967676572656445524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f20616464726573735b6c6f636b5368617264735d20457468657220666f7277617264696e6720756e7375636365737366756c45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735b6c6f636b536861726473416e64436c61696d5d205472616e73616374696f6e206d7573742073656e6420657468657220746f2061637469766174652053686f7467756e20436c617573655b6c6f636b536861726473416e64436c61696d5d204163636f756e74206f776e7320616c6c2053686172647345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a7231582068264ae2faa90a4ab1026f44d3a36ca9e19386202c1d1faf34cd7917e6a8b5fb64736f6c634300050f0032
Verified Source Code Partial Match
Compiler: v0.5.15+commit.6a57276f
EVM: istanbul
Optimization: No
ShardRegistry.sol 1003 lines
/* solhint-disable no-mix-tabs-and-spaces */
/* solhint-disable indent */
pragma solidity 0.5.15;
/**
* @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);
}
/**
* @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;
}
}
/*
* @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;
}
}
/**
* @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;
}
}
/**
* @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"));
}
}
/**
* @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];
}
}
contract MinterRole is Context {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
constructor () internal {
_addMinter(_msgSender());
}
modifier onlyMinter() {
require(isMinter(_msgSender()), "MinterRole: caller does not have the Minter role");
_;
}
function isMinter(address account) public view returns (bool) {
return _minters.has(account);
}
function addMinter(address account) public onlyMinter {
_addMinter(account);
}
function renounceMinter() public {
_removeMinter(_msgSender());
}
function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
}
function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
}
}
/**
* @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole},
* which have permission to mint (create) new tokens as they see fit.
*
* At construction, the deployer of the contract is the only minter.
*/
contract ERC20Mintable is ERC20, MinterRole {
/**
* @dev See {ERC20-_mint}.
*
* Requirements:
*
* - the caller must have the {MinterRole}.
*/
function mint(address account, uint256 amount) public onlyMinter returns (bool) {
_mint(account, amount);
return true;
}
}
/**
* @dev Extension of {ERC20Mintable} that adds a cap to the supply of tokens.
*/
contract ERC20Capped is ERC20Mintable {
uint256 private _cap;
/**
* @dev Sets the value of the `cap`. This value is immutable, it can only be
* set once during construction.
*/
constructor (uint256 cap) public {
require(cap > 0, "ERC20Capped: cap is 0");
_cap = cap;
}
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view returns (uint256) {
return _cap;
}
/**
* @dev See {ERC20Mintable-mint}.
*
* Requirements:
*
* - `value` must not cause the total supply to go over the cap.
*/
function _mint(address account, uint256 value) internal {
require(totalSupply().add(value) <= _cap, "ERC20Capped: cap exceeded");
super._mint(account, value);
}
}
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public {
_burn(_msgSender(), amount);
}
/**
* @dev See {ERC20-_burnFrom}.
*/
function burnFrom(address account, uint256 amount) public {
_burnFrom(account, amount);
}
}
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);
}
}
/**
* @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());
}
}
/**
* @title Pausable token
* @dev ERC20 with pausable transfers and allowances.
*
* Useful if you want to stop trades until the end of a crowdsale, or have
* an emergency switch for freezing all token transfers in the event of a large
* bug.
*/
contract ERC20Pausable is ERC20, Pausable {
function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
return super.transfer(to, value);
}
function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) {
return super.transferFrom(from, to, value);
}
function approve(address spender, uint256 value) public whenNotPaused returns (bool) {
return super.approve(spender, value);
}
function increaseAllowance(address spender, uint256 addedValue) public whenNotPaused returns (bool) {
return super.increaseAllowance(spender, addedValue);
}
function decreaseAllowance(address spender, uint256 subtractedValue) public whenNotPaused returns (bool) {
return super.decreaseAllowance(spender, subtractedValue);
}
}
/* solhint-disable no-mix-tabs-and-spaces */
/* solhint-disable indent */
interface IShardGovernor {
function claimInitialShotgun(
address payable initialClaimantAddress,
uint initialClaimantBalance
) external payable returns (bool);
function transferShards(
address recipient,
uint amount
) external;
function enactShotgun() external;
function offererAddress() external view returns (address);
function checkLock() external view returns (bool);
function checkShotgunState() external view returns (bool);
function getNftRegistryAddress() external view returns (address);
function getNftTokenIds() external view returns (uint256[] memory);
function getOwner() external view returns (address);
}
/* solhint-disable no-mix-tabs-and-spaces */
/* solhint-disable indent */
interface IShotgunClause {
enum ClaimWinner { None, Claimant, Counterclaimant }
function counterCommitEther() external payable;
function collectEtherProceeds(
uint balance,
address payable caller
) external;
function collectShardProceeds() external;
function enactShotgun() external;
function deadlineTimestamp() external view returns (uint256);
function shotgunEnacted() external view returns (bool);
function initialClaimantAddress() external view returns (address);
function initialClaimantBalance() external view returns (uint);
function initialOfferInWei() external view returns (uint256);
function pricePerShardInWei() external view returns (uint256);
function claimWinner() external view returns (ClaimWinner);
function counterclaimants() external view returns (address[] memory);
function getCounterclaimantContribution(
address counterclaimant
) external view returns (uint);
function counterWeiContributed() external view returns (uint);
function getContractBalance() external view returns (uint);
function shardGovernor() external view returns (address);
function getRequiredWeiForCounterclaim() external view returns (uint);
}
/**
* @title ERC20 base for Shards with additional methods related to governance
* @author Joel Hubert (Metalith.io)
* @dev OpenZeppelin contracts are not ready for 0.6.0 yet, using 0.5.16.
*/
contract ShardRegistry is ERC20Detailed, ERC20Capped, ERC20Burnable, ERC20Pausable {
IShardGovernor private _shardGovernor;
enum ClaimWinner { None, Claimant, Counterclaimant }
bool private _shotgunDisabled;
constructor (
uint256 cap,
string memory name,
string memory symbol,
bool shotgunDisabled,
address shardGovernorAddress
) ERC20Detailed(name, symbol, 18) ERC20Capped(cap) public {
_shardGovernor = IShardGovernor(shardGovernorAddress);
_shotgunDisabled = shotgunDisabled;
}
/**
* @notice Called to initiate Shotgun claim. Requires Ether.
* @dev Transfers claimant's Shards into Governor contract's custody until
claim is resolved.
* @dev Forwards Ether to Shotgun contract through Governor contract.
*/
function lockShardsAndClaim() external payable {
require(
!_shotgunDisabled,
"[lockShardsAndClaim] Shotgun disabled"
);
require(
_shardGovernor.checkLock(),
"[lockShardsAndClaim] NFT not locked, Shotgun cannot be triggered"
);
require(
_shardGovernor.checkShotgunState(),
"[lockShardsAndClaim] Shotgun already in progress"
);
require(
msg.value > 0,
"[lockShardsAndClaim] Transaction must send ether to activate Shotgun Clause"
);
uint initialClaimantBalance = balanceOf(msg.sender);
require(
initialClaimantBalance > 0,
"[lockShardsAndClaim] Account does not own Shards"
);
require(
initialClaimantBalance < cap(),
"[lockShardsAndClaim] Account owns all Shards"
);
transfer(address(_shardGovernor), balanceOf(msg.sender));
(bool success) = _shardGovernor.claimInitialShotgun.value(msg.value)(
msg.sender, initialClaimantBalance
);
require(
success,
"[lockShards] Ether forwarding unsuccessful"
);
}
/**
* @notice Called to collect Ether from Shotgun proceeds. Burns Shard holdings.
* @dev can be called in both Shotgun outcome scenarios by:
- Initial claimant, if they lose the claim to counterclaimants and their
Shards are bought out
- Counterclaimants, bought out if initial claimant is successful.
* @dev initial claimant does not own Shards at this point because they have
been custodied in Governor contract at start of Shotgun.
* @param shotgunClause address of the relevant Shotgun contract.
*/
function burnAndCollectEther(address shotgunClause) external {
IShotgunClause _shotgunClause = IShotgunClause(shotgunClause);
bool enacted = _shotgunClause.shotgunEnacted();
if (!enacted) {
_shotgunClause.enactShotgun();
}
require(
enacted || _shotgunClause.shotgunEnacted(),
"[burnAndCollectEther] Shotgun Clause not enacted"
);
uint balance = balanceOf(msg.sender);
require(
balance > 0 || msg.sender == _shotgunClause.initialClaimantAddress(),
"[burnAndCollectEther] Account does not own Shards"
);
require(
uint(_shotgunClause.claimWinner()) == uint(ClaimWinner.Claimant) &&
msg.sender != _shotgunClause.initialClaimantAddress() ||
uint(_shotgunClause.claimWinner()) == uint(ClaimWinner.Counterclaimant) &&
msg.sender == _shotgunClause.initialClaimantAddress(),
"[burnAndCollectEther] Account does not have right to collect ether"
);
burn(balance);
_shotgunClause.collectEtherProceeds(balance, msg.sender);
}
function shotgunDisabled() external view returns (bool) {
return _shotgunDisabled;
}
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
cap 0x355274ea → uint256
decimals 0x313ce567 → uint8
isMinter 0xaa271e1a → bool
isPauser 0x46fbf68e → bool
name 0x06fdde03 → string
paused 0x5c975abb → bool
shotgunDisabled 0x841815ef → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
addMinter 0x983b2d56
address account
addPauser 0x82dc1ec4
address account
approve 0x095ea7b3
address spender
uint256 value
returns: bool
burn 0x42966c68
uint256 amount
burnAndCollectEther 0xe6b9e897
address shotgunClause
burnFrom 0x79cc6790
address account
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
lockShardsAndClaim 0xd54f9d09
No parameters
mint 0x40c10f19
address account
uint256 amount
returns: bool
pause 0x8456cb59
No parameters
renounceMinter 0x98650275
No parameters
renouncePauser 0x6ef8d66d
No parameters
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
unpause 0x3f4ba83a
No parameters
Recent Transactions
No transactions found for this address