编译器
0.8.17+commit.8df45f5f
文件 1 的 38:AggregatorV3Interface.sol
pragma solidity ^0.8.0;
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
function getRoundData(
uint80 _roundId
) external view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
}
文件 2 的 38: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;
}
}
文件 3 的 38:CvgSDT.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../interfaces/ICvgControlTower.sol";
contract CvgSDT is ERC20 {
ICvgControlTower public immutable cvgControlTower;
IERC20 public immutable sdt;
constructor(ICvgControlTower _cvgControlTower) ERC20("Convergence SDT", "cvgSDT") {
cvgControlTower = _cvgControlTower;
IERC20 _sdt = _cvgControlTower.sdt();
require(address(_sdt) != address(0), "SDT_ZERO");
sdt = _sdt;
}
function mint(address account, uint256 amount) external {
sdt.transferFrom(msg.sender, cvgControlTower.veSdtMultisig(), amount);
_mint(account, amount);
}
function burn(uint256 amount) external {
_burn(msg.sender, amount);
}
}
文件 4 的 38:ERC20.sol
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
文件 5 的 38:IBondCalculator.sol
pragma solidity ^0.8.0;
import "./IBondStruct.sol";
interface IBondCalculator {
function computeRoi(
uint256 durationFromStart,
uint256 totalDuration,
IBondStruct.BondFunction composedFunction,
uint256 totalTokenOut,
uint256 amountTokenSold,
uint256 gamma,
uint256 scale,
uint256 minRoi,
uint256 maxRoi
) external pure returns (uint256 bondRoi);
}
文件 6 的 38:IBondDepository.sol
pragma solidity ^0.8.0;
import "./ICvgControlTower.sol";
import "./IBondStruct.sol";
import "./ICvgOracle.sol";
interface IBondDepository {
function deposit(uint256 tokenId, uint256 amount, address receiver) external;
function depositToLock(uint256 amount, address receiver) external returns (uint256 cvgToMint);
function positionInfos(uint256 tokenId) external view returns (IBondStruct.BondPending memory);
function getTokenVestingInfo(uint256 tokenId) external view returns (IBondStruct.TokenVestingInfo memory);
function bondParams() external view returns (IBondStruct.BondParams memory);
function pendingPayoutFor(uint256 tokenId) external view returns (uint256);
}
文件 7 的 38:IBondLogo.sol
pragma solidity 0.8.17;
interface IBondLogo {
struct LogoInfos {
uint256 tokenId;
uint256 termTimestamp;
uint256 pending;
uint256 cvgClaimable;
uint256 unlockingTimestamp;
}
struct LogoInfosFull {
uint256 tokenId;
uint256 termTimestamp;
uint256 pending;
uint256 cvgClaimable;
uint256 unlockingTimestamp;
uint256 year;
uint256 month;
uint256 day;
bool isLocked;
uint256 hoursLock;
uint256 cvgPrice;
}
function _tokenURI(LogoInfos memory logoInfos) external pure returns (string memory output);
function getLogoInfo(uint256 tokenId) external view returns (IBondLogo.LogoInfosFull memory);
}
文件 8 的 38:IBondPositionManager.sol
pragma solidity ^0.8.0;
import "./IBondStruct.sol";
import "./IBondLogo.sol";
import "./IBondDepository.sol";
interface IBondPositionManager {
function bondDepository() external view returns (IBondDepository);
function getTokenIdsForWallet(address _wallet) external view returns (uint256[] memory);
function bondPerTokenId(uint256 tokenId) external view returns (uint256);
function mintOrCheck(uint256 bondId, uint256 tokenId, address receiver) external returns (uint256);
function burn(uint256 tokenId) external;
function unlockingTimestampPerToken(uint256 tokenId) external view returns (uint256);
function logoInfo(uint256 tokenId) external view returns (IBondLogo.LogoInfos memory);
function checkTokenRedeem(uint256[] calldata tokenIds, address receiver) external view;
}
文件 9 的 38:IBondStruct.sol
pragma solidity ^0.8.0;
interface IBondStruct {
struct BondParams {
BondFunction composedFunction;
address token;
uint40 gamma;
uint40 bondDuration;
bool isPaused;
uint32 scale;
uint24 minRoi;
uint24 maxRoi;
uint24 percentageOneTx;
uint32 vestingTerm;
uint80 cvgToSell;
uint40 startBondTimestamp;
}
struct BondPending {
uint64 lastTimestamp;
uint64 vestingTimeLeft;
uint128 leftClaimable;
}
enum BondFunction {
SQRT,
LN,
POWER_2,
LINEAR
}
struct BondTokenView {
uint128 lastTimestamp;
uint128 vestingEnd;
uint256 claimableCvg;
uint256 leftClaimable;
}
struct BondView {
uint256 actualRoi;
uint256 cvgAlreadySold;
uint256 usdExecutionPrice;
uint256 usdLimitPrice;
uint256 assetBondPrice;
uint256 usdBondPrice;
bool isOracleValid;
BondParams bondParameters;
ERC20View token;
}
struct ERC20View {
string token;
address tokenAddress;
uint256 decimals;
}
struct TokenVestingInfo {
uint256 term;
uint256 claimable;
uint256 pending;
}
}
文件 10 的 38:ICommonStruct.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ICommonStruct {
struct TokenAmount {
IERC20 token;
uint256 amount;
}
}
文件 11 的 38:ICvg.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/interfaces/IERC20Metadata.sol";
interface ICvg is IERC20Metadata {
function MAX_AIRDROP() external view returns (uint256);
function MAX_BOND() external view returns (uint256);
function MAX_STAKING() external view returns (uint256);
function MAX_VESTING() external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function burn(uint256 amount) external;
function cvgControlTower() external view returns (address);
function decimals() external view returns (uint8);
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
function mintBond(address account, uint256 amount) external;
function mintStaking(address account, uint256 amount) external;
function mintedBond() external view returns (uint256);
function mintedStaking() external view returns (uint256);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function totalSupply() external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 12 的 38:ICvgControlTower.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./IERC20Mintable.sol";
import "./ICvg.sol";
import "./IBondDepository.sol";
import "./IBondCalculator.sol";
import "./IBondStruct.sol";
import "./ICvgOracle.sol";
import "./IVotingPowerEscrow.sol";
import "./ICvgRewards.sol";
import "./ILockingPositionManager.sol";
import "./ILockingPositionDelegate.sol";
import "./IGaugeController.sol";
import "./IYsDistributor.sol";
import "./IBondPositionManager.sol";
import "./ISdtStakingPositionManager.sol";
import "./IBondLogo.sol";
import "./ILockingLogo.sol";
import "./ILockingPositionService.sol";
import "./IVestingCvg.sol";
import "./ISdtBuffer.sol";
import "./ISdtBlackHole.sol";
import "./ISdtStakingPositionService.sol";
import "./ISdtFeeCollector.sol";
import "./ISdtBuffer.sol";
import "./ISdtRewardDistributor.sol";
interface ICvgControlTower {
function cvgToken() external view returns (ICvg);
function cvgOracle() external view returns (ICvgOracle);
function bondCalculator() external view returns (IBondCalculator);
function gaugeController() external view returns (IGaugeController);
function cvgCycle() external view returns (uint128);
function votingPowerEscrow() external view returns (IVotingPowerEscrow);
function treasuryDao() external view returns (address);
function treasuryPod() external view returns (address);
function treasuryPdd() external view returns (address);
function treasuryAirdrop() external view returns (address);
function treasuryTeam() external view returns (address);
function cvgRewards() external view returns (ICvgRewards);
function lockingPositionManager() external view returns (ILockingPositionManager);
function lockingPositionService() external view returns (ILockingPositionService);
function lockingPositionDelegate() external view returns (ILockingPositionDelegate);
function isStakingContract(address contractAddress) external view returns (bool);
function ysDistributor() external view returns (IYsDistributor);
function isBond(address account) external view returns (bool);
function bondPositionManager() external view returns (IBondPositionManager);
function sdtStakingPositionManager() external view returns (ISdtStakingPositionManager);
function sdtStakingLogo() external view returns (ISdtStakingLogo);
function bondLogo() external view returns (IBondLogo);
function lockingLogo() external view returns (ILockingLogo);
function isSdtStaking(address contractAddress) external view returns (bool);
function vestingCvg() external view returns (IVestingCvg);
function sdt() external view returns (IERC20);
function cvgSDT() external view returns (IERC20Mintable);
function cvgSdtStaking() external view returns (ISdtStakingPositionService);
function cvgSdtBuffer() external view returns (ISdtBuffer);
function veSdtMultisig() external view returns (address);
function cloneFactory() external view returns (address);
function sdtUtilities() external view returns (address);
function insertNewSdtStaking(address _sdtStakingClone) external;
function allBaseSdAssetStaking(uint256 _index) external view returns (address);
function allBaseSdAssetBuffer(uint256 _index) external view returns (address);
function sdtFeeCollector() external view returns (ISdtFeeCollector);
function updateCvgCycle() external;
function sdtBlackHole() external view returns (ISdtBlackHole);
function sdtRewardDistributor() external view returns (address);
function poolCvgSdt() external view returns (address);
function bondDepository() external view returns (address);
}
文件 13 的 38:ICvgOracle.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./IOracleStruct.sol";
interface ICvgOracle {
function getPriceVerified(address erc20) external view returns (uint256);
function getPriceUnverified(address erc20) external view returns (uint256);
function getAndVerifyTwoPrices(address tokenIn, address tokenOut) external view returns (uint256, uint256);
function getTwoPricesAndIsValid(
address tokenIn,
address tokenOut
) external view returns (uint256, uint256, bool, uint256, uint256, bool);
function getPriceAndValidationData(
address erc20Address
) external view returns (uint256, uint256, bool, bool, bool, bool);
function getPoolAddressByToken(address erc20) external view returns (address);
function poolTypePerErc20(address) external view returns (IOracleStruct.PoolType);
function setPoolTypeForToken(address _erc20Address, IOracleStruct.PoolType _poolType) external;
function setStableParams(address _erc20Address, IOracleStruct.StableParams calldata _stableParams) external;
function setCurveDuoParams(address _erc20Address, IOracleStruct.CurveDuoParams calldata _curveDuoParams) external;
function setCurveTriParams(address _erc20Address, IOracleStruct.CurveTriParams calldata _curveTriParams) external;
function setUniV3Params(address _erc20Address, IOracleStruct.UniV3Params calldata _uniV3Params) external;
function setUniV2Params(address _erc20Address, IOracleStruct.UniV2Params calldata _uniV2Params) external;
}
文件 14 的 38:ICvgRewards.sol
pragma solidity ^0.8.0;
interface ICvgRewards {
function cvgCycleRewards() external view returns (uint256);
function addGauge(address gaugeAddress) external;
function removeGauge(address gaugeAddress) external;
function getCycleLocking(uint256 timestamp) external view returns (uint256);
}
文件 15 的 38:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 16 的 38: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);
}
文件 17 的 38:IERC20Metadata.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
文件 18 的 38:IERC20Mintable.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/interfaces/IERC20Metadata.sol";
interface IERC20Mintable is IERC20Metadata {
function mint(address account, uint256 amount) external;
}
文件 19 的 38:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 20 的 38:IERC721Enumerable.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Enumerable is IERC721 {
function totalSupply() external view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
function tokenByIndex(uint256 index) external view returns (uint256);
}
文件 21 的 38:IGaugeController.sol
pragma solidity ^0.8.0;
interface IGaugeController {
struct WeightType {
uint256 weight;
uint256 type_weight;
int128 gauge_type;
}
function add_type(string memory typeName, uint256 weight) external;
function add_gauge(address addr, int128 gaugeType, uint256 weight) external;
function get_gauge_weight(address gaugeAddress) external view returns (uint256);
function get_gauge_weights(address[] memory gaugeAddresses) external view returns (uint256[] memory, uint256);
function get_gauge_weights_and_types(address[] memory gaugeAddresses) external view returns (WeightType[] memory);
function get_total_weight() external view returns (uint256);
function n_gauges() external view returns (uint128);
function gauges(uint256 index) external view returns (address);
function gauge_types(address gaugeAddress) external view returns (int128);
function get_type_weight(int128 typeId) external view returns (uint256);
function gauge_relative_weight(address addr, uint256 time) external view returns (uint256);
function set_lock(bool isLock) external;
function gauge_relative_weight_write(address gaugeAddress) external;
function gauge_relative_weight_writes(uint256 from, uint256 length) external;
function simple_vote(uint256 tokenId, address gaugeAddress, uint256 tokenWeight) external;
}
文件 22 的 38:ILockingLogo.sol
pragma solidity ^0.8.0;
interface ILockingLogo {
struct LogoInfos {
uint256 tokenId;
uint256 cvgLocked;
uint256 lockEnd;
uint256 ysPercentage;
uint256 mgCvg;
uint256 unlockingTimestamp;
}
struct GaugePosition {
uint256 ysWidth;
uint256 veWidth;
}
struct LogoInfosFull {
uint256 tokenId;
uint256 cvgLocked;
uint256 lockEnd;
uint256 ysPercentage;
uint256 mgCvg;
uint256 unlockingTimestamp;
uint256 cvgLockedInUsd;
uint256 ysCvgActual;
uint256 ysCvgNext;
uint256 veCvg;
GaugePosition gaugePosition;
uint256 claimableInUsd;
bool isLocked;
uint256 hoursLock;
}
function _tokenURI(LogoInfos memory logoInfos) external pure returns (string memory output);
function getLogoInfo(uint256 tokenId) external view returns (ILockingLogo.LogoInfosFull memory);
}
文件 23 的 38:ILockingPositionDelegate.sol
pragma solidity ^0.8.0;
interface ILockingPositionDelegate {
struct OwnedAndDelegated {
uint256[] owneds;
uint256[] mgDelegateds;
uint256[] veDelegateds;
}
function delegatedYsCvg(uint256 tokenId) external view returns (address);
function getMgDelegateeInfoPerTokenAndAddress(
uint256 _tokenId,
address _to
) external view returns (uint256, uint256, uint256);
function getIndexForVeDelegatee(address _delegatee, uint256 _tokenId) external view returns (uint256);
function getIndexForMgCvgDelegatee(address _delegatee, uint256 _tokenId) external view returns (uint256);
function delegateVeCvg(uint256 _tokenId, address _to) external;
function delegateYsCvg(uint256 _tokenId, address _to, bool _status) external;
function delegateMgCvg(uint256 _tokenId, address _to, uint256 _percentage) external;
function delegatedVeCvg(uint256 tokenId) external view returns (address);
function getVeCvgDelegatees(address account) external view returns (uint256[] memory);
function getMgCvgDelegatees(address account) external view returns (uint256[] memory);
function getTokenOwnedAndDelegated(address _addr) external view returns (OwnedAndDelegated[] memory);
function getTokenMgOwnedAndDelegated(address _addr) external view returns (uint256[] memory, uint256[] memory);
function getTokenVeOwnedAndDelegated(address _addr) external view returns (uint256[] memory, uint256[] memory);
function addTokenAtMint(uint256 _tokenId, address minter) external;
function cleanDelegateesOnTransfer(uint256 _tokenId) external;
}
文件 24 的 38:ILockingPositionManager.sol
pragma solidity ^0.8.0;
import "./ILockingLogo.sol";
interface ILockingPositionManager {
function ownerOf(uint256 tokenId) external view returns (address);
function mint(address account) external returns (uint256);
function burn(uint256 tokenId, address caller) external;
function logoInfo(uint256 tokenId) external view returns (ILockingLogo.LogoInfos memory);
function checkYsClaim(uint256 tokenId, address caller) external view;
function checkOwnership(uint256 _tokenId, address operator) external view;
function checkOwnerships(uint256[] memory _tokenIds, address operator) external view;
function checkFullCompliance(uint256 tokenId, address operator) external view;
function getTokenIdsForWallet(address _wallet) external view returns (uint256[] memory);
}
文件 25 的 38:ILockingPositionService.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ILockingPositionService {
struct LockingPosition {
uint24 startCycle;
uint24 lastEndCycle;
uint8 ysPercentage;
uint104 totalCvgLocked;
uint96 mgCvgAmount;
}
struct TrackingBalance {
uint128 ysToAdd;
uint128 ysToSub;
}
struct Checkpoints {
uint24 cycleId;
uint232 ysBalance;
}
struct TokenView {
uint256 tokenId;
uint128 startCycle;
uint128 endCycle;
uint256 cvgLocked;
uint256 ysActual;
uint256 ysTotal;
uint256 veCvgActual;
uint256 mgCvg;
uint256 ysPercentage;
}
struct LockingInfo {
uint256 tokenId;
uint256 cvgLocked;
uint256 lockEnd;
uint256 ysPercentage;
uint256 mgCvg;
}
function TDE_DURATION() external view returns (uint256);
function MAX_LOCK() external view returns (uint24);
function updateYsTotalSupply() external;
function ysTotalSupplyHistory(uint256) external view returns (uint256);
function ysShareOnTokenAtTde(uint256, uint256) external view returns (uint256);
function veCvgVotingPowerPerAddress(address _user) external view returns (uint256);
function mintPosition(
uint24 lockDuration,
uint128 amount,
uint8 ysPercentage,
address receiver,
bool isAddToManagedTokens
) external;
function increaseLockAmount(uint256 tokenId, uint128 amount, address operator) external;
function increaseLockTime(uint256 tokenId, uint256 durationAdd) external;
function increaseLockTimeAndAmount(uint256 tokenId, uint24 durationAdd, uint128 amount, address operator) external;
function totalSupplyYsCvgHistories(uint256 cycleClaimed) external view returns (uint256);
function balanceOfYsCvgAt(uint256 tokenId, uint256 cycle) external view returns (uint256);
function lockingPositions(uint256 tokenId) external view returns (LockingPosition memory);
function unlockingTimestampPerToken(uint256 tokenId) external view returns (uint256);
function lockingInfo(uint256 tokenId) external view returns (LockingInfo memory);
function isContractLocker(address contractAddress) external view returns (bool);
function getTotalSupplyAtAndBalanceOfYs(uint256 tokenId, uint256 cycleId) external view returns (uint256, uint256);
function getTotalSupplyHistoryAndBalanceOfYs(
uint256 tokenId,
uint256 cycleId
) external view returns (uint256, uint256);
}
文件 26 的 38:IOracleStruct.sol
pragma solidity ^0.8.0;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
interface IOracleStruct {
enum PoolType {
NOT_INIT,
STABLE,
CURVE_DUO,
CURVE_TRI,
UNI_V3,
UNI_V2
}
struct StableParams {
AggregatorV3Interface aggregatorOracle;
uint40 deltaLimitOracle;
uint56 maxLastUpdate;
uint128 minPrice;
uint128 maxPrice;
}
struct CurveDuoParams {
bool isReversed;
bool isEthPriceRelated;
address poolAddress;
uint40 deltaLimitOracle;
uint40 maxLastUpdate;
uint128 minPrice;
uint128 maxPrice;
address[] stablesToCheck;
}
struct CurveTriParams {
bool isReversed;
bool isEthPriceRelated;
address poolAddress;
uint40 deltaLimitOracle;
uint40 maxLastUpdate;
uint8 k;
uint120 minPrice;
uint128 maxPrice;
address[] stablesToCheck;
}
struct UniV2Params {
bool isReversed;
bool isEthPriceRelated;
address poolAddress;
uint80 deltaLimitOracle;
uint96 maxLastUpdate;
AggregatorV3Interface aggregatorOracle;
uint128 minPrice;
uint128 maxPrice;
address[] stablesToCheck;
}
struct UniV3Params {
bool isReversed;
bool isEthPriceRelated;
address poolAddress;
uint80 deltaLimitOracle;
uint80 maxLastUpdate;
uint16 twap;
AggregatorV3Interface aggregatorOracle;
uint128 minPrice;
uint128 maxPrice;
address[] stablesToCheck;
}
}
文件 27 的 38:IPresaleCvgSeed.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
interface IPresaleCvgSeed is IERC721Enumerable {
enum SaleState {
NOT_ACTIVE,
PRESEED,
SEED,
OVER
}
struct PresaleInfo {
uint256 vestingType;
uint256 cvgAmount;
}
function setSaleState(SaleState _saleState) external;
function grantPreseed(address _wallet, uint256 _amount) external;
function grantSeed(address _wallet, uint256 _amount) external;
function investMint(bool _isDai) external;
function presaleInfoTokenId(uint256 _tokenId) external view returns (PresaleInfo memory);
function saleState() external view returns (SaleState);
function tokenOfOwnerByIndex(address owner, uint256 index) external view override returns (uint256);
function getTokenIdAndType(
address _wallet,
uint256 _index
) external view returns (uint256 tokenId, uint256 typeVesting);
function getTokenIdsForWallet(address _wallet) external view returns (uint256[] memory);
function getTotalCvg() external view returns (uint256);
function withdrawFunds() external;
function withdrawToken(address _token) external;
}
文件 28 的 38:ISdAssets.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "./ICvgControlTower.sol";
import "./ISdtBuffer.sol";
interface IOperator {
function token() external view returns (IERC20Metadata);
function deposit(uint256 amount, bool isLock, bool isStake, address receiver) external;
}
interface ISdAsset is IERC20Metadata {
function sdAssetGauge() external view returns (IERC20);
function initialize(
ICvgControlTower _cvgControlTower,
IERC20 _sdAssetGauge,
string memory setName,
string memory setSymbol
) external;
function setSdAssetBuffer(address _sdAssetBuffer) external;
function mint(address to, uint256 amount) external;
function operator() external view returns (IOperator);
}
interface ISdAssetGauge is IERC20Metadata {
function deposit(uint256 value, address addr) external;
function deposit(uint256 value, address addr, bool claimRewards) external;
function staking_token() external view returns (IERC20);
function reward_count() external view returns (uint256);
function reward_tokens(uint256 i) external view returns (IERC20);
function claim_rewards(address account) external;
function set_rewards_receiver(address account) external;
function claimable_reward(address account, address token) external view returns (uint256);
function set_reward_distributor(address rewardToken, address distributor) external;
function deposit_reward_token(address rewardToken, uint256 amount) external;
function admin() external view returns (address);
function working_balances(address) external view returns (uint256);
function working_supply() external view returns (uint256);
}
文件 29 的 38:ISdtBlackHole.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./ICommonStruct.sol";
interface ISdtBlackHole {
function withdraw(uint256 amount, address receiver) external;
function setGaugeReceiver(address gaugeAddress, address bufferReceiver) external;
function getBribeTokensForBuffer(address buffer) external view returns (IERC20[] memory);
function pullSdStakingBribes(
address _processor,
uint256 _processorRewardsPercentage
) external returns (ICommonStruct.TokenAmount[] memory);
}
文件 30 的 38:ISdtBuffer.sol
pragma solidity ^0.8.0;
import "./ICvgControlTower.sol";
import "./ISdAssets.sol";
import "./ICommonStruct.sol";
interface ISdtBuffer {
function initialize(
ICvgControlTower _cvgControlTower,
address _sdAssetStaking,
ISdAssetGauge _sdGaugeAsset,
IERC20 _sdt
) external;
function pullRewards(address _processor) external returns (ICommonStruct.TokenAmount[] memory);
function processorRewardsPercentage() external view returns (uint256);
}
文件 31 的 38:ISdtFeeCollector.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ISdtFeeCollector {
function rootFees() external returns (uint256);
function withdrawToken(IERC20[] calldata _tokens) external;
function withdrawSdt() external;
}
文件 32 的 38:ISdtRewardDistributor.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./ICommonStruct.sol";
interface ISdtRewardDistributor {
function claimCvgSdtSimple(
address receiver,
uint256 cvgAmount,
ICommonStruct.TokenAmount[] memory sdtRewards,
uint256 minCvgSdtAmountOut,
bool isConvert
) external;
}
文件 33 的 38:ISdtStakingLogo.sol
pragma solidity ^0.8.0;
import "./ICommonStruct.sol";
interface ISdtStakingLogo {
struct LogoInfos {
uint256 tokenId;
string symbol;
uint256 pending;
uint256 totalStaked;
uint256 cvgClaimable;
ICommonStruct.TokenAmount[] sdtClaimable;
uint256 unlockingTimestamp;
}
struct LogoInfosFull {
uint256 tokenId;
string symbol;
uint256 pending;
uint256 totalStaked;
uint256 cvgClaimable;
ICommonStruct.TokenAmount[] sdtClaimable;
uint256 unlockingTimestamp;
uint256 claimableInUsd;
bool erroneousAmount;
bool isLocked;
uint256 hoursLock;
}
function _tokenURI(LogoInfos memory logoInfos) external pure returns (string memory output);
function getLogoInfo(uint256 tokenId) external view returns (ISdtStakingLogo.LogoInfosFull memory);
}
文件 34 的 38:ISdtStakingPositionManager.sol
pragma solidity ^0.8.0;
import "./ISdtStakingLogo.sol";
import "./ISdtStakingPositionService.sol";
interface ISdtStakingPositionManager {
struct ClaimSdtStakingContract {
ISdtStakingPositionService stakingContract;
uint256[] tokenIds;
}
function mint(address account) external;
function burn(uint256 tokenId) external;
function nextId() external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function checkMultipleClaimCompliance(ClaimSdtStakingContract[] calldata, address account) external view;
function checkTokenFullCompliance(uint256 tokenId, address account) external view;
function checkIncreaseDepositCompliance(uint256 tokenId, address account) external view;
function stakingPerTokenId(uint256 tokenId) external view returns (address);
function unlockingTimestampPerToken(uint256 tokenId) external view returns (uint256);
function logoInfo(uint256 tokenId) external view returns (ISdtStakingLogo.LogoInfos memory);
function getTokenIdsForWallet(address _wallet) external view returns (uint256[] memory);
}
文件 35 的 38:ISdtStakingPositionService.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./ICommonStruct.sol";
import "./ISdtBuffer.sol";
interface ISdtStakingPositionService {
struct CycleInfo {
uint256 cvgRewardsAmount;
uint256 totalStaked;
bool isSdtProcessed;
}
struct TokenInfo {
uint256 amountStaked;
uint256 pendingStaked;
}
struct CycleInfoMultiple {
uint256 totalStaked;
ICommonStruct.TokenAmount[] sdtClaimable;
}
struct StakingInfo {
uint256 tokenId;
string symbol;
uint256 pending;
uint256 totalStaked;
uint256 cvgClaimable;
ICommonStruct.TokenAmount[] sdtClaimable;
}
function setBuffer(address _buffer) external;
function stakingCycle() external view returns (uint256);
function cycleInfo(uint256 cycleId) external view returns (CycleInfo memory);
function stakingAsset() external view returns (ISdAssetGauge);
function buffer() external view returns (ISdtBuffer);
function tokenTotalStaked(uint256 _tokenId) external view returns (uint256 amount);
function stakedAmountEligibleAtCycle(
uint256 cvgCycle,
uint256 tokenId,
uint256 actualCycle
) external view returns (uint256);
function tokenInfoByCycle(uint256 cycleId, uint256 tokenId) external view returns (TokenInfo memory);
function stakingInfo(uint256 tokenId) external view returns (StakingInfo memory);
function getProcessedSdtRewards(uint256 _cycleId) external view returns (ICommonStruct.TokenAmount[] memory);
function deposit(uint256 tokenId, uint256 amount, address operator) external;
function claimCvgSdtMultiple(
uint256 _tokenId,
address operator
) external returns (uint256, ICommonStruct.TokenAmount[] memory);
}
文件 36 的 38:IVestingCvg.sol
pragma solidity ^0.8.0;
import "./IPresaleCvgSeed.sol";
interface IVestingCvg {
struct VestingSchedule {
uint16 daysBeforeCliff;
uint16 daysAfterCliff;
uint24 dropCliff;
uint256 totalAmount;
uint256 totalReleased;
}
struct InfoVestingTokenId {
uint256 amountReleasable;
uint256 totalCvg;
uint256 amountRedeemed;
}
enum VestingType {
SEED,
WL,
IBO,
TEAM,
DAO
}
function vestingSchedules(VestingType vestingType) external view returns (VestingSchedule memory);
function getInfoVestingTokenId(
uint256 _tokenId,
VestingType vestingType
) external view returns (InfoVestingTokenId memory);
function whitelistedTeam() external view returns (address);
function presaleSeed() external view returns (IPresaleCvgSeed);
function MAX_SUPPLY_TEAM() external view returns (uint256);
function startTimestamp() external view returns (uint256);
}
文件 37 的 38:IVotingPowerEscrow.sol
pragma solidity ^0.8.0;
interface IVotingPowerEscrow {
function create_lock(uint256 tokenId, uint256 value, uint256 unlockTime) external;
function increase_amount(uint256 tokenId, uint256 value) external;
function increase_unlock_time(uint256 tokenId, uint256 unlockTime) external;
function increase_unlock_time_and_amount(uint256 tokenId, uint256 unlockTime, uint256 amount) external;
function withdraw(uint256 tokenId) external;
function total_supply() external returns (uint256);
function balanceOf(uint256 tokenId) external view returns (uint256);
}
文件 38 的 38:IYsDistributor.sol
pragma solidity ^0.8.0;
import "./ICommonStruct.sol";
interface IYsDistributor {
struct TokenAmount {
IERC20 token;
uint96 amount;
}
struct Claim {
uint256 tdeCycle;
bool isClaimed;
TokenAmount[] tokenAmounts;
}
function getPositionRewardsForTdes(
uint256[] calldata _tdeIds,
uint256 actualCycle,
uint256 _tokenId
) external view returns (Claim[] memory);
}
{
"compilationTarget": {
"contracts/Token/CvgSDT.sol": "CvgSDT"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 250
},
"remappings": []
}
[{"inputs":[{"internalType":"contract ICvgControlTower","name":"_cvgControlTower","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cvgControlTower","outputs":[{"internalType":"contract ICvgControlTower","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sdt","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]