Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x0cEC1A9154Ff802e7934Fc916Ed7Ca50bDE6844e
Balance 0 ETH
Nonce 1
Code Size 10104 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

10104 bytes
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80636fcfff45116100f9578063b4b5ea5711610097578063dd62ed3e11610071578063dd62ed3e1461035b578063e7a324dc1461036e578063f1127ed814610376578063fca3b5aa14610397576101a9565b8063b4b5ea5714610322578063c3cda52014610335578063d505accf14610348576101a9565b8063782d6fe1116100d3578063782d6fe1146102d45780637ecebe00146102f457806395d89b4114610307578063a9059cbb1461030f576101a9565b80636fcfff45146102a657806370a08231146102b957806376c71ca1146102cc576101a9565b806330adf81f1161016657806340c10f191161014057806340c10f1914610256578063587cde1e1461026b5780635c11d62f1461027e5780635c19a95c14610293576101a9565b806330adf81f1461023157806330b36cef14610239578063313ce56714610241576101a9565b806306fdde03146101ae57806307546172146101cc578063095ea7b3146101e157806318160ddd1461020157806320606b701461021657806323b872dd1461021e575b600080fd5b6101b66103aa565b6040516101c391906122f7565b60405180910390f35b6101d46103d2565b6040516101c391906121ca565b6101f46101ef366004611a2b565b6103e1565b6040516101c391906121f3565b6102096104a0565b6040516101c39190612201565b6102096104a6565b6101f461022c366004611942565b6104bd565b610209610606565b610209610612565b610249610618565b6040516101c39190612431565b610269610264366004611a2b565b61061d565b005b6101d46102793660046118e2565b610838565b610286610853565b6040516101c39190612408565b6102696102a13660046118e2565b61085b565b6102866102b43660046118e2565b610868565b6102096102c73660046118e2565b610880565b6102496108a4565b6102e76102e2366004611a2b565b6108a9565b6040516101c3919061244d565b6102096103023660046118e2565b610ab7565b6101b6610ac9565b6101f461031d366004611a2b565b610ae9565b6102e76103303660046118e2565b610b25565b610269610343366004611a5b565b610b95565b61026961035636600461198f565b610d83565b610209610369366004611908565b611073565b6102096110a7565b610389610384366004611ae2565b6110b3565b6040516101c3929190612416565b6102696103a53660046118e2565b6110e8565b6040518060400160405280600c81526020016b2837b7b62a37b3b2ba3432b960a11b81525081565b6001546001600160a01b031681565b6000806000198314156103f7575060001961041c565b610419836040518060600160405280602581526020016125336025913961117b565b90505b3360008181526003602090815260408083206001600160a01b03891680855292529182902080546001600160601b0319166001600160601b03861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061048c90859061243f565b60405180910390a360019150505b92915050565b60005481565b6040516104b2906121b4565b604051809103902081565b6001600160a01b03831660009081526003602090815260408083203380855290835281842054825160608101909352602580845291936001600160601b0390911692859261051592889291906125339083013961117b565b9050866001600160a01b0316836001600160a01b03161415801561054257506001600160601b0382811614155b156105ec57600061056c83836040518060600160405280603d81526020016125e5603d91396111aa565b6001600160a01b038981166000818152600360209081526040808320948a16808452949091529081902080546001600160601b0319166001600160601b0386161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906105e290859061243f565b60405180910390a3505b6105f78787836111e9565b600193505050505b9392505050565b6040516104b2906121a9565b60025481565b601281565b6001546001600160a01b031633146106505760405162461bcd60e51b815260040161064790612388565b60405180910390fd5b6002544210156106725760405162461bcd60e51b815260040161064790612338565b6001600160a01b0382166106985760405162461bcd60e51b815260040161064790612378565b6106a6426301e1338061138f565b60028190555060006106d0826040518060600160405280602281526020016126c56022913961117b565b90506106ec6106e5600054600260ff166113b4565b60646113ee565b816001600160601b031611156107145760405162461bcd60e51b815260040161064790612398565b61074a61072c600054836001600160601b031661138f565b60405180606001604052806027815260200161270f6027913961117b565b6001600160601b0390811660009081556001600160a01b03851681526004602090815260409182902054825160608101909352602580845261079c949190911692859290919061264890830139611430565b6001600160a01b03841660008181526004602052604080822080546001600160601b0319166001600160601b03959095169490941790935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061080690859061243f565b60405180910390a36001600160a01b0380841660009081526005602052604081205461083392168361146c565b505050565b6005602052600090815260409020546001600160a01b031681565b6301e1338081565b61086533826115fe565b50565b60076020526000908152604090205463ffffffff1681565b6001600160a01b03166000908152600460205260409020546001600160601b031690565b600281565b60004382106108ca5760405162461bcd60e51b8152600401610647906123b8565b6001600160a01b03831660009081526007602052604090205463ffffffff16806108f857600091505061049a565b6001600160a01b038416600090815260066020908152604080832063ffffffff600019860181168552925290912054168310610974576001600160a01b03841660009081526006602090815260408083206000199490940163ffffffff1683529290522054600160201b90046001600160601b0316905061049a565b6001600160a01b038416600090815260066020908152604080832083805290915290205463ffffffff168310156109af57600091505061049a565b600060001982015b8163ffffffff168163ffffffff161115610a7257600282820363ffffffff160481036109e161189f565b506001600160a01b038716600090815260066020908152604080832063ffffffff858116855290835292819020815180830190925254928316808252600160201b9093046001600160601b03169181019190915290871415610a4d5760200151945061049a9350505050565b805163ffffffff16871115610a6457819350610a6b565b6001820392505b50506109b7565b506001600160a01b038516600090815260066020908152604080832063ffffffff909416835292905220546001600160601b03600160201b9091041691505092915050565b60086020526000908152604090205481565b604051806040016040528060048152602001631413d3d360e21b81525081565b600080610b0e836040518060600160405280602681526020016126226026913961117b565b9050610b1b3385836111e9565b5060019392505050565b6001600160a01b03811660009081526007602052604081205463ffffffff1680610b505760006105ff565b6001600160a01b0383166000908152600660209081526040808320600019850163ffffffff168452909152902054600160201b90046001600160601b03169392505050565b6000604051610ba3906121b4565b60408051918290038220828201909152600c82526b2837b7b62a37b3b2ba3432b960a11b6020909201919091527f856debe1b05b03d324190d1efb77fc9169c8c5b356fcf8aa8619d54677664ae1610bf9611688565b30604051602001610c0d94939291906122a7565b6040516020818303038152906040528051906020012090506000604051610c33906121bf565b604051908190038120610c4e918a908a908a90602001612269565b60405160208183030381529060405280519060200120905060008282604051602001610c7b929190612178565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610cb894939291906122dc565b6020604051602081039080840390855afa158015610cda573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610d0d5760405162461bcd60e51b815260040161064790612308565b6001600160a01b03811660009081526008602052604090208054600181019091558914610d4c5760405162461bcd60e51b8152600401610647906123e8565b87421115610d6c5760405162461bcd60e51b815260040161064790612348565b610d76818b6115fe565b505050505b505050505050565b6000600019861415610d985750600019610dbd565b610dba866040518060600160405280602481526020016126a16024913961117b565b90505b6000604051610dcb906121b4565b60408051918290038220828201909152600c82526b2837b7b62a37b3b2ba3432b960a11b6020909201919091527f856debe1b05b03d324190d1efb77fc9169c8c5b356fcf8aa8619d54677664ae1610e21611688565b30604051602001610e3594939291906122a7565b6040516020818303038152906040528051906020012090506000604051610e5b906121a9565b604080519182900382206001600160a01b038d16600090815260086020908152929020805460018101909155610e9d9391928e928e928e9290918e910161220f565b60405160208183030381529060405280519060200120905060008282604051602001610eca929190612178565b604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051610f0794939291906122dc565b6020604051602081039080840390855afa158015610f29573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116610f5c5760405162461bcd60e51b815260040161064790612368565b8b6001600160a01b0316816001600160a01b031614610f8d5760405162461bcd60e51b8152600401610647906123d8565b88421115610fad5760405162461bcd60e51b815260040161064790612318565b84600360008e6001600160a01b03166001600160a01b0316815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a8154816001600160601b0302191690836001600160601b031602179055508a6001600160a01b03168c6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258760405161105d919061243f565b60405180910390a3505050505050505050505050565b6001600160a01b0391821660009081526003602090815260408083209390941682529190915220546001600160601b031690565b6040516104b2906121bf565b600660209081526000928352604080842090915290825290205463ffffffff811690600160201b90046001600160601b031682565b6001546001600160a01b031633146111125760405162461bcd60e51b8152600401610647906123f8565b6001546040517f3b0007eb941cf645526cbb3a4fdaecda9d28ce4843167d9263b536a1f1edc0f691611151916001600160a01b039091169084906121d8565b60405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b600081600160601b84106111a25760405162461bcd60e51b815260040161064791906122f7565b509192915050565b6000836001600160601b0316836001600160601b0316111582906111e15760405162461bcd60e51b815260040161064791906122f7565b505050900390565b6001600160a01b03831661120f5760405162461bcd60e51b8152600401610647906123a8565b6001600160a01b0382166112355760405162461bcd60e51b815260040161064790612328565b6001600160a01b038316600090815260046020908152604091829020548251606081019093526036808452611280936001600160601b0390921692859291906125af908301396111aa565b6001600160a01b03848116600090815260046020908152604080832080546001600160601b0319166001600160601b039687161790559286168252908290205482516060810190935260308084526112e8949190911692859290919061257f90830139611430565b6001600160a01b038381166000818152600460205260409081902080546001600160601b0319166001600160601b0395909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061135590859061243f565b60405180910390a36001600160a01b038084166000908152600560205260408082205485841683529120546108339291821691168361146c565b6000828201838110156105ff5760405162461bcd60e51b815260040161064790612358565b6000826113c35750600061049a565b828202828482816113d057fe5b04146105ff5760405162461bcd60e51b8152600401610647906123c8565b60006105ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061168c565b6000838301826001600160601b0380871690831610156114635760405162461bcd60e51b815260040161064791906122f7565b50949350505050565b816001600160a01b0316836001600160a01b03161415801561149757506000816001600160601b0316115b15610833576001600160a01b0383161561154f576001600160a01b03831660009081526007602052604081205463ffffffff1690816114d7576000611516565b6001600160a01b0385166000908152600660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b9050600061153d82856040518060600160405280602881526020016126e7602891396111aa565b905061154b868484846116c3565b5050505b6001600160a01b03821615610833576001600160a01b03821660009081526007602052604081205463ffffffff16908161158a5760006115c9565b6001600160a01b0384166000908152600660209081526040808320600019860163ffffffff168452909152902054600160201b90046001600160601b03165b905060006115f0828560405180606001604052806027815260200161255860279139611430565b9050610d7b858484846116c3565b6001600160a01b03808316600081815260056020818152604080842080546004845282862054949093528787166001600160a01b031984168117909155905191909516946001600160601b039092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461168282848361146c565b50505050565b4690565b600081836116ad5760405162461bcd60e51b815260040161064791906122f7565b5060008385816116b957fe5b0495945050505050565b60006116e74360405180606001604052806034815260200161266d60349139611878565b905060008463ffffffff1611801561173057506001600160a01b038516600090815260066020908152604080832063ffffffff6000198901811685529252909120548282169116145b1561178f576001600160a01b0385166000908152600660209081526040808320600019880163ffffffff168452909152902080546fffffffffffffffffffffffff000000001916600160201b6001600160601b0385160217905561182e565b60408051808201825263ffffffff80841682526001600160601b0380861660208085019182526001600160a01b038b166000818152600683528781208c871682528352878120965187549451909516600160201b026fffffffffffffffffffffffff000000001995871663ffffffff19958616179590951694909417909555938252600790935292909220805460018801909316929091169190911790555b846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724848460405161186992919061245b565b60405180910390a25050505050565b600081600160201b84106111a25760405162461bcd60e51b815260040161064791906122f7565b604080518082019091526000808252602082015290565b803561049a81612503565b803561049a81612517565b803561049a81612520565b803561049a81612529565b6000602082840312156118f457600080fd5b600061190084846118b6565b949350505050565b6000806040838503121561191b57600080fd5b600061192785856118b6565b9250506020611938858286016118b6565b9150509250929050565b60008060006060848603121561195757600080fd5b600061196386866118b6565b9350506020611974868287016118b6565b9250506040611985868287016118c1565b9150509250925092565b600080600080600080600060e0888a0312156119aa57600080fd5b60006119b68a8a6118b6565b97505060206119c78a828b016118b6565b96505060406119d88a828b016118c1565b95505060606119e98a828b016118c1565b94505060806119fa8a828b016118d7565b93505060a0611a0b8a828b016118c1565b92505060c0611a1c8a828b016118c1565b91505092959891949750929550565b60008060408385031215611a3e57600080fd5b6000611a4a85856118b6565b9250506020611938858286016118c1565b60008060008060008060c08789031215611a7457600080fd5b6000611a8089896118b6565b9650506020611a9189828a016118c1565b9550506040611aa289828a016118c1565b9450506060611ab389828a016118d7565b9350506080611ac489828a016118c1565b92505060a0611ad589828a016118c1565b9150509295509295509295565b60008060408385031215611af557600080fd5b6000611b0185856118b6565b9250506020611938858286016118cc565b611b1b81612488565b82525050565b611b1b81612493565b611b1b81612498565b611b1b611b3f82612498565b612498565b6000611b4f82612476565b611b59818561247a565b9350611b698185602086016124cd565b611b72816124f9565b9093019392505050565b6000611b8960268361247a565b7f506f6f6c3a3a64656c656761746542795369673a20696e76616c6964207369678152656e617475726560d01b602082015260400192915050565b6000611bd1601f8361247a565b7f506f6f6c3a3a7065726d69743a207369676e6174757265206578706972656400815260200192915050565b6000611c0a603a8361247a565b7f506f6f6c3a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e7366657220746f20746865207a65726f2061646472657373000000000000602082015260400192915050565b6000611c6960238361247a565b7f506f6f6c3a3a6d696e743a206d696e74696e67206e6f7420616c6c6f776564208152621e595d60ea1b602082015260400192915050565b6000611cae60268361247a565b7f506f6f6c3a3a64656c656761746542795369673a207369676e617475726520658152651e1c1a5c995960d21b602082015260400192915050565b6000611cf6600283612483565b61190160f01b815260020192915050565b6000611d14601b8361247a565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000611d4d601f8361247a565b7f506f6f6c3a3a7065726d69743a20696e76616c6964207369676e617475726500815260200192915050565b6000611d86602f8361247a565b7f506f6f6c3a3a6d696e743a2063616e6e6f74207472616e7366657220746f207481526e6865207a65726f206164647265737360881b602082015260400192915050565b6000611dd760248361247a565b7f506f6f6c3a3a6d696e743a206f6e6c7920746865206d696e7465722063616e208152631b5a5b9d60e21b602082015260400192915050565b6000611e1d601d8361247a565b7f506f6f6c3a3a6d696e743a206578636565646564206d696e7420636170000000815260200192915050565b6000611e56605283612483565b7f5065726d69742861646472657373206f776e65722c616464726573732073706581527f6e6465722c75696e743235362076616c75652c75696e74323536206e6f6e63656020820152712c75696e7432353620646561646c696e652960701b604082015260520192915050565b6000611ed0603c8361247a565b7f506f6f6c3a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747281527f616e736665722066726f6d20746865207a65726f206164647265737300000000602082015260400192915050565b6000611f2f60278361247a565b7f506f6f6c3a3a6765745072696f72566f7465733a206e6f742079657420646574815266195c9b5a5b995960ca1b602082015260400192915050565b6000611f78604383612483565b7f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353681527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208201526263742960e81b604082015260430192915050565b6000611fe360218361247a565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000612026601a8361247a565b7f506f6f6c3a3a7065726d69743a20756e617574686f72697a6564000000000000815260200192915050565b600061205f60228361247a565b7f506f6f6c3a3a64656c656761746542795369673a20696e76616c6964206e6f6e815261636560f01b602082015260400192915050565b60006120a3603a83612483565b7f44656c65676174696f6e28616464726573732064656c6567617465652c75696e81527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020820152603a0192915050565b6000612102603e8361247a565b7f506f6f6c3a3a7365744d696e7465723a206f6e6c7920746865206d696e74657281527f2063616e206368616e676520746865206d696e74657220616464726573730000602082015260400192915050565b611b1b816124a7565b611b1b816124b0565b611b1b816124c2565b611b1b816124b6565b600061218382611ce9565b915061218f8285611b33565b60208201915061219f8284611b33565b5060200192915050565b600061049a82611e49565b600061049a82611f6b565b600061049a82612096565b6020810161049a8284611b12565b604081016121e68285611b12565b6105ff6020830184611b12565b6020810161049a8284611b21565b6020810161049a8284611b2a565b60c0810161221d8289611b2a565b61222a6020830188611b12565b6122376040830187611b12565b6122446060830186611b2a565b6122516080830185611b2a565b61225e60a0830184611b2a565b979650505050505050565b608081016122778287611b2a565b6122846020830186611b12565b6122916040830185611b2a565b61229e6060830184611b2a565b95945050505050565b608081016122b58287611b2a565b6122c26020830186611b2a565b6122cf6040830185611b2a565b61229e6060830184611b12565b608081016122ea8287611b2a565b612284602083018661215d565b602080825281016105ff8184611b44565b6020808252810161049a81611b7c565b6020808252810161049a81611bc4565b6020808252810161049a81611bfd565b6020808252810161049a81611c5c565b6020808252810161049a81611ca1565b6020808252810161049a81611d07565b6020808252810161049a81611d40565b6020808252810161049a81611d79565b6020808252810161049a81611dca565b6020808252810161049a81611e10565b6020808252810161049a81611ec3565b6020808252810161049a81611f22565b6020808252810161049a81611fd6565b6020808252810161049a81612019565b6020808252810161049a81612052565b6020808252810161049a816120f5565b6020810161049a8284612154565b604081016124248285612154565b6105ff602083018461216f565b6020810161049a828461215d565b6020810161049a8284612166565b6020810161049a828461216f565b604081016124698285612166565b6105ff6020830184612166565b5190565b90815260200190565b919050565b600061049a8261249b565b151590565b90565b6001600160a01b031690565b63ffffffff1690565b60ff1690565b6001600160601b031690565b600061049a826124b6565b60005b838110156124e85781810151838201526020016124d0565b838111156116825750506000910152565b601f01601f191690565b61250c81612488565b811461086557600080fd5b61250c81612498565b61250c816124a7565b61250c816124b056fe506f6f6c3a3a617070726f76653a20616d6f756e7420657863656564732039362062697473506f6f6c3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773506f6f6c3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773506f6f6c3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365506f6f6c3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365506f6f6c3a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473506f6f6c3a3a6d696e743a207472616e7366657220616d6f756e74206f766572666c6f7773506f6f6c3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473506f6f6c3a3a7065726d69743a20616d6f756e7420657863656564732039362062697473506f6f6c3a3a6d696e743a20616d6f756e7420657863656564732039362062697473506f6f6c3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773506f6f6c3a3a6d696e743a20746f74616c537570706c7920657863656564732039362062697473a365627a7a723158208d72f82aaefb2f0e5b0321df1ca459b096d061cdecf654628fda46f27f2760f26c6578706572696d656e74616cf564736f6c63430005100040

