编译器
0.8.16+commit.07a7930e
文件 1 的 20:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
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");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
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");
}
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);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
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);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
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);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 20:AdvancedDistributor.sol
pragma solidity 0.8.16;
import "@openzeppelin/contracts/access/Ownable.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {Distributor, DistributionRecord, IERC20} from "./Distributor.sol";
import {IAdjustable} from "../interfaces/IAdjustable.sol";
import {IVotesLite} from "../interfaces/IVotesLite.sol";
import {Sweepable} from "../../utilities/Sweepable.sol";
abstract contract AdvancedDistributor is Ownable, Distributor, Sweepable, IAdjustable, IVotesLite {
using SafeERC20 for IERC20;
uint256 private voteFactor;
constructor(
IERC20 _token,
uint256 _total,
string memory _uri,
uint256 _voteFactor,
uint256 _fractionDenominator
) Distributor(_token, _total, _uri, _fractionDenominator) {
voteFactor = _voteFactor;
emit SetVoteFactor(voteFactor);
}
function adjust(address beneficiary, int256 amount) external onlyOwner {
DistributionRecord memory distributionRecord = records[beneficiary];
require(
distributionRecord.initialized,
"must initialize before adjusting"
);
uint256 diff = uint256(amount > 0 ? amount : -amount);
require(diff < type(uint120).max, "adjustment > max uint120");
if (amount < 0) {
require(total >= diff, "decrease greater than distributor total");
require(
distributionRecord.total >= diff,
"decrease greater than distributionRecord total"
);
total -= diff;
records[beneficiary].total -= uint120(diff);
token.safeTransfer(owner(), diff);
} else {
total += diff;
records[beneficiary].total += uint120(diff);
}
emit Adjust(beneficiary, amount);
}
function setToken(IERC20 _token) external onlyOwner {
require(address(_token) != address(0), "Adjustable: token is address(0)");
token = _token;
emit SetToken(token);
}
function setTotal(uint256 _total) external onlyOwner {
total = _total;
emit SetTotal(total);
}
function setUri(string memory _uri) external onlyOwner {
uri = _uri;
emit SetUri(uri);
}
function getVotes(
address beneficiary
) external override(IVotesLite) view returns (uint256) {
return (records[beneficiary].total - records[beneficiary].claimed) * voteFactor / fractionDenominator;
}
function getTotalVotes() external override(IVotesLite) view returns (uint256) {
return (total - claimed) * voteFactor / fractionDenominator;
}
function getVoteFactor(address) external override(IVotesLite) view returns (uint256) {
return voteFactor;
}
function setVoteFactor(uint256 _voteFactor) external onlyOwner {
voteFactor = _voteFactor;
emit SetVoteFactor(voteFactor);
}
}
文件 3 的 20:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 20:ContinuousVesting.sol
pragma solidity 0.8.16;
import {Distributor, AdvancedDistributor} from "./AdvancedDistributor.sol";
import {IVesting} from "../interfaces/IVesting.sol";
import {IContinuousVesting} from "../interfaces/IContinuousVesting.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
abstract contract ContinuousVesting is AdvancedDistributor, IContinuousVesting {
uint256 private start;
uint256 private cliff;
uint256 private end;
constructor(
IERC20 _token,
uint256 _total,
string memory _uri,
uint256 _voteFactor,
uint256 _start,
uint256 _cliff,
uint256 _end
)
AdvancedDistributor(_token, _total, _uri, _voteFactor, 10**18)
{
require(_start <= _cliff, "vesting cliff before start");
require(_cliff <= _end, "vesting end before cliff");
require(
_end <= 4102444800,
"vesting ends after 4102444800 (Jan 1 2100)"
);
start = _start;
cliff = _cliff;
end = _end;
emit SetContinuousVesting(start, cliff, end);
}
function getVestedFraction(
address,
uint256 time
) public view override(Distributor, IVesting) returns (uint256) {
if (time <= cliff) {
return 0;
}
if (time >= end) {
return fractionDenominator;
}
return (fractionDenominator * (time - start)) / (end - start);
}
function getVestingConfig()
external
view
returns (
uint256,
uint256,
uint256
)
{
return (start, cliff, end);
}
function setVestingConfig(
uint256 _start,
uint256 _cliff,
uint256 _end
) external onlyOwner {
start = _start;
cliff = _cliff;
end = _end;
emit SetContinuousVesting(start, cliff, end);
}
}
文件 5 的 20:ContinuousVestingMerkle.sol
pragma solidity 0.8.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { ContinuousVesting } from "./abstract/ContinuousVesting.sol";
import { MerkleSet } from "./abstract/MerkleSet.sol";
contract ContinuousVestingMerkle is
ContinuousVesting,
MerkleSet
{
constructor(
IERC20 _token,
uint256 _total,
string memory _uri,
uint256 _voteFactor,
uint256 _start,
uint256 _cliff,
uint256 _end,
bytes32 _merkleRoot
)
ContinuousVesting(_token, _total, _uri, _voteFactor, _start, _cliff, _end)
MerkleSet(_merkleRoot)
{}
function NAME() external override pure returns (string memory) {
return 'ContinuousVestingMerkle';
}
function VERSION() external override pure returns (uint) {
return 2;
}
function initializeDistributionRecord(
uint256 index,
address beneficiary,
uint256 amount,
bytes32[] calldata merkleProof
) validMerkleProof(keccak256(abi.encodePacked(index, beneficiary, amount)), merkleProof) external {
_initializeDistributionRecord(beneficiary, amount);
}
function claim(
uint256 index,
address beneficiary,
uint256 amount,
bytes32[] calldata merkleProof
) external validMerkleProof(keccak256(abi.encodePacked(index, beneficiary, amount)), merkleProof) nonReentrant {
if (!records[beneficiary].initialized) {
_initializeDistributionRecord(beneficiary, amount);
}
super._executeClaim(beneficiary, uint120(getClaimableAmount(beneficiary)));
}
function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
_setMerkleRoot(_merkleRoot);
}
}
文件 6 的 20:Distributor.sol
pragma solidity 0.8.16;
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IDistributor, DistributionRecord} from "../interfaces/IDistributor.sol";
abstract contract Distributor is IDistributor, ReentrancyGuard {
using SafeERC20 for IERC20;
mapping(address => DistributionRecord) internal records;
IERC20 public token;
uint256 public total;
uint256 public claimed;
string public uri;
uint256 immutable fractionDenominator;
function NAME() external virtual returns (string memory);
function VERSION() external virtual returns (uint256);
constructor(
IERC20 _token,
uint256 _total,
string memory _uri,
uint256 _fractionDenominator
) {
require(
address(_token) != address(0),
"Distributor: token is address(0)"
);
require(_total > 0, "Distributor: total is 0");
token = _token;
total = _total;
uri = _uri;
fractionDenominator = _fractionDenominator;
emit InitializeDistributor(token, total, uri, fractionDenominator);
}
function _initializeDistributionRecord(address beneficiary, uint256 amount)
internal
{
require(
amount <= type(uint120).max,
"Distributor: amount > type(uint120).max"
);
require(amount > 0, "Distributor: amount == 0");
require(
!records[beneficiary].initialized,
"Distributor: already initialized"
);
records[beneficiary] = DistributionRecord(true, uint120(amount), 0);
emit InitializeDistributionRecord(beneficiary, amount);
}
function _executeClaim(address beneficiary, uint256 _amount) internal {
uint120 amount = uint120(_amount);
require(amount > 0, "Distributor: no more tokens claimable right now");
records[beneficiary].claimed += amount;
claimed += amount;
token.safeTransfer(beneficiary, amount);
emit Claim(beneficiary, amount);
}
function getDistributionRecord(address beneficiary)
external
view
virtual
returns (DistributionRecord memory)
{
return records[beneficiary];
}
function getVestedFraction(address beneficiary, uint256 time)
public
view
virtual
returns (uint256);
function getFractionDenominator() public view returns (uint256) {
return fractionDenominator;
}
function getClaimableAmount(address beneficiary)
public
view
virtual
returns (uint256)
{
require(
records[beneficiary].initialized,
"Distributor: claim not initialized"
);
DistributionRecord memory record = records[beneficiary];
uint256 claimable = (record.total *
getVestedFraction(beneficiary, block.timestamp)) /
fractionDenominator;
return
record.claimed >= claimable
? 0
: claimable - record.claimed;
}
}
文件 7 的 20:IAdjustable.sol
pragma solidity 0.8.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IAdjustable {
event Adjust(address indexed beneficiary, int256 amount);
event SetToken(IERC20 indexed token);
event SetTotal(uint256 total);
event SetUri(string indexed uri);
event SetVoteFactor(uint256 voteFactor);
function adjust(address beneficiary, int256 amount) external;
function setToken(IERC20 token) external;
function setTotal(uint256 total) external;
function setUri(string memory uri) external;
function setVoteFactor(uint256 setVoteFactor) external;
}
文件 8 的 20:IContinuousVesting.sol
pragma solidity 0.8.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IVesting} from "./IVesting.sol";
interface IContinuousVesting is IVesting {
event SetContinuousVesting(uint256 start, uint256 cliff, uint256 end);
function getVestingConfig()
external
view
returns (
uint256,
uint256,
uint256
);
function setVestingConfig(
uint256 _start,
uint256 _cliff,
uint256 _end
) external;
}
文件 9 的 20:IDistributor.sol
pragma solidity 0.8.16;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
struct DistributionRecord {
bool initialized;
uint120 total;
uint120 claimed;
}
interface IDistributor {
event InitializeDistributor(
IERC20 indexed token,
uint256 total,
string uri,
uint256 fractionDenominator
);
event InitializeDistributionRecord(
address indexed beneficiary,
uint256 amount
);
event Claim(address indexed beneficiary, uint256 amount);
function getDistributionRecord(address beneficiary) external view returns (DistributionRecord memory);
function getClaimableAmount(address beneficiary) external view returns (uint256);
function getFractionDenominator() external view returns (uint256);
}
文件 10 的 20:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 11 的 20:IMerkleSet.sol
pragma solidity 0.8.16;
interface IMerkleSet {
event SetMerkleRoot(bytes32 merkleRoot);
function getMerkleRoot() external view returns (bytes32 root);
}
文件 12 的 20:IVesting.sol
pragma solidity 0.8.16;
interface IVesting {
function getVestedFraction(
address,
uint256 time
) external returns (uint256);
}
文件 13 的 20:IVotesLite.sol
pragma solidity 0.8.16;
interface IVotesLite {
function getVotes(address account) external view returns (uint256);
function getTotalVotes() external view returns (uint256);
function getVoteFactor(address account) external view returns (uint256);
}
文件 14 的 20:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 15 的 20:MerkleSet.sol
pragma solidity 0.8.16;
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import { IMerkleSet } from "../interfaces/IMerkleSet.sol";
contract MerkleSet is IMerkleSet {
bytes32 private merkleRoot;
constructor(bytes32 _merkleRoot) {
_setMerkleRoot(_merkleRoot);
}
modifier validMerkleProof(
bytes32 leaf,
bytes32[] calldata merkleProof
) {
_verifyMembership(leaf, merkleProof);
_;
}
function _testMembership(bytes32 leaf, bytes32[] calldata merkleProof)
internal
view returns (bool)
{
return MerkleProof.verify(merkleProof, merkleRoot, leaf);
}
function getMerkleRoot() public view returns (bytes32) {
return merkleRoot;
}
function _verifyMembership(bytes32 leaf, bytes32[] calldata merkleProof)
internal
view
{
require(_testMembership(leaf, merkleProof), "invalid proof");
}
function _setMerkleRoot(bytes32 _merkleRoot) internal {
merkleRoot = _merkleRoot;
emit SetMerkleRoot(merkleRoot);
}
}
文件 16 的 20:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 17 的 20:ReentrancyGuard.sol
pragma solidity ^0.8.0;
abstract contract ReentrancyGuard {
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
modifier nonReentrant() {
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
_status = _ENTERED;
_;
_status = _NOT_ENTERED;
}
}
文件 18 的 20:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
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));
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
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));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 19 的 20:Sweepable.sol
pragma solidity 0.8.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract Sweepable is Ownable {
using SafeERC20 for IERC20;
event SweepToken(address indexed token, uint256 amount);
event SweepNative(uint256 amount);
constructor() {}
function sweepToken(IERC20 token) external onlyOwner {
uint256 amount = token.balanceOf(address(this));
token.safeTransfer(owner(), amount);
emit SweepToken(address(token), amount);
}
function sweepToken(IERC20 token, uint256 amount) external onlyOwner {
token.safeTransfer(owner(), amount);
emit SweepToken(address(token), amount);
}
function sweepNative() external onlyOwner {
uint256 amount = address(this).balance;
(bool success, ) = owner().call{value: amount}("");
require(success, "Transfer failed.");
emit SweepNative(amount);
}
function sweepNative(uint256 amount) external onlyOwner {
(bool success, ) = owner().call{value: amount}("");
require(success, "Transfer failed.");
emit SweepNative(amount);
}
}
文件 20 的 20:draft-IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
{
"compilationTarget": {
"contracts/claim/ContinuousVestingMerkle.sol": "ContinuousVestingMerkle"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_total","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"},{"internalType":"uint256","name":"_voteFactor","type":"uint256"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_cliff","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"},{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"int256","name":"amount","type":"int256"}],"name":"Adjust","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InitializeDistributionRecord","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"string","name":"uri","type":"string"},{"indexed":false,"internalType":"uint256","name":"fractionDenominator","type":"uint256"}],"name":"InitializeDistributor","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cliff","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"end","type":"uint256"}],"name":"SetContinuousVesting","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"merkleRoot","type":"bytes32"}],"name":"SetMerkleRoot","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"contract IERC20","name":"token","type":"address"}],"name":"SetToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"}],"name":"SetTotal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"uri","type":"string"}],"name":"SetUri","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"voteFactor","type":"uint256"}],"name":"SetVoteFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SweepNative","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"SweepToken","type":"event"},{"inputs":[],"name":"NAME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"int256","name":"amount","type":"int256"}],"name":"adjust","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getClaimableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getDistributionRecord","outputs":[{"components":[{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"uint120","name":"total","type":"uint120"},{"internalType":"uint120","name":"claimed","type":"uint120"}],"internalType":"struct DistributionRecord","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFractionDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMerkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"time","type":"uint256"}],"name":"getVestedFraction","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVestingConfig","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"getVoteFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"getVotes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"initializeDistributionRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_total","type":"uint256"}],"name":"setTotal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_cliff","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"}],"name":"setVestingConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_voteFactor","type":"uint256"}],"name":"setVoteFactor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sweepNative","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]