Address Contract Verified
Address
0xBa3335588D9403515223F109EdC4eB7269a9Ab5D
Balance
0 ETH
Nonce
1
Code Size
15073 bytes
Creator
0xFFf3037B...614C at tx 0x48342552...28fa3a
Indexed Transactions
0
Contract Bytecode
15073 bytes
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c806370a08231116100f9578063b4b5ea5711610097578063dd62ed3e11610071578063dd62ed3e146104e6578063e7a324dc14610516578063f1127ed814610534578063f2fde38b14610565576101a9565b8063b4b5ea571461047e578063c3cda520146104ae578063d505accf146104ca576101a9565b806395d89b41116100d357806395d89b41146103f65780639742ca4614610414578063a9059cbb14610430578063b0660c3d14610460576101a9565b806370a0823114610366578063782d6fe1146103965780637ecebe00146103c6576101a9565b806330adf81f11610166578063481c6a7511610140578063481c6a75146102cc578063587cde1e146102ea5780635c19a95c1461031a5780636fcfff4514610336576101a9565b806330adf81f14610272578063313ce56714610290578063349dc329146102ae576101a9565b806306fdde03146101ae578063095ea7b3146101cc57806318160ddd146101fc57806320606b701461021a5780632185810b1461023857806323b872dd14610242575b600080fd5b6101b6610581565b6040516101c3919061351a565b60405180910390f35b6101e660048036038101906101e19190612d75565b6105ba565b6040516101f391906133b4565b60405180910390f35b61020461074c565b60405161021191906136bc565b60405180910390f35b61022261075c565b60405161022f91906133cf565b60405180910390f35b610240610780565b005b61025c60048036038101906102579190612c88565b610859565b60405161026991906133b4565b60405180910390f35b61027a610aeb565b60405161028791906133cf565b60405180910390f35b610298610b0f565b6040516102a5919061371b565b60405180910390f35b6102b6610b14565b6040516102c39190613399565b60405180910390f35b6102d4610b3a565b6040516102e19190613399565b60405180910390f35b61030460048036038101906102ff9190612c23565b610b60565b6040516103119190613399565b60405180910390f35b610334600480360381019061032f9190612c23565b610b93565b005b610350600480360381019061034b9190612c23565b610ba0565b60405161035d91906136d7565b60405180910390f35b610380600480360381019061037b9190612c23565b610bc3565b60405161038d91906136bc565b60405180910390f35b6103b060048036038101906103ab9190612d75565b610c32565b6040516103bd9190613751565b60405180910390f35b6103e060048036038101906103db9190612c23565b61103b565b6040516103ed91906136bc565b60405180910390f35b6103fe611053565b60405161040b919061351a565b60405180910390f35b61042e60048036038101906104299190612c23565b61108c565b005b61044a60048036038101906104459190612d75565b611235565b60405161045791906133b4565b60405180910390f35b610468611272565b60405161047591906133b4565b60405180910390f35b61049860048036038101906104939190612c23565b611285565b6040516104a59190613751565b60405180910390f35b6104c860048036038101906104c39190612db1565b611373565b005b6104e460048036038101906104df9190612cd7565b611630565b005b61050060048036038101906104fb9190612c4c565b611a9b565b60405161050d91906136bc565b60405180910390f35b61051e611b47565b60405161052b91906133cf565b60405180910390f35b61054e60048036038101906105499190612e3a565b611b6b565b60405161055c9291906136f2565b60405180910390f35b61057f600480360381019061057a9190612c23565b611bc4565b005b6040518060400160405280600781526020017f47656172626f780000000000000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83141561060d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9050610632565b61062f8360405180606001604052806025815260200161391760259139611d84565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107399190613736565b60405180910390a3600191505092915050565b6b204fce5e3e2502611000000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610810576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108079061363c565b60405180910390fd5b6001600660006101000a81548160ff0219169083151502179055507f795b0e16c8da9807b0a215f3749bd6dbcc49fc0472183f4e446abb7dcbd9d00760405160405180910390a1565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff169050600061091b8560405180606001604052806025815260200161391760259139611d84565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561099557507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b15610ad25760006109bf83836040518060600160405280603d8152602001613a39603d9139611de2565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610ac89190613736565b60405180910390a3505b610add878783611e53565b600193505050509392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b9d3382612333565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b6000438210610c76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6d9061367c565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610ce3576000915050611035565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610de557600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050611035565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610e66576000915050611035565b6000806001830390505b8163ffffffff168163ffffffff161115610fb7576000600283830363ffffffff1681610e9857fe5b04820390506000600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610f8f57806020015195505050505050611035565b86816000015163ffffffff161015610fa957819350610fb0565b6001820392505b5050610e70565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f474541520000000000000000000000000000000000000000000000000000000081525081565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461111c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111139061363c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561118c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111839061353c565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f2f834d1c8c4b956018fff5faca4d99868ae635487424d9c265c257ccbc698c6a60405160405180910390a250565b60008061125a8360405180606001604052806026815260200161396c60269139611d84565b9050611267338583611e53565b600191505092915050565b600660009054906101000a900460ff1681565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff16116112ef57600061136b565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280600781526020017f47656172626f7800000000000000000000000000000000000000000000000000815250805190602001206113db6124f3565b306040516020016113ef9493929190613490565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001611440949392919061344b565b6040516020818303038152906040528051906020012090506000828260405160200161146d929190613362565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516114aa94939291906134d5565b6020604051602081039080840390855afa1580156114cc573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153f906135dc565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505589146115d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ce9061361c565b60405180910390fd5b8742111561161a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116119061365c565b60405180910390fd5b611624818b612333565b50505050505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff861415611682577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506116a7565b6116a4866040518060600160405280602481526020016139e160249139611d84565b90505b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280600781526020017f47656172626f78000000000000000000000000000000000000000000000000008152508051906020012061170f6124f3565b306040516020016117239493929190613490565b60405160208183030381529060405280519060200120905060007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98a8a8a600560008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558b6040516020016117c5969594939291906133ea565b604051602081830303815290604052805190602001209050600082826040516020016117f2929190613362565b60405160208183030381529060405280519060200120905060006001828989896040516000815260200160405260405161182f94939291906134d5565b6020604051602081039080840390855afa158015611851573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c49061369c565b60405180910390fd5b8b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461193b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119329061355c565b60405180910390fd5b8842111561197e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611975906135bc565b60405180910390fd5b846000808e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92587604051611a859190613736565b60405180910390a3505050505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4b9061363c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611cc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cbb9061353c565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006c0100000000000000000000000083108290611dd8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcf919061351a565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff1611158290611e46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3d919061351a565b60405180910390fd5b5082840390509392505050565b600660009054906101000a900460ff1680611ebb5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611f135750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611f52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f49906135fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611fc2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb99061357c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612032576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120299061359c565b60405180910390fd5b6120ac600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001613a7660369139611de2565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550612193600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff168260405180606001604052806030815260200161393c60309139612500565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161225d9190613736565b60405180910390a361232e600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683612576565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46124ed828483612576565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff161015839061256a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612561919061351a565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156125c057506000816bffffffffffffffffffffffff16115b1561286c57600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612718576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116126635760006126df565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000612706828560405180606001604052806028815260200161399260289139611de2565b905061271486848484612871565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461286b576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116127b6576000612832565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b9050600061285982856040518060600160405280602781526020016139ba60279139612500565b905061286785848484612871565b5050505b5b505050565b600061289543604051806060016040528060348152602001613a0560349139612b64565b905060008463ffffffff1611801561292a57508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b156129c55781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550612b0d565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051612b5592919061376c565b60405180910390a25050505050565b600064010000000083108290612bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ba7919061351a565b60405180910390fd5b5082905092915050565b600081359050612bc9816138a3565b92915050565b600081359050612bde816138ba565b92915050565b600081359050612bf3816138d1565b92915050565b600081359050612c08816138e8565b92915050565b600081359050612c1d816138ff565b92915050565b600060208284031215612c3557600080fd5b6000612c4384828501612bba565b91505092915050565b60008060408385031215612c5f57600080fd5b6000612c6d85828601612bba565b9250506020612c7e85828601612bba565b9150509250929050565b600080600060608486031215612c9d57600080fd5b6000612cab86828701612bba565b9350506020612cbc86828701612bba565b9250506040612ccd86828701612be4565b9150509250925092565b600080600080600080600060e0888a031215612cf257600080fd5b6000612d008a828b01612bba565b9750506020612d118a828b01612bba565b9650506040612d228a828b01612be4565b9550506060612d338a828b01612be4565b9450506080612d448a828b01612c0e565b93505060a0612d558a828b01612bcf565b92505060c0612d668a828b01612bcf565b91505092959891949750929550565b60008060408385031215612d8857600080fd5b6000612d9685828601612bba565b9250506020612da785828601612be4565b9150509250929050565b60008060008060008060c08789031215612dca57600080fd5b6000612dd889828a01612bba565b9650506020612de989828a01612be4565b9550506040612dfa89828a01612be4565b9450506060612e0b89828a01612c0e565b9350506080612e1c89828a01612bcf565b92505060a0612e2d89828a01612bcf565b9150509295509295509295565b60008060408385031215612e4d57600080fd5b6000612e5b85828601612bba565b9250506020612e6c85828601612bf9565b9150509250929050565b612e7f816137bc565b82525050565b612e8e816137ce565b82525050565b612e9d816137da565b82525050565b612eb4612eaf826137da565b613888565b82525050565b6000612ec582613795565b612ecf81856137a0565b9350612edf818560208601613855565b612ee881613892565b840191505092915050565b6000612f00601b836137a0565b91507f5a65726f2061646472657373206973206e6f7420616c6c6f77656400000000006000830152602082019050919050565b6000612f406002836137b1565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000612f80601a836137a0565b91507f476561723a3a7065726d69743a20756e617574686f72697a65640000000000006000830152602082019050919050565b6000612fc0603c836137a0565b91507f476561723a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6000613026603a836137a0565b91507f476561723a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b600061308c601f836137a0565b91507f476561723a3a7065726d69743a207369676e61747572652065787069726564006000830152602082019050919050565b60006130cc6026836137a0565b91507f476561723a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000613132601d836137a0565b91507f476561723a3a7472616e73666572732061726520666f7262696464656e0000006000830152602082019050919050565b60006131726022836137a0565b91507f476561723a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006131d8601f836137a0565b91507f476561723a3a63616c6c6572206973206e6f7420746865206d616e61676572006000830152602082019050919050565b60006132186026836137a0565b91507f476561723a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061327e6027836137a0565b91507f476561723a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006132e4601f836137a0565b91507f476561723a3a7065726d69743a20696e76616c6964207369676e6174757265006000830152602082019050919050565b61332081613804565b82525050565b61332f8161380e565b82525050565b61333e8161381e565b82525050565b61334d81613843565b82525050565b61335c8161382b565b82525050565b600061336d82612f33565b91506133798285612ea3565b6020820191506133898284612ea3565b6020820191508190509392505050565b60006020820190506133ae6000830184612e76565b92915050565b60006020820190506133c96000830184612e85565b92915050565b60006020820190506133e46000830184612e94565b92915050565b600060c0820190506133ff6000830189612e94565b61340c6020830188612e76565b6134196040830187612e76565b6134266060830186613317565b6134336080830185613317565b61344060a0830184613317565b979650505050505050565b60006080820190506134606000830187612e94565b61346d6020830186612e76565b61347a6040830185613317565b6134876060830184613317565b95945050505050565b60006080820190506134a56000830187612e94565b6134b26020830186612e94565b6134bf6040830185613317565b6134cc6060830184612e76565b95945050505050565b60006080820190506134ea6000830187612e94565b6134f76020830186613335565b6135046040830185612e94565b6135116060830184612e94565b95945050505050565b600060208201905081810360008301526135348184612eba565b905092915050565b6000602082019050818103600083015261355581612ef3565b9050919050565b6000602082019050818103600083015261357581612f73565b9050919050565b6000602082019050818103600083015261359581612fb3565b9050919050565b600060208201905081810360008301526135b581613019565b9050919050565b600060208201905081810360008301526135d58161307f565b9050919050565b600060208201905081810360008301526135f5816130bf565b9050919050565b6000602082019050818103600083015261361581613125565b9050919050565b6000602082019050818103600083015261363581613165565b9050919050565b60006020820190508181036000830152613655816131cb565b9050919050565b600060208201905081810360008301526136758161320b565b9050919050565b6000602082019050818103600083015261369581613271565b9050919050565b600060208201905081810360008301526136b5816132d7565b9050919050565b60006020820190506136d16000830184613317565b92915050565b60006020820190506136ec6000830184613326565b92915050565b60006040820190506137076000830185613326565b6137146020830184613353565b9392505050565b60006020820190506137306000830184613335565b92915050565b600060208201905061374b6000830184613344565b92915050565b60006020820190506137666000830184613353565b92915050565b60006040820190506137816000830185613344565b61378e6020830184613344565b9392505050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b60006137c7826137e4565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b600061384e8261382b565b9050919050565b60005b83811015613873578082015181840152602081019050613858565b83811115613882576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b6138ac816137bc565b81146138b757600080fd5b50565b6138c3816137da565b81146138ce57600080fd5b50565b6138da81613804565b81146138e557600080fd5b50565b6138f18161380e565b81146138fc57600080fd5b50565b6139088161381e565b811461391357600080fd5b5056fe476561723a3a617070726f76653a20616d6f756e7420657863656564732039362062697473476561723a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773476561723a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473476561723a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773476561723a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773476561723a3a7065726d69743a20616d6f756e7420657863656564732039362062697473476561723a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473476561723a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365476561723a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365a264697066735822122066944b0101ba9d8a9ac9240d19332b4c10fb16385853ea1a2422d236556c92ac64736f6c63430007060033
Verified Source Code Full Match
Compiler: v0.7.6+commit.7338295f
EVM: istanbul
Optimization: No
GearToken.sol 559 lines
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.7.4;
pragma experimental ABIEncoderV2;
import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol";
/// @dev Governance Gearbox token
/// based on https://github.com/Uniswap/governance/blob/master/contracts/Uni.sol
contract GearToken {
/// @notice EIP-20 token name for this token
string public constant name = "Gearbox";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "GEAR";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint256 public constant totalSupply = 10_000_000_000e18; // 10 billion Gear
// Allowance amounts on behalf of others
mapping(address => mapping(address => uint96)) internal allowances;
// Official record of token balances for each account
mapping(address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping(address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping(address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH =
keccak256(
"EIP712Domain(string name,uint256 chainId,address verifyingContract)"
);
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH =
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice The EIP-712 typehash for the permit struct used by the contract
bytes32 public constant PERMIT_TYPEHASH =
keccak256(
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
);
// A record of states for signing / validating signatures
mapping(address => uint256) public nonces;
/// @notice Flag which allows token transfers
bool public transfersAllowed;
/// @notice Contract owner which can allow token transfers
address public manager;
/// @notice Miner address which can send tokens during account mining
address public miner;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(
address indexed delegator,
address indexed fromDelegate,
address indexed toDelegate
);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(
address indexed delegate,
uint256 previousBalance,
uint256 newBalance
);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(
address indexed owner,
address indexed spender,
uint256 amount
);
event OwnershipTransferred(address indexed owner, address indexed newOwner);
event MinerSet(address indexed miner);
event TransferAllowed();
modifier managerOnly() {
require(msg.sender == manager, "Gear::caller is not the manager");
_;
}
/**
* @notice Construct a new Gear token
* @param account The initial account to grant all the tokens
*/
constructor(address account) {
require(account != address(0), "Zero address is not allowed");
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
manager = msg.sender;
transfersAllowed = false;
}
function transferOwnership(address newManager)
external
managerOnly // T:[GT-3]
{
require(newManager != address(0), "Zero address is not allowed"); // T:[GT-5]
emit OwnershipTransferred(manager, newManager); // T:[GT-6]
manager = newManager; // T:[GT-6]
}
function setMiner(address _miner)
external
managerOnly // T:[GT-3]
{
require(_miner != address(0), "Zero address is not allowed");
miner = _miner; // T:[GT-4]
emit MinerSet(miner); // T:[GT-4]
}
function allowTransfers()
external
managerOnly // T:[GT-3]
{
transfersAllowed = true; // T:[GT-1]
emit TransferAllowed();
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender)
external
view
returns (uint256)
{
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint256 rawAmount)
external
returns (bool)
{
uint96 amount;
if (rawAmount == uint256(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Gear::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Triggers an approval from owner to spends
* @param owner The address to approve from
* @param spender The address to be approved
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @param deadline The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function permit(
address owner,
address spender,
uint256 rawAmount,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
uint96 amount;
if (rawAmount == uint256(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Gear::permit: amount exceeds 96 bits");
}
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name)),
getChainId(),
address(this)
)
);
bytes32 structHash = keccak256(
abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
rawAmount,
nonces[owner]++,
deadline
)
);
bytes32 digest = keccak256(
abi.encodePacked("\x19\x01", domainSeparator, structHash)
);
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Gear::permit: invalid signature");
require(signatory == owner, "Gear::permit: unauthorized");
require(block.timestamp <= deadline, "Gear::permit: signature expired");
allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint256) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint256 rawAmount) external returns (bool) {
uint96 amount = safe96(
rawAmount,
"Gear::transfer: amount exceeds 96 bits"
);
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(
address src,
address dst,
uint256 rawAmount
) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(
rawAmount,
"Gear::approve: amount exceeds 96 bits"
);
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(
spenderAllowance,
amount,
"Gear::transferFrom: transfer amount exceeds spender allowance"
);
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) external {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) external {
bytes32 domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes(name)),
getChainId(),
address(this)
)
);
bytes32 structHash = keccak256(
abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)
);
bytes32 digest = keccak256(
abi.encodePacked("\x19\x01", domainSeparator, structHash)
);
address signatory = ecrecover(digest, v, r, s);
require(
signatory != address(0),
"Gear::delegateBySig: invalid signature"
);
require(
nonce == nonces[signatory]++,
"Gear::delegateBySig: invalid nonce"
);
require(
block.timestamp <= expiry,
"Gear::delegateBySig: signature expired"
);
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return
nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint256 blockNumber)
external
view
returns (uint96)
{
require(
blockNumber < block.number,
"Gear::getPriorVotes: not yet determined"
);
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(
address src,
address dst,
uint96 amount
) internal {
require(
transfersAllowed || msg.sender == manager || msg.sender == miner,
"Gear::transfers are forbidden"
);
require(
src != address(0),
"Gear::_transferTokens: cannot transfer from the zero address"
);
require(
dst != address(0),
"Gear::_transferTokens: cannot transfer to the zero address"
);
balances[src] = sub96(
balances[src],
amount,
"Gear::_transferTokens: transfer amount exceeds balance"
);
balances[dst] = add96(
balances[dst],
amount,
"Gear::_transferTokens: transfer amount overflows"
);
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(
address srcRep,
address dstRep,
uint96 amount
) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0
? checkpoints[srcRep][srcRepNum - 1].votes
: 0;
uint96 srcRepNew = sub96(
srcRepOld,
amount,
"Gear::_moveVotes: vote amount underflows"
);
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0
? checkpoints[dstRep][dstRepNum - 1].votes
: 0;
uint96 dstRepNew = add96(
dstRepOld,
amount,
"Gear::_moveVotes: vote amount overflows"
);
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(
address delegatee,
uint32 nCheckpoints,
uint96 oldVotes,
uint96 newVotes
) internal {
uint32 blockNumber = safe32(
block.number,
"Gear::_writeCheckpoint: block number exceeds 32 bits"
);
if (
nCheckpoints > 0 &&
checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber
) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(
blockNumber,
newVotes
);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint256 n, string memory errorMessage)
internal
pure
returns (uint32)
{
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint256 n, string memory errorMessage)
internal
pure
returns (uint96)
{
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(
uint96 a,
uint96 b,
string memory errorMessage
) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(
uint96 a,
uint96 b,
string memory errorMessage
) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint256) {
uint256 chainId;
assembly {
chainId := chainid()
}
return chainId;
}
}
SafeMath.sol 214 lines
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.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, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b > a) return (false, 0);
return (true, a - b);
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a / b);
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
if (b == 0) return (false, 0);
return (true, a % b);
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
return a - b;
}
/**
* @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) {
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, reverting 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) {
require(b > 0, "SafeMath: division by zero");
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: modulo by zero");
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
return a - b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryDiv}.
*
* 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, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* 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, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
return a % b;
}
}
Read Contract
DELEGATION_TYPEHASH 0xe7a324dc → bytes32
DOMAIN_TYPEHASH 0x20606b70 → bytes32
PERMIT_TYPEHASH 0x30adf81f → bytes32
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
checkpoints 0xf1127ed8 → uint32, uint96
decimals 0x313ce567 → uint8
delegates 0x587cde1e → address
getCurrentVotes 0xb4b5ea57 → uint96
getPriorVotes 0x782d6fe1 → uint96
manager 0x481c6a75 → address
miner 0x349dc329 → address
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
numCheckpoints 0x6fcfff45 → uint32
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256
transfersAllowed 0xb0660c3d → bool
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
allowTransfers 0x2185810b
No parameters
approve 0x095ea7b3
address spender
uint256 rawAmount
returns: bool
delegate 0x5c19a95c
address delegatee
delegateBySig 0xc3cda520
address delegatee
uint256 nonce
uint256 expiry
uint8 v
bytes32 r
bytes32 s
permit 0xd505accf
address owner
address spender
uint256 rawAmount
uint256 deadline
uint8 v
bytes32 r
bytes32 s
setMiner 0x9742ca46
address _miner
transfer 0xa9059cbb
address dst
uint256 rawAmount
returns: bool
transferFrom 0x23b872dd
address src
address dst
uint256 rawAmount
returns: bool
transferOwnership 0xf2fde38b
address newManager
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address