Address Contract Partially Verified
Address
0xB368cB4F277450E273d5C7AbBbF978a951E177CD
Balance
0 ETH
Nonce
1
Code Size
10972 bytes
Creator
0x2767705C...B7fC at tx 0xb63c2388...afdf69
Indexed Transactions
0
Contract Bytecode
10972 bytes
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c806396074e70116100ad578063cd03423411610071578063cd0342341461032d578063d3e8948314610337578063e522538114610367578063f2fde38b14610371578063fc0c546a1461038d5761012c565b806396074e7014610277578063a961065514610293578063b4d6abbf146102af578063c370b042146102df578063c884ef83146102fd5761012c565b806359633a1c116100f457806359633a1c146101d357806363a3b8e1146101ef578063715018a61461021f5780638da5cb5b14610229578063954f6254146102475761012c565b806335f345c81461013157806342099b72146101615780634ab894001461017d5780634e71d92d14610199578063534b01c6146101a3575b600080fd5b61014b60048036038101906101469190611a6f565b6103ab565b6040516101589190611ab7565b60405180910390f35b61017b60048036038101906101769190611b6d565b610401565b005b61019760048036038101906101929190611a6f565b610651565b005b6101a16107ab565b005b6101bd60048036038101906101b89190611a6f565b6109cf565b6040516101ca9190611c11565b60405180910390f35b6101ed60048036038101906101e89190611a6f565b610a18565b005b61020960048036038101906102049190611a6f565b610adc565b6040516102169190611ab7565b60405180910390f35b610227610afc565b005b610231610b84565b60405161023e9190611c3b565b60405180910390f35b610261600480360381019061025c9190611c56565b610bad565b60405161026e9190611c11565b60405180910390f35b610291600480360381019061028c9190611c83565b610bd1565b005b6102ad60048036038101906102a89190611d19565b610d88565b005b6102c960048036038101906102c49190611a6f565b611037565b6040516102d69190611c11565b60405180910390f35b6102e76111ba565b6040516102f49190611c11565b60405180910390f35b61031760048036038101906103129190611a6f565b6111c0565b6040516103249190611c11565b60405180910390f35b6103356111d8565b005b610351600480360381019061034c9190611c56565b611277565b60405161035e9190611c11565b60405180910390f35b61036f61129b565b005b61038b60048036038101906103869190611a6f565b61140f565b005b610395611506565b6040516103a29190611df9565b60405180910390f35b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61040961152c565b73ffffffffffffffffffffffffffffffffffffffff16610427610b84565b73ffffffffffffffffffffffffffffffffffffffff161461047d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047490611e71565b60405180910390fd5b6000838390501180156104a1575060018383905061049b9190611ec0565b85859050145b6104e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d790611f88565b60405180910390fd5b6000600190505b6005805490508110156105915760056001826105039190611fa8565b8154811061051457610513611fdc565b5b90600052602060002001546005828154811061053357610532611fdc565b5b90600052602060002001541161057e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161057590612057565b60405180910390fd5b808061058990612077565b9150506104e7565b506000805b848490508110156105db578484828181106105b4576105b3611fdc565b5b90506020020135826105c69190611ec0565b915080806105d390612077565b915050610596565b5081811061061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161061590612131565b60405180910390fd5b83836003919061062f92919061199d565b5085856005919061064192919061199d565b5081600481905550505050505050565b61065961152c565b73ffffffffffffffffffffffffffffffffffffffff16610677610b84565b73ffffffffffffffffffffffffffffffffffffffff16146106cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c490611e71565b60405180910390fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610759576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107509061219d565b60405180910390fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905550565b6002600154036107f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e790612209565b60405180910390fd5b6002600181905550600061080261152c565b90506000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403610886576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087d90612275565b60405180910390fd5b600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610913576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090a906122e1565b60405180910390fd5b600061091e82611037565b905060008103610963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095a90612373565b60405180910390fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109b29190611ec0565b925050819055506109c4824283611534565b505060018081905550565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610a2061152c565b73ffffffffffffffffffffffffffffffffffffffff16610a3e610b84565b73ffffffffffffffffffffffffffffffffffffffff1614610a94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8b90611e71565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b60086020528060005260406000206000915054906101000a900460ff1681565b610b0461152c565b73ffffffffffffffffffffffffffffffffffffffff16610b22610b84565b73ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90611e71565b60405180910390fd5b610b8260006115d6565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60058181548110610bbd57600080fd5b906000526020600020016000915090505481565b610bd961152c565b73ffffffffffffffffffffffffffffffffffffffff16610bf7610b84565b73ffffffffffffffffffffffffffffffffffffffff1614610c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4490611e71565b60405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610cbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb4906123df565b60405180910390fd5b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610d3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d369061244b565b60405180910390fd5b81600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b610d9061152c565b73ffffffffffffffffffffffffffffffffffffffff16610dae610b84565b73ffffffffffffffffffffffffffffffffffffffff1614610e04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dfb90611e71565b60405180910390fd5b818190508484905014610e4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e43906124b7565b60405180910390fd5b60005b8484905081101561103057600073ffffffffffffffffffffffffffffffffffffffff16858583818110610e8557610e84611fdc565b5b9050602002016020810190610e9a9190611a6f565b73ffffffffffffffffffffffffffffffffffffffff1603610ef0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee790612549565b60405180910390fd5b600060066000878785818110610f0957610f08611fdc565b5b9050602002016020810190610f1e9190611a6f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610f99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f909061244b565b60405180910390fd5b828282818110610fac57610fab611fdc565b5b9050602002013560066000878785818110610fca57610fc9611fdc565b5b9050602002016020810190610fdf9190611a6f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550808061102890612077565b915050610e4f565b5050505050565b600080600090505b60058054905081101561116757426005828154811061106157611060611fdc565b5b9060005260206000200154116111675760016005805490506110839190611fa8565b81036110d057600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150611154565b600454600382815481106110e7576110e6611fdc565b5b9060005260206000200154600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461113c9190612569565b61114691906125f2565b826111519190611ec0565b91505b808061115f90612077565b91505061103f565b50600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816111b39190611fa8565b9050919050565b60045481565b60076020528060005260406000206000915090505481565b6001600860006111e661152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f7fcea13fa52052e10e2a2ae5f7edf34eb7a59dd5778244bca78f8f0c6866bfbe61126061152c565b60405161126d9190611c3b565b60405180910390a1565b6003818154811061128757600080fd5b906000526020600020016000915090505481565b6112a361152c565b73ffffffffffffffffffffffffffffffffffffffff166112c1610b84565b73ffffffffffffffffffffffffffffffffffffffff1614611317576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130e90611e71565b60405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016113749190611c3b565b602060405180830381865afa158015611391573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b59190612638565b9050600081036113fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f1906126b1565b60405180910390fd5b61140c61140561152c565b4283611534565b50565b61141761152c565b73ffffffffffffffffffffffffffffffffffffffff16611435610b84565b73ffffffffffffffffffffffffffffffffffffffff161461148b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148290611e71565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036114fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114f190612743565b60405180910390fd5b611503816115d6565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b6115818382600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169a9092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff167f82e416ba72d10e709b5de7ac16f5f49ff1d94f22d55bf582d353d3c313a1e8dd83836040516115c9929190612763565b60405180910390a2505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61171b8363a9059cbb60e01b84846040516024016116b992919061278c565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611720565b505050565b6000611782826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166117e79092919063ffffffff16565b90506000815111156117e257808060200190518101906117a291906127e1565b6117e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d890612880565b60405180910390fd5b5b505050565b60606117f684846000856117ff565b90509392505050565b606082471015611844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183b90612912565b60405180910390fd5b61184d85611913565b61188c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118839061297e565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516118b59190612a18565b60006040518083038185875af1925050503d80600081146118f2576040519150601f19603f3d011682016040523d82523d6000602084013e6118f7565b606091505b5091509150611907828286611936565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6060831561194657829050611996565b6000835111156119595782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198d9190612a84565b60405180910390fd5b9392505050565b8280548282559060005260206000209081019282156119d9579160200282015b828111156119d85782358255916020019190600101906119bd565b5b5090506119e691906119ea565b5090565b5b80821115611a035760008160009055506001016119eb565b5090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611a3c82611a11565b9050919050565b611a4c81611a31565b8114611a5757600080fd5b50565b600081359050611a6981611a43565b92915050565b600060208284031215611a8557611a84611a07565b5b6000611a9384828501611a5a565b91505092915050565b60008115159050919050565b611ab181611a9c565b82525050565b6000602082019050611acc6000830184611aa8565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112611af757611af6611ad2565b5b8235905067ffffffffffffffff811115611b1457611b13611ad7565b5b602083019150836020820283011115611b3057611b2f611adc565b5b9250929050565b6000819050919050565b611b4a81611b37565b8114611b5557600080fd5b50565b600081359050611b6781611b41565b92915050565b600080600080600060608688031215611b8957611b88611a07565b5b600086013567ffffffffffffffff811115611ba757611ba6611a0c565b5b611bb388828901611ae1565b9550955050602086013567ffffffffffffffff811115611bd657611bd5611a0c565b5b611be288828901611ae1565b93509350506040611bf588828901611b58565b9150509295509295909350565b611c0b81611b37565b82525050565b6000602082019050611c266000830184611c02565b92915050565b611c3581611a31565b82525050565b6000602082019050611c506000830184611c2c565b92915050565b600060208284031215611c6c57611c6b611a07565b5b6000611c7a84828501611b58565b91505092915050565b60008060408385031215611c9a57611c99611a07565b5b6000611ca885828601611a5a565b9250506020611cb985828601611b58565b9150509250929050565b60008083601f840112611cd957611cd8611ad2565b5b8235905067ffffffffffffffff811115611cf657611cf5611ad7565b5b602083019150836020820283011115611d1257611d11611adc565b5b9250929050565b60008060008060408587031215611d3357611d32611a07565b5b600085013567ffffffffffffffff811115611d5157611d50611a0c565b5b611d5d87828801611cc3565b9450945050602085013567ffffffffffffffff811115611d8057611d7f611a0c565b5b611d8c87828801611ae1565b925092505092959194509250565b6000819050919050565b6000611dbf611dba611db584611a11565b611d9a565b611a11565b9050919050565b6000611dd182611da4565b9050919050565b6000611de382611dc6565b9050919050565b611df381611dd8565b82525050565b6000602082019050611e0e6000830184611dea565b92915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611e5b602083611e14565b9150611e6682611e25565b602082019050919050565b60006020820190508181036000830152611e8a81611e4e565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611ecb82611b37565b9150611ed683611b37565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611f0b57611f0a611e91565b5b828201905092915050565b7f506f6c69637920616e642074696d656c696e65206c656e677468206d69736d6160008201527f7463680000000000000000000000000000000000000000000000000000000000602082015250565b6000611f72602383611e14565b9150611f7d82611f16565b604082019050919050565b60006020820190508181036000830152611fa181611f65565b9050919050565b6000611fb382611b37565b9150611fbe83611b37565b925082821015611fd157611fd0611e91565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f54696d656c696e65206d75737420626520696e6372656173696e670000000000600082015250565b6000612041601b83611e14565b915061204c8261200b565b602082019050919050565b6000602082019050818103600083015261207081612034565b9050919050565b600061208282611b37565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036120b4576120b3611e91565b5b600182019050919050565b7f506f6c6963696573206d757374206e6f7420657863656565642064656e6f6d6960008201527f6e61746f72000000000000000000000000000000000000000000000000000000602082015250565b600061211b602583611e14565b9150612126826120bf565b604082019050919050565b6000602082019050818103600083015261214a8161210e565b9050919050565b7f4e6f20726566756e642072657175657374656400000000000000000000000000600082015250565b6000612187601383611e14565b915061219282612151565b602082019050919050565b600060208201905081810360008301526121b68161217a565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006121f3601f83611e14565b91506121fe826121bd565b602082019050919050565b60006020820190508181036000830152612222816121e6565b9050919050565b7f42656e6566696369617279206e6f742065786973746564000000000000000000600082015250565b600061225f601783611e14565b915061226a82612229565b602082019050919050565b6000602082019050818103600083015261228e81612252565b9050919050565b7f416c726561647920726566756e64656400000000000000000000000000000000600082015250565b60006122cb601083611e14565b91506122d682612295565b602082019050919050565b600060208201905081810360008301526122fa816122be565b9050919050565b7f5a65726f2076657374696e6720616d6f756e742e20506c65617365206368656360008201527f6b20796f757220706f6c69637920616761696e00000000000000000000000000602082015250565b600061235d603383611e14565b915061236882612301565b604082019050919050565b6000602082019050818103600083015261238c81612350565b9050919050565b7f536574207a65726f206164647265737300000000000000000000000000000000600082015250565b60006123c9601083611e14565b91506123d482612393565b602082019050919050565b600060208201905081810360008301526123f8816123bc565b9050919050565b7f416c726561647920616464656400000000000000000000000000000000000000600082015250565b6000612435600d83611e14565b9150612440826123ff565b602082019050919050565b6000602082019050818103600083015261246481612428565b9050919050565b7f496e76616c6964206172726179206c656e677468000000000000000000000000600082015250565b60006124a1601483611e14565b91506124ac8261246b565b602082019050919050565b600060208201905081810360008301526124d081612494565b9050919050565b7f62656e6566696369617279206d757374206e6f7420626520616464726573732060008201527f7a65726f00000000000000000000000000000000000000000000000000000000602082015250565b6000612533602483611e14565b915061253e826124d7565b604082019050919050565b6000602082019050818103600083015261256281612526565b9050919050565b600061257482611b37565b915061257f83611b37565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156125b8576125b7611e91565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006125fd82611b37565b915061260883611b37565b925082612618576126176125c3565b5b828204905092915050565b60008151905061263281611b41565b92915050565b60006020828403121561264e5761264d611a07565b5b600061265c84828501612623565b91505092915050565b7f416c6c6f636174696f6e7320636f6d706c6574656c7920766573746564000000600082015250565b600061269b601d83611e14565b91506126a682612665565b602082019050919050565b600060208201905081810360008301526126ca8161268e565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061272d602683611e14565b9150612738826126d1565b604082019050919050565b6000602082019050818103600083015261275c81612720565b9050919050565b60006040820190506127786000830185611c02565b6127856020830184611c02565b9392505050565b60006040820190506127a16000830185611c2c565b6127ae6020830184611c02565b9392505050565b6127be81611a9c565b81146127c957600080fd5b50565b6000815190506127db816127b5565b92915050565b6000602082840312156127f7576127f6611a07565b5b6000612805848285016127cc565b91505092915050565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b600061286a602a83611e14565b91506128758261280e565b604082019050919050565b600060208201905081810360008301526128998161285d565b9050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b60006128fc602683611e14565b9150612907826128a0565b604082019050919050565b6000602082019050818103600083015261292b816128ef565b9050919050565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b6000612968601d83611e14565b915061297382612932565b602082019050919050565b600060208201905081810360008301526129978161295b565b9050919050565b600081519050919050565b600081905092915050565b60005b838110156129d25780820151818401526020810190506129b7565b838111156129e1576000848401525b50505050565b60006129f28261299e565b6129fc81856129a9565b9350612a0c8185602086016129b4565b80840191505092915050565b6000612a2482846129e7565b915081905092915050565b600081519050919050565b6000601f19601f8301169050919050565b6000612a5682612a2f565b612a608185611e14565b9350612a708185602086016129b4565b612a7981612a3a565b840191505092915050565b60006020820190508181036000830152612a9e8184612a4b565b90509291505056fea2646970667358221220346b107b71a6bb603c0a50ff0dfa24d7c19832296f70d300f6161c6d8c7dcc9e64736f6c634300080d0033
Verified Source Code Partial Match
Compiler: v0.8.13+commit.abaa5c0e
EVM: london
Optimization: No
TimelineVesting.sol 811 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File @openzeppelin/contracts/utils/[email protected]
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File @openzeppelin/contracts/token/ERC20/utils/[email protected]
pragma solidity ^0.8.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File @openzeppelin/contracts/utils/[email protected]
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File @openzeppelin/contracts/access/[email protected]
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File @openzeppelin/contracts/security/[email protected]
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File contracts/IVesting.sol
interface IVesting {
function claimed(address _beneficiary) external view returns (uint256);
function getAvailAmt(address _beneficiary) external view returns (uint256);
function claim() external;
function getTotalAllocated(address _beneficiary)
external
view
returns (uint256);
function isRefundRequested(address _beneficiary) external view returns (bool);
event RefundRequested(address user);
}
// File contracts/TimelineVesting.sol
pragma solidity ^0.8.0;
contract TimelineVesting is Ownable, ReentrancyGuard, IVesting {
using SafeERC20 for IERC20;
IERC20 public token;
uint256[] public policies;
uint256 public denom;
uint256[] public timelines;
mapping(address => uint256) allocatedBalance;
mapping(address => uint256) public override claimed;
mapping(address => bool) public refundRequested;
event Released(
address indexed beneficiary,
uint256 currentTime,
uint256 amount
);
modifier zeroAddr(address _addr) {
require(_addr != address(0), "Set zero address");
_;
}
constructor(address _token) Ownable() {
require(_token != address(0), "Set zero address");
token = IERC20(_token);
}
/**
@notice Set policy and vesting timeline
@param _timelines list of time to return corresponding to `_policy`
`_timeline` length must be `_policy` length + 1
as last vesting time will return remaining of allocated amount
@param _policies list of vesting return in `_denom` of total allocated amount
@param _denom denominator of `_policy`
*/
function setPolicy(
uint256[] calldata _timelines,
uint256[] calldata _policies,
uint256 _denom
) external onlyOwner {
require(
_policies.length > 0 && _timelines.length == _policies.length + 1,
"Policy and timeline length mismatch"
);
for (uint256 i = 1; i < timelines.length; i++) {
require(
timelines[i] > timelines[i - 1],
"Timeline must be increasing"
);
}
uint256 policiesSum = 0;
for (uint256 i = 0; i < _policies.length; i++) {
policiesSum += _policies[i];
}
require(policiesSum < _denom, "Policies must not exceeed denominator");
policies = _policies;
timelines = _timelines;
denom = _denom;
}
function getTotalAllocated(
address _beneficiary
) external view override returns (uint256) {
return allocatedBalance[_beneficiary];
}
/**
@notice add beneficiary
@dev Caller must be Owner
Not allow Owner to alter the vesting policy
@param _beneficiary `_beneficiary` address
@param _beneficiary Amount that `_beneficiary` can claim in total
*/
function addBeneficiary(
address _beneficiary,
uint256 _totalAmt
) external onlyOwner zeroAddr(_beneficiary) {
require(allocatedBalance[_beneficiary] == 0, "Already added");
allocatedBalance[_beneficiary] = _totalAmt;
}
/**
@notice add multiple beneficiaries
@dev Caller must be Owner
Not allow Owner to alter the vesting policy
@param _beneficiaries all `_beneficiaries` address
@param _totalAmt Amount that corresponding `_beneficiary` can claim in total
*/
function addBeneficiaries(
address[] calldata _beneficiaries,
uint256[] calldata _totalAmt
) external onlyOwner {
require(
_beneficiaries.length == _totalAmt.length,
"Invalid array length"
);
for (uint256 i = 0; i < _beneficiaries.length; i++) {
require(
_beneficiaries[i] != address(0),
"beneficiary must not be address zero"
);
require(allocatedBalance[_beneficiaries[i]] == 0, "Already added");
allocatedBalance[_beneficiaries[i]] = _totalAmt[i];
}
}
/**
@notice Query available amount that `_beneficiary` is able to claim at the moment
@dev Caller can be ANY
*/
function getAvailAmt(
address _beneficiary
) public view override returns (uint256 _amount) {
for (uint256 i = 0; i < timelines.length; i++) {
if (timelines[i] > block.timestamp) {
break;
}
if (i == timelines.length - 1) {
_amount = allocatedBalance[_beneficiary];
} else {
_amount +=
(allocatedBalance[_beneficiary] * policies[i]) /
denom;
}
}
_amount -= claimed[_beneficiary];
}
/**
@notice Beneficiaries use this method to claim vesting tokens
@dev Caller can be ANY
Note:
- Only Beneficiaries, who were added into the list, are able to claim tokens
- If `_policy`, that binds to msg.sender, is not found -> revert
- Previously unclaimed amounts will be accumulated
*/
function claim() external override nonReentrant {
address _beneficiary = _msgSender();
require(allocatedBalance[_beneficiary] != 0, "Beneficiary not existed");
require(!refundRequested[_beneficiary], "Already refunded");
uint256 _amount = getAvailAmt(_beneficiary);
require(
_amount != 0,
"Zero vesting amount. Please check your policy again"
);
claimed[_beneficiary] += _amount;
_releaseTokenTo(_beneficiary, block.timestamp, _amount);
}
/**
@notice Owner uses this method to transfer remaining tokens
@dev Caller must be Owner
Note:
- This method should be used ONLY in the case that
tokens are distributed wrongly by mistaken settings
*/
function collect() external onlyOwner {
uint256 _balance = token.balanceOf(address(this));
require(_balance != 0, "Allocations completely vested");
_releaseTokenTo(_msgSender(), block.timestamp, _balance);
}
function _releaseTokenTo(
address _beneficiary,
uint256 _now,
uint256 _amount
) private {
token.safeTransfer(_beneficiary, _amount);
emit Released(_beneficiary, _now, _amount);
}
/**
@notice Request a refunds
@dev Caller should be a beneficiary
Note:
- If this method is call, beneficiary can no longer claim token
- Beneficiary must not call after already claim
*/
function refundRequest() external {
refundRequested[_msgSender()] = true;
emit RefundRequested(_msgSender());
}
/**
@notice Cancel refund request
@dev Caller should be a owner
*/
function cancelRefund(address _beneficiary) external onlyOwner {
require(refundRequested[_beneficiary], "No refund requested");
delete refundRequested[_beneficiary];
}
/**
@notice remove a beneficiary
@dev Caller should be a owner
Note:
- If this method is call, beneficiary can no longer claim token
*/
function removeBeneficiary(address _beneficiary) external onlyOwner {
allocatedBalance[_beneficiary] = 0;
}
function isRefundRequested(
address _beneficiary
) external view override returns (bool) {
return refundRequested[_beneficiary];
}
}
Read Contract
claimed 0xc884ef83 → uint256
denom 0xc370b042 → uint256
getAvailAmt 0xb4d6abbf → uint256
getTotalAllocated 0x534b01c6 → uint256
isRefundRequested 0x35f345c8 → bool
owner 0x8da5cb5b → address
policies 0xd3e89483 → uint256
refundRequested 0x63a3b8e1 → bool
timelines 0x954f6254 → uint256
token 0xfc0c546a → address
Write Contract 10 functions
These functions modify contract state and require a wallet transaction to execute.
addBeneficiaries 0xa9610655
address[] _beneficiaries
uint256[] _totalAmt
addBeneficiary 0x96074e70
address _beneficiary
uint256 _totalAmt
cancelRefund 0x4ab89400
address _beneficiary
claim 0x4e71d92d
No parameters
collect 0xe5225381
No parameters
refundRequest 0xcd034234
No parameters
removeBeneficiary 0x59633a1c
address _beneficiary
renounceOwnership 0x715018a6
No parameters
setPolicy 0x42099b72
uint256[] _timelines
uint256[] _policies
uint256 _denom
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address