Verified Source Code Partial Match

Compiler: v0.5.16+commit.9c3226ce EVM: istanbul Optimization: Yes (200 runs)
Pool.sol 396 lines
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;

import "./SafeMath.sol";


contract Pool {
    /// @notice EIP-20 token name for this token
    string public constant name = "PoolTogether";

    /// @notice EIP-20 token symbol for this token
    string public constant symbol = "POOL";

    /// @notice EIP-20 token decimals for this token
    uint8 public constant decimals = 18;

    /// @notice Total number of tokens in circulation
    uint public totalSupply = 10_000_000e18; // 10 million Pool

    /// @notice Address which may mint new tokens
    address public minter;

    /// @notice The timestamp after which minting may occur
    uint public mintingAllowedAfter;

    /// @notice Minimum time between mints
    uint32 public constant minimumTimeBetweenMints = 365 days; //1 year

    /// @notice Cap on the percentage of totalSupply that can be minted at each mint
    uint8 public constant mintCap = 2;

    /// @notice Allowance amounts on behalf of others
    mapping (address => mapping (address => uint96)) internal allowances;

    /// @notice 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)");

    /// @notice A record of states for signing / validating signatures
    mapping (address => uint) public nonces;

    /// @notice An event thats emitted when the minter address is changed
    event MinterChanged(address minter, address newMinter);

    /// @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, uint previousBalance, uint 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);

    /**
     * @notice Construct a new Pool token
     * @param account The initial account to grant all the tokens
     * @param minter_ The account with minting ability
     * @param mintingAllowedAfter_ The timestamp after which minting may occur
     */
    constructor(address account, address minter_, uint mintingAllowedAfter_) public {
        require(mintingAllowedAfter_ >= block.timestamp, "Pool::constructor: minting can only begin after deployment");

        balances[account] = uint96(totalSupply);
        emit Transfer(address(0), account, totalSupply);
        minter = minter_;
        emit MinterChanged(address(0), minter);
        mintingAllowedAfter = mintingAllowedAfter_;
    }

    /**
     * @notice Change the minter address
     * @param minter_ The address of the new minter
     */
    function setMinter(address minter_) external {
        require(msg.sender == minter, "Pool::setMinter: only the minter can change the minter address");
        emit MinterChanged(minter, minter_);
        minter = minter_;
    }

    /**
     * @notice Mint new tokens
     * @param dst The address of the destination account
     * @param rawAmount The number of tokens to be minted
     */
    function mint(address dst, uint rawAmount) external {
        require(msg.sender == minter, "Pool::mint: only the minter can mint");
        require(block.timestamp >= mintingAllowedAfter, "Pool::mint: minting not allowed yet");
        require(dst != address(0), "Pool::mint: cannot transfer to the zero address");

        // record the mint
        mintingAllowedAfter = SafeMath.add(block.timestamp, minimumTimeBetweenMints);

        // mint the amount
        uint96 amount = safe96(rawAmount, "Pool::mint: amount exceeds 96 bits");
        require(amount <= SafeMath.div(SafeMath.mul(totalSupply, mintCap), 100), "Pool::mint: exceeded mint cap");
        totalSupply = safe96(SafeMath.add(totalSupply, amount), "Pool::mint: totalSupply exceeds 96 bits");

        // transfer the amount to the recipient
        balances[dst] = add96(balances[dst], amount, "Pool::mint: transfer amount overflows");
        emit Transfer(address(0), dst, amount);

        // move delegates
        _moveDelegates(address(0), delegates[dst], amount);
    }

    /**
     * @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 (uint) {
        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, uint rawAmount) external returns (bool) {
        uint96 amount;
        if (rawAmount == uint(-1)) {
            amount = uint96(-1);
        } else {
            amount = safe96(rawAmount, "Pool::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, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
        uint96 amount;
        if (rawAmount == uint(-1)) {
            amount = uint96(-1);
        } else {
            amount = safe96(rawAmount, "Pool::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), "Pool::permit: invalid signature");
        require(signatory == owner, "Pool::permit: unauthorized");
        require(now <= deadline, "Pool::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 (uint) {
        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, uint rawAmount) external returns (bool) {
        uint96 amount = safe96(rawAmount, "Pool::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, uint rawAmount) external returns (bool) {
        address spender = msg.sender;
        uint96 spenderAllowance = allowances[src][spender];
        uint96 amount = safe96(rawAmount, "Pool::approve: amount exceeds 96 bits");

        if (spender != src && spenderAllowance != uint96(-1)) {
            uint96 newAllowance = sub96(spenderAllowance, amount, "Pool::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) public {
        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, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
        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), "Pool::delegateBySig: invalid signature");
        require(nonce == nonces[signatory]++, "Pool::delegateBySig: invalid nonce");
        require(now <= expiry, "Pool::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, uint blockNumber) public view returns (uint96) {
        require(blockNumber < block.number, "Pool::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 = 0;
        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(src != address(0), "Pool::_transferTokens: cannot transfer from the zero address");
        require(dst != address(0), "Pool::_transferTokens: cannot transfer to the zero address");

        balances[src] = sub96(balances[src], amount, "Pool::_transferTokens: transfer amount exceeds balance");
        balances[dst] = add96(balances[dst], amount, "Pool::_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, "Pool::_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, "Pool::_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, "Pool::_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(uint n, string memory errorMessage) internal pure returns (uint32) {
        require(n < 2**32, errorMessage);
        return uint32(n);
    }

    function safe96(uint 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 (uint) {
        uint256 chainId;
        assembly { chainId := chainid() }
        return chainId;
    }
}
SafeMath.sol 186 lines
pragma solidity ^0.5.16;

// From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol
// Subject to the MIT license.

/**
 * @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 addition of two unsigned integers, reverting with custom message on overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, errorMessage);

        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction underflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     * - Subtraction cannot underflow.
     */
    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 multiplication of two unsigned integers, reverting on overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b, string memory errorMessage) 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, errorMessage);

        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.
     */
    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.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}
