Address Contract Partially Verified
Address
0xD944104DfE3414D2a271b43403Ccf9399f34c9e4
Balance
0 ETH
Nonce
1
Code Size
8856 bytes
Creator
0x5B8fd1A6...dcbe at tx 0x4843170d...ee398f
Indexed Transactions
0
Contract Bytecode
8856 bytes
0x608060405234801561000f575f80fd5b5060043610610140575f3560e01c806370d0d399116100b65780638da5cb5b1161007a5780638da5cb5b146103305780639852595c1461034e578063bace71451461037e578063c6ed8990146103ae578063c9ac9eb3146103de578063f2fde38b1461040e57610140565b806370d0d399146102c2578063715018a6146102e057806378e97925146102ea5780638456cb591461030857806386d1a69f1461031257610140565b8063384711cc11610108578063384711cc146101fe5780633ccfd60b1461022e5780633f4ba83a1461024c578063459531fe1461025657806355a3b2c1146102745780635c975abb146102a457610140565b80630fb5a6b41461014457806313d033c01461016257806317cf5391146101805780633197cbb6146101b057806337bdc99b146101ce575b5f80fd5b61014c61042a565b6040516101599190611889565b60405180910390f35b61016a61044e565b6040516101779190611889565b60405180910390f35b61019a60048036038101906101959190611937565b610472565b6040516101a79190611984565b60405180910390f35b6101b86106d2565b6040516101c59190611889565b60405180910390f35b6101e860048036038101906101e3919061199d565b610724565b6040516101f59190611984565b60405180910390f35b610218600480360381019061021391906119c8565b6108f3565b6040516102259190611984565b60405180910390f35b61023661090f565b6040516102439190611984565b60405180910390f35b610254610a69565b005b61025e610a7b565b60405161026b9190611a0e565b60405180910390f35b61028e600480360381019061028991906119c8565b610a9f565b60405161029b9190611984565b60405180910390f35b6102ac610ab4565b6040516102b99190611a41565b60405180910390f35b6102ca610ac9565b6040516102d79190611ab5565b60405180910390f35b6102e8610aed565b005b6102f2610b00565b6040516102ff9190611889565b60405180910390f35b610310610b24565b005b61031a610b36565b6040516103279190611984565b60405180910390f35b610338610cc0565b6040516103459190611add565b60405180910390f35b610368600480360381019061036391906119c8565b610ce7565b6040516103759190611984565b60405180910390f35b61039860048036038101906103939190611bac565b610cfc565b6040516103a59190611a41565b60405180910390f35b6103c860048036038101906103c3919061199d565b610fe1565b6040516103d59190611984565b60405180910390f35b6103f860048036038101906103f391906119c8565b6111f1565b6040516104059190611984565b60405180910390f35b610428600480360381019061042391906119c8565b61124a565b005b7f000000000000000000000000000000000000000000000000000000000202290081565b7f0000000000000000000000000000000000000000000000000000000000278d0081565b5f8060015f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205490507f00000000000000000000000000000000000000000000000000000000675a980067ffffffffffffffff1683116104ee575f9150506106cc565b7f00000000000000000000000000000000000000000000000000000000020229007f00000000000000000000000000000000000000000000000000000000675a980061053a9190611c57565b67ffffffffffffffff16831061055357809150506106cc565b7f0000000000000000000000000000000000000000000000000000000000278d007f00000000000000000000000000000000000000000000000000000000675a980061059f9190611c57565b67ffffffffffffffff1683116105c0576105b8816112ce565b9150506106cc565b5f6105ca826112ce565b90505f81836105d99190611c92565b90505f7f0000000000000000000000000000000000000000000000000000000000278d007f00000000000000000000000000000000000000000000000000000000675a98006106289190611c57565b67ffffffffffffffff1690505f81876106419190611c92565b90505f7f0000000000000000000000000000000000000000000000000000000000278d007f00000000000000000000000000000000000000000000000000000000020229006106909190611cc5565b67ffffffffffffffff1690505f8183866106aa9190611d00565b6106b49190611d6e565b905080866106c29190611d9e565b9750505050505050505b92915050565b5f7f00000000000000000000000000000000000000000000000000000000020229007f00000000000000000000000000000000000000000000000000000000675a980061071f9190611c57565b905090565b5f4267ffffffffffffffff167f00000000000000000000000000000000000000000000000000000000675a980067ffffffffffffffff161061079b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079290611e2b565b60405180910390fd5b6107a3611311565b5f6107ac611352565b90505f6107b8826111f1565b9050808411156107fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f490611eb9565b60405180910390fd5b8360025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546108499190611d9e565b925050819055508173ffffffffffffffffffffffffffffffffffffffff167fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b856040516108969190611984565b60405180910390a26108e982857f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b173ffffffffffffffffffffffffffffffffffffffff166113599092919063ffffffff16565b8392505050919050565b5f610908824267ffffffffffffffff16610472565b9050919050565b5f6109186113d8565b61092061145f565b5f7f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161097a9190611add565b602060405180830381865afa158015610995573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109b99190611eeb565b9050610a0d6109c6610cc0565b827f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b173ffffffffffffffffffffffffffffffffffffffff166113599092919063ffffffff16565b610a15610cc0565b73ffffffffffffffffffffffffffffffffffffffff167f13c461eb29f5d65800bbef5a5b05a06ea13b8b2ef4b889ee170f149bc1c8f8bd82604051610a5a9190611984565b60405180910390a28091505090565b610a716113d8565b610a7961149f565b565b7f000000000000000000000000000000000000000000000000000000000000001481565b6001602052805f5260405f205f915090505481565b5f8060149054906101000a900460ff16905090565b7f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b181565b610af56113d8565b610afe5f611500565b565b7f00000000000000000000000000000000000000000000000000000000675a980081565b610b2c6113d8565b610b346115c1565b565b5f4267ffffffffffffffff167f00000000000000000000000000000000000000000000000000000000675a980067ffffffffffffffff1610610bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba490611e2b565b60405180910390fd5b610bb5611311565b5f610bbe611352565b90505f610bca826111f1565b90508060025f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610c189190611d9e565b925050819055508173ffffffffffffffffffffffffffffffffffffffff167fc0e523490dd523c33b1878c9eb14ff46991e3f5b2cd33710918618f2a39cba1b82604051610c659190611984565b60405180910390a2610cb882827f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b173ffffffffffffffffffffffffffffffffffffffff166113599092919063ffffffff16565b809250505090565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6002602052805f5260405f205f915090505481565b5f610d056113d8565b4267ffffffffffffffff167f00000000000000000000000000000000000000000000000000000000675a980067ffffffffffffffff1611610d7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d7290611f86565b60405180910390fd5b828290508585905014610dc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dba90611fee565b60405180910390fd5b5f805b84849050811015610ef0575f858583818110610de557610de461200c565b5b9050602002016020810190610dfa91906119c8565b90505f888884818110610e1057610e0f61200c565b5b905060200201359050888884818110610e2c57610e2b61200c565b5b9050602002013584610e3e9190611d9e565b93508060015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f828254610e8c9190611d9e565b925050819055508173ffffffffffffffffffffffffffffffffffffffff167fb4252717ce23d8029abb408851c7a1b17d6153bc9a28b9bbbbb678ffd755b6e682604051610ed99190611984565b60405180910390a250508080600101915050610dc6565b507f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b173ffffffffffffffffffffffffffffffffffffffff166323b872dd610f35610cc0565b30846040518463ffffffff1660e01b8152600401610f5593929190612039565b6020604051808303815f875af1158015610f71573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f959190612098565b610fd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fcb9061210d565b60405180910390fd5b6001915050949350505050565b5f610fea611311565b4267ffffffffffffffff167f00000000000000000000000000000000000000000000000000000000675a980067ffffffffffffffff1611611060576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110579061219b565b60405180910390fd5b5f611069611352565b90507f00000000000000000000000072fdc31f4a9a1edf6b6132d3c1754f1cdcf5d9b173ffffffffffffffffffffffffffffffffffffffff166323b872dd8230866040518463ffffffff1660e01b81526004016110c893929190612039565b6020604051808303815f875af11580156110e4573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111089190612098565b611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113e9061210d565b60405180910390fd5b8260015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8282546111939190611d9e565b925050819055508073ffffffffffffffffffffffffffffffffffffffff167fb4252717ce23d8029abb408851c7a1b17d6153bc9a28b9bbbbb678ffd755b6e6846040516111e09190611984565b60405180910390a282915050919050565b5f60025f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054611239836108f3565b6112439190611c92565b9050919050565b6112526113d8565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036112c2575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016112b99190611add565b60405180910390fd5b6112cb81611500565b50565b5f60647f000000000000000000000000000000000000000000000000000000000000001460ff16836113009190611d00565b61130a9190611d6e565b9050919050565b611319610ab4565b15611350576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b5f33905090565b6113d3838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb858560405160240161138c9291906121b9565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050611623565b505050565b6113e0611352565b73ffffffffffffffffffffffffffffffffffffffff166113fe610cc0565b73ffffffffffffffffffffffffffffffffffffffff161461145d57611421611352565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016114549190611add565b60405180910390fd5b565b611467610ab4565b61149d576040517f8dfc202b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6114a761145f565b5f8060146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6114e9611352565b6040516114f69190611add565b60405180910390a1565b5f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050815f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6115c9611311565b60015f60146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861160c611352565b6040516116199190611add565b60405180910390a1565b5f61164d828473ffffffffffffffffffffffffffffffffffffffff166116b890919063ffffffff16565b90505f81511415801561167157508080602001905181019061166f9190612098565b155b156116b357826040517f5274afe70000000000000000000000000000000000000000000000000000000081526004016116aa9190611add565b60405180910390fd5b505050565b60606116c583835f6116cd565b905092915050565b60608147101561171457306040517fcd78605900000000000000000000000000000000000000000000000000000000815260040161170b9190611add565b60405180910390fd5b5f808573ffffffffffffffffffffffffffffffffffffffff16848660405161173c919061224c565b5f6040518083038185875af1925050503d805f8114611776576040519150601f19603f3d011682016040523d82523d5f602084013e61177b565b606091505b509150915061178b868383611796565b925050509392505050565b6060826117ab576117a682611823565b61181b565b5f82511480156117d157505f8473ffffffffffffffffffffffffffffffffffffffff163b145b1561181357836040517f9996b31500000000000000000000000000000000000000000000000000000000815260040161180a9190611add565b60405180910390fd5b81905061181c565b5b9392505050565b5f815111156118355780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f67ffffffffffffffff82169050919050565b61188381611867565b82525050565b5f60208201905061189c5f83018461187a565b92915050565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6118d3826118aa565b9050919050565b6118e3816118c9565b81146118ed575f80fd5b50565b5f813590506118fe816118da565b92915050565b5f819050919050565b61191681611904565b8114611920575f80fd5b50565b5f813590506119318161190d565b92915050565b5f806040838503121561194d5761194c6118a2565b5b5f61195a858286016118f0565b925050602061196b85828601611923565b9150509250929050565b61197e81611904565b82525050565b5f6020820190506119975f830184611975565b92915050565b5f602082840312156119b2576119b16118a2565b5b5f6119bf84828501611923565b91505092915050565b5f602082840312156119dd576119dc6118a2565b5b5f6119ea848285016118f0565b91505092915050565b5f60ff82169050919050565b611a08816119f3565b82525050565b5f602082019050611a215f8301846119ff565b92915050565b5f8115159050919050565b611a3b81611a27565b82525050565b5f602082019050611a545f830184611a32565b92915050565b5f819050919050565b5f611a7d611a78611a73846118aa565b611a5a565b6118aa565b9050919050565b5f611a8e82611a63565b9050919050565b5f611a9f82611a84565b9050919050565b611aaf81611a95565b82525050565b5f602082019050611ac85f830184611aa6565b92915050565b611ad7816118c9565b82525050565b5f602082019050611af05f830184611ace565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611b1757611b16611af6565b5b8235905067ffffffffffffffff811115611b3457611b33611afa565b5b602083019150836020820283011115611b5057611b4f611afe565b5b9250929050565b5f8083601f840112611b6c57611b6b611af6565b5b8235905067ffffffffffffffff811115611b8957611b88611afa565b5b602083019150836020820283011115611ba557611ba4611afe565b5b9250929050565b5f805f8060408587031215611bc457611bc36118a2565b5b5f85013567ffffffffffffffff811115611be157611be06118a6565b5b611bed87828801611b02565b9450945050602085013567ffffffffffffffff811115611c1057611c0f6118a6565b5b611c1c87828801611b57565b925092505092959194509250565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611c6182611867565b9150611c6c83611867565b9250828201905067ffffffffffffffff811115611c8c57611c8b611c2a565b5b92915050565b5f611c9c82611904565b9150611ca783611904565b9250828203905081811115611cbf57611cbe611c2a565b5b92915050565b5f611ccf82611867565b9150611cda83611867565b9250828203905067ffffffffffffffff811115611cfa57611cf9611c2a565b5b92915050565b5f611d0a82611904565b9150611d1583611904565b9250828202611d2381611904565b91508282048414831517611d3a57611d39611c2a565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611d7882611904565b9150611d8383611904565b925082611d9357611d92611d41565b5b828204905092915050565b5f611da882611904565b9150611db383611904565b9250828201905080821115611dcb57611dca611c2a565b5b92915050565b5f82825260208201905092915050565b7f56657374696e6720706572696f64206861736e277420737461727465640000005f82015250565b5f611e15601d83611dd1565b9150611e2082611de1565b602082019050919050565b5f6020820190508181035f830152611e4281611e09565b9050919050565b7f416d6f756e7420657863656564732072656c6561736561626c6520616d6f756e5f8201527f7400000000000000000000000000000000000000000000000000000000000000602082015250565b5f611ea3602183611dd1565b9150611eae82611e49565b604082019050919050565b5f6020820190508181035f830152611ed081611e97565b9050919050565b5f81519050611ee58161190d565b92915050565b5f60208284031215611f0057611eff6118a2565b5b5f611f0d84828501611ed7565b91505092915050565b7f43616e6e6f74206164642066756e64732061667465722076657374696e6720705f8201527f6572696f64207374617274656400000000000000000000000000000000000000602082015250565b5f611f70602d83611dd1565b9150611f7b82611f16565b604082019050919050565b5f6020820190508181035f830152611f9d81611f64565b9050919050565b7f4172726179206c656e677468732073686f756c64206d617463680000000000005f82015250565b5f611fd8601a83611dd1565b9150611fe382611fa4565b602082019050919050565b5f6020820190508181035f83015261200581611fcc565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f60608201905061204c5f830186611ace565b6120596020830185611ace565b6120666040830184611975565b949350505050565b61207781611a27565b8114612081575f80fd5b50565b5f815190506120928161206e565b92915050565b5f602082840312156120ad576120ac6118a2565b5b5f6120ba84828501612084565b91505092915050565b7f5472616e736665722066726f6d206661696c65640000000000000000000000005f82015250565b5f6120f7601483611dd1565b9150612102826120c3565b602082019050919050565b5f6020820190508181035f830152612124816120eb565b9050919050565b7f43616e6e6f74206164642066756e64732061667465722076657374696e6720705f8201527f6572696f64206861732073746172746564000000000000000000000000000000602082015250565b5f612185603183611dd1565b91506121908261212b565b604082019050919050565b5f6020820190508181035f8301526121b281612179565b9050919050565b5f6040820190506121cc5f830185611ace565b6121d96020830184611975565b9392505050565b5f81519050919050565b5f81905092915050565b5f5b838110156122115780820151818401526020810190506121f6565b5f8484015250505050565b5f612226826121e0565b61223081856121ea565b93506122408185602086016121f4565b80840191505092915050565b5f612257828461221c565b91508190509291505056fea26469706673582212209c08bbee6246f5dcd1a9007b4de56c4595a1c55e1fcee3abb0164c2efab2d4f964736f6c63430008180033
Verified Source Code Partial Match
Compiler: v0.8.24+commit.e11b9ed9
EVM: shanghai
Optimization: No
Vesting.sol 986 lines
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling 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 {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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/utils/Pausable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Pausable.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
bool private _paused;
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
/**
* @dev The operation failed because the contract is paused.
*/
error EnforcedPause();
/**
* @dev The operation failed because the contract is not paused.
*/
error ExpectedPause();
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value) external returns (bool);
}
// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @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://consensys.net/diligence/blog/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.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}
// File: @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
/**
* @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;
/**
* @dev An operation with an ERC20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @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);
if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @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).
*
* This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
// 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 cannot use {Address-functionCall} here since this should return false
// and not revert is the subcall reverts.
(bool success, bytes memory returndata) = address(token).call(data);
return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
}
}
// File: contracts/VestingFoundationManaged.sol
pragma solidity ^0.8.24;
// Uncomment this line to use console.log
// import "hardhat/console.sol";
contract Vesting is Context, Ownable, Pausable {
using SafeERC20 for IERC20;
uint64 public immutable startTime;
uint8 public immutable tgeVestingPercentage;
// in seconds
uint64 public immutable duration;
uint64 public immutable cliff;
IERC20 public immutable qiibeeCoin;
/**
* @dev amount of QBX users committed to the Vesting contract
*/
mapping(address => uint) public amounts;
/**
* @dev amount of QBX users have already released from their vested amount
*/
mapping(address => uint) public released;
event ERC20Added(address indexed beneficiary, uint256 amount);
event ERC20Released(address indexed beneficiary, uint256 amount);
event OwnerWithdraw(address indexed owner, uint256 amount);
modifier ifVestingStarted() {
require(
startTime < uint64(block.timestamp),
"Vesting period hasn't started"
);
_;
}
constructor(
uint64 startTime_,
uint64 durationDays_,
uint64 cliffDays_,
uint8 tgeVestingPercentage_,
IERC20 qbxContractAddress_
) Ownable(msg.sender) {
require(
startTime_ > uint64(block.timestamp),
"startTime_ cannot be in the past"
);
require(
tgeVestingPercentage >= 0,
"tgeVestingPercentage must be greater than or equal to 0"
);
require(
tgeVestingPercentage <= 100,
"tgeVestingPercentage must be less than or equal to 100"
);
require(durationDays_ > 0, "durationDays_ should be greater than 0");
require(
durationDays_ > cliffDays_,
"durationDays_ should be greater than cliffDays_"
);
startTime = startTime_;
tgeVestingPercentage = tgeVestingPercentage_;
// convert into seconds
duration = durationDays_ * 1 days;
cliff = cliffDays_ * 1 days;
qiibeeCoin = qbxContractAddress_;
}
/**
* @dev Getter for the end timestamp.
*/
function endTime() public view returns (uint64) {
return startTime + duration;
}
/**
* @dev Pause contract.
*/
function pause() public onlyOwner {
_pause();
}
/**
* @dev Unpause contract.
*/
function unpause() public onlyOwner {
_unpause();
}
/**
* @dev Withdraw the QBX balance of this contract after pausing in case of emergency.
* Can only be called by the owner
*/
function withdraw() public onlyOwner whenPaused returns (uint256) {
uint256 balance = qiibeeCoin.balanceOf(address(this));
qiibeeCoin.safeTransfer(owner(), balance);
emit OwnerWithdraw(owner(), balance);
return balance;
}
/**
* @dev Call after calling `allow` on QBX token contract.
* Will withdraw `amount` QBX from `msg.sender` and add to the total held by the address.
* Cannot be called after vesting period has started.
*
* Emits a {ERC20Added} event.
*/
function addTokens(uint256 amount) public whenNotPaused returns (uint256) {
require(
startTime > uint64(block.timestamp),
"Cannot add funds after vesting period has started"
);
address beneficiary = _msgSender();
require(
qiibeeCoin.transferFrom(beneficiary, address(this), amount),
"Transfer from failed"
);
amounts[beneficiary] += amount;
emit ERC20Added(beneficiary, amount);
return amount;
}
/**
* @dev Call after calling `allow` on QBX token contract.
* Will iterate over lists to add corresponding `amount` to `beneficiary`'s total by withdrawing from Foundation address.
* Cannot be called after vesting period has started.
*
* Emits {ERC20Added} events.
*/
function addTokens(
uint256[] calldata amountList,
address[] calldata beneficiaryList
) public onlyOwner returns (bool) {
require(
startTime > uint64(block.timestamp),
"Cannot add funds after vesting period started"
);
require(
amountList.length == beneficiaryList.length,
"Array lengths should match"
);
uint256 totalAmount = 0;
for (uint256 i = 0; i < beneficiaryList.length; i++) {
address beneficiary = beneficiaryList[i];
uint256 amount = amountList[i];
totalAmount += amountList[i];
amounts[beneficiary] += amount;
emit ERC20Added(beneficiary, amount);
}
require(
qiibeeCoin.transferFrom(owner(), address(this), totalAmount),
"Transfer from failed"
);
return true;
}
/**
* @dev Release all the QBX that have already vested.
* Not reusing next function to reduce gas usage.
*
* Emits a {ERC20Released} event.
*/
function release() public ifVestingStarted whenNotPaused returns (uint256) {
address beneficiary = _msgSender();
uint256 amount = releaseable(beneficiary);
released[beneficiary] += amount;
emit ERC20Released(beneficiary, amount);
qiibeeCoin.safeTransfer(beneficiary, amount);
return amount;
}
/**
* @dev Release `amount` QBX from those have already vested.
*
* Emits a {ERC20Released} event.
*/
function release(
uint256 amount
) public ifVestingStarted whenNotPaused returns (uint256) {
address beneficiary = _msgSender();
uint256 amountReleaseable = releaseable(beneficiary);
require(
amount <= amountReleaseable,
"Amount exceeds releaseable amount"
);
released[beneficiary] += amount;
emit ERC20Released(beneficiary, amount);
qiibeeCoin.safeTransfer(beneficiary, amount);
return amount;
}
/**
* @dev Calculates the total amount of releasable QBX. Vested - released. `beneficiary` is the address to check for.
*/
function releaseable(address beneficiary) public view returns (uint256) {
return vestedAmount(beneficiary) - released[beneficiary];
}
/**
* @dev Calculates the total amount of vested QBX. `beneficiary` is the address to check for.
*/
function vestedAmount(address beneficiary) public view returns (uint256) {
return vestedAmount(beneficiary, uint64(block.timestamp));
}
/**
* @dev Calculates the total amount of vested QBX at a certain time.
* `beneficiary` is the address & `timestamp` is the time at which to check for.
*/
function vestedAmount(
address beneficiary,
uint256 timestamp
) public view returns (uint256) {
uint256 totalAmount = amounts[beneficiary];
if (timestamp <= startTime) {
return 0; // Pre TGE; no tokens vested yet
} else if (timestamp >= (startTime + duration)) {
return totalAmount; // Vesting period completed: all tokens vested
} else if (timestamp <= (startTime + cliff)) {
// Cliff not passed. Calculate the amount vested at TGE
return vestedAtTGE(totalAmount);
} else {
// Calculate the amount vested after the cliff
uint256 amountVestedAtTGE = vestedAtTGE(totalAmount);
uint256 remainingAmount = totalAmount - amountVestedAtTGE;
// Linear vesting starts from the end of the cliff
uint256 vestingStartTime = startTime + cliff;
uint256 elapsedTime = timestamp - vestingStartTime;
uint256 effectiveDuration = duration - cliff;
uint256 amountVestedSinceCliff = (remainingAmount * elapsedTime) /
effectiveDuration;
return amountVestedAtTGE + amountVestedSinceCliff;
}
}
function vestedAtTGE(uint256 amount) internal view returns (uint256) {
return (amount * tgeVestingPercentage) / 100;
}
}
Read Contract
amounts 0x55a3b2c1 → uint256
cliff 0x13d033c0 → uint64
duration 0x0fb5a6b4 → uint64
endTime 0x3197cbb6 → uint64
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
qiibeeCoin 0x70d0d399 → address
releaseable 0xc9ac9eb3 → uint256
released 0x9852595c → uint256
startTime 0x78e97925 → uint64
tgeVestingPercentage 0x459531fe → uint8
vestedAmount 0x17cf5391 → uint256
vestedAmount 0x384711cc → uint256
Write Contract 9 functions
These functions modify contract state and require a wallet transaction to execute.
addTokens 0xbace7145
uint256[] amountList
address[] beneficiaryList
returns: bool
addTokens 0xc6ed8990
uint256 amount
returns: uint256
pause 0x8456cb59
No parameters
release 0x37bdc99b
uint256 amount
returns: uint256
release 0x86d1a69f
No parameters
returns: uint256
renounceOwnership 0x715018a6
No parameters
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdraw 0x3ccfd60b
No parameters
returns: uint256
Recent Transactions
No transactions found for this address