Skip to main content

IPOLY

Git Source

Functions

terms

function terms(address account_) external view returns (uint256, uint256, uint256);

claim

Claims vested OHM by exchanging DAI

function claim(address to_, uint256 amount_) external;

Parameters

NameTypeDescription
to_addressAddress to send OHM to
amount_uint256DAI amount to exchange for OHM

pushWalletChange

Pushes entirety of a user's claim to a new address

function pushWalletChange(address newAddress_) external;

Parameters

NameTypeDescription
newAddress_addressAddress to send claim to

pullWalletChange

Pulls a queued wallet change

function pullWalletChange(address oldAddress_) external;

Parameters

NameTypeDescription
oldAddress_addressAddress to pull change from

redeemableFor

Calculates the current amount a user is eligible to redeem

function redeemableFor(address account_) external view returns (uint256);

Parameters

NameTypeDescription
account_addressThe account to check the redeemable amount for

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM the account can redeem

redeemableFor

Calculates the current amount a user is eligible to redeem

function redeemableFor(Term memory accountTerms_) external view returns (uint256);

Parameters

NameTypeDescription
accountTerms_TermThe terms of the account to check the redeemable amount for

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM the account can redeem

getCirculatingSupply

Returns a calculation of OHM circulating supply to be used to determine vested positions

function getCirculatingSupply() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 OHM circulating supply

getAccountClaimed

Calculates the effective amount of OHM claimed taking into consideration rebasing since claim

function getAccountClaimed(address account_) external returns (uint256);

Parameters

NameTypeDescription
account_addressThe account to check the claim for

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM the account has claimed

getAccountClaimed

Calculates the effective amount of OHM claimed taking into consideration rebasing since claim

function getAccountClaimed(Term memory accountTerms_) external returns (uint256);

Parameters

NameTypeDescription
accountTerms_TermThe terms of the account to check the claim for

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM the account has claimed

validateClaim

Calculates the amount of OHM to send to the user and validates the claim

function validateClaim(uint256 amount_, Term memory accountTerms_) external view returns (uint256);

Parameters

NameTypeDescription
amount_uint256The amount of DAI to exchange for OHM
accountTerms_TermThe terms to check the claim against

Returns

NameTypeDescription
<none>uint256uint256 The amount of OHM to send to the user

migrate

Migrates claim data from old pOLY contracts to this one

Can only be called by the poly_admin role

function migrate(address[] calldata accounts_) external;

Parameters

NameTypeDescription
accounts_address[]Array of accounts to migrate

migrateGenesis

Migrates claim data from the Genesis Claim contract to this one

Can only be called by the poly_admin role

The Genesis Claim contract originally did not count the full claimed amount as staked, only 90% of it, given that there is no longer a staking rate, we can combine the two claim contracts by counting the 10% that wasn't considered staked as staked at the current index

function migrateGenesis(address[] calldata accounts_) external;

Parameters

NameTypeDescription
accounts_address[]Array of accounts to migrate

setTerms

Sets the claim terms for an account

Can only be called by the poly_admin role

function setTerms(address account_, uint256 percent_, uint256 gClaimed_, uint256 max_) external;

Parameters

NameTypeDescription
account_addressThe account to set the terms for
percent_uint256The percent of the circulating supply the account is entitled to
gClaimed_uint256The amount of gOHM the account has claimed
max_uint256The maximum amount of OHM the account can claim

Events

Claim

event Claim(address indexed account, address indexed to, uint256 amount);

Transfer

event Transfer(address indexed from, address indexed to, uint256 amount);

WalletChange

event WalletChange(address indexed account, address indexed newAddress, bool isPull);

TermsSet

event TermsSet(address indexed account, uint256 percent, uint256 gClaimed, uint256 max);

Errors

POLY_NoClaim

error POLY_NoClaim();

POLY_AlreadyHasClaim

error POLY_AlreadyHasClaim();

POLY_NoWalletChange

error POLY_NoWalletChange();

POLY_AllocationLimitViolation

error POLY_AllocationLimitViolation();

POLY_ClaimMoreThanVested

error POLY_ClaimMoreThanVested(uint256 vested_);

POLY_ClaimMoreThanMax

error POLY_ClaimMoreThanMax(uint256 max_);

Structs

GenesisTerm

struct GenesisTerm {
uint256 percent;
uint256 claimed;
uint256 gClaimed;
uint256 max;
}

Term

struct Term {
uint256 percent;
uint256 gClaimed;
uint256 max;
}