TreasuryVester.sol 62 lines
pragma solidity ^0.5.16;

import "./SafeMath.sol";

contract TreasuryVester {
    using SafeMath for uint;

    address public pool;
    address public recipient;

    uint public vestingAmount;
    uint public vestingBegin;
    uint public vestingCliff;
    uint public vestingEnd;

    uint public lastUpdate;

    constructor(
        address pool_,
        address recipient_,
        uint vestingAmount_,
        uint vestingBegin_,
        uint vestingCliff_,
        uint vestingEnd_
    ) public {
        require(vestingBegin_ >= block.timestamp, 'TreasuryVester::constructor: vesting begin too early');
        require(vestingCliff_ >= vestingBegin_, 'TreasuryVester::constructor: cliff is too early');
        require(vestingEnd_ > vestingCliff_, 'TreasuryVester::constructor: end is too early');

        pool = pool_;
        recipient = recipient_;

        vestingAmount = vestingAmount_;
        vestingBegin = vestingBegin_;
        vestingCliff = vestingCliff_;
        vestingEnd = vestingEnd_;

        lastUpdate = vestingBegin;
    }

    function setRecipient(address recipient_) public {
        require(msg.sender == recipient, 'TreasuryVester::setRecipient: unauthorized');
        recipient = recipient_;
    }

    function claim() public {
        require(block.timestamp >= vestingCliff, 'TreasuryVester::claim: not time yet');
        uint amount;
        if (block.timestamp >= vestingEnd) {
            amount = IERC20(pool).balanceOf(address(this));
        } else {
            amount = vestingAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin);
            lastUpdate = block.timestamp;
        }
        IERC20(pool).transfer(recipient, amount);
    }
}

interface IERC20 {
    function balanceOf(address account) external view returns (uint);
    function transfer(address dst, uint rawAmount) external returns (bool);
}
Timelock.sol 110 lines
pragma solidity ^0.5.16;

import "./SafeMath.sol";

contract Timelock {
    using SafeMath for uint;

    event NewAdmin(address indexed newAdmin);
    event NewPendingAdmin(address indexed newPendingAdmin);
    event NewDelay(uint indexed newDelay);
    event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature,  bytes data, uint eta);
    event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature,  bytes data, uint eta);
    event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta);

    function gracePeriod() public pure returns (uint) { return 14 days; }

    function minimumDelay() public pure returns (uint) { return 2 days; }

    function maximumDelay() public pure returns (uint) { return 30 days; }

    address public admin;
    address public pendingAdmin;
    uint public delay;

    mapping (bytes32 => bool) public queuedTransactions;


    constructor(address admin_, uint delay_) public {
        require(delay_ >= minimumDelay(), "Timelock::constructor: Delay must exceed minimum delay.");
        require(delay_ <= maximumDelay(), "Timelock::setDelay: Delay must not exceed maximum delay.");

        admin = admin_;
        delay = delay_;
    }

    function() external payable { }

    function setDelay(uint delay_) public {
        require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock.");
        require(delay_ >= minimumDelay(), "Timelock::setDelay: Delay must exceed minimum delay.");
        require(delay_ <= maximumDelay(), "Timelock::setDelay: Delay must not exceed maximum delay.");
        delay = delay_;

        emit NewDelay(delay);
    }

    function acceptAdmin() public {
        require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin.");
        admin = msg.sender;
        pendingAdmin = address(0);

        emit NewAdmin(admin);
    }

    function setPendingAdmin(address pendingAdmin_) public {
        require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock.");
        pendingAdmin = pendingAdmin_;

        emit NewPendingAdmin(pendingAdmin);
    }

    function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) {
        require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin.");
        require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay.");

        bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
        queuedTransactions[txHash] = true;

        emit QueueTransaction(txHash, target, value, signature, data, eta);
        return txHash;
    }

    function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public {
        require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin.");

        bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
        queuedTransactions[txHash] = false;

        emit CancelTransaction(txHash, target, value, signature, data, eta);
    }

    function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) {
        require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin.");
        bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta));
        require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued.");
        require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock.");
        require(getBlockTimestamp() <= eta.add(gracePeriod()), "Timelock::executeTransaction: Transaction is stale.");
        queuedTransactions[txHash] = false;

        bytes memory callData;

        if (bytes(signature).length == 0) {
            callData = data;
        } else {
            callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data);
        }
        // solium-disable-next-line security/no-call-value
        (bool success, bytes memory returnData) = target.call.value(value)(callData);
        require(success, "Timelock::executeTransaction: Transaction execution reverted.");

        emit ExecuteTransaction(txHash, target, value, signature, data, eta);

        return returnData;
    }

    function getBlockTimestamp() internal view returns (uint) {
        // solium-disable-next-line security/no-block-members
        return block.timestamp;
    }
}
Nolock.sol 14 lines
pragma solidity ^0.5.16;

import "../Timelock.sol";

contract Nolock is Timelock {

    function gracePeriod() public pure returns (uint) { return 10 minutes; }

    function minimumDelay() public pure returns (uint) { return 1 seconds; }

    function maximumDelay() public pure returns (uint) { return 100000 days; }

    constructor(address admin_, uint delay_) public Timelock(admin_, delay_) {}
}

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
minimumTimeBetweenMints 0x5c11d62f → uint32
mintCap 0x76c71ca1 → uint8
minter 0x07546172 → address
mintingAllowedAfter 0x30b36cef → uint256
name 0x06fdde03 → string
nonces 0x7ecebe00 → uint256
numCheckpoints 0x6fcfff45 → uint32
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 8 functions

These functions modify contract state and require a wallet transaction to execute.

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
mint 0x40c10f19
address dst
uint256 rawAmount
permit 0xd505accf
address owner
address spender
uint256 rawAmount
uint256 deadline
uint8 v
bytes32 r
bytes32 s
setMinter 0xfca3b5aa
address minter_
transfer 0xa9059cbb
address dst
uint256 rawAmount
returns: bool
transferFrom 0x23b872dd
address src
address dst
uint256 rawAmount
returns: bool

Recent Transactions

No transactions found for this address