Skip to main content

pOLY

Git Source

Inherits: IPOLY, Policy, [RolesConsumer](/main/contracts/docs/src/modules/ROLES/Tech Holding JSCRoles.sol/abstract.RolesConsumer)

State Variables

MINTR

MINTRv1 public MINTR

TRSRY

TRSRYv1 public TRSRY

previous

IPreviousPOLY public previous

previousGenesis

IGenesisClaim public previousGenesis

GVI

ERC20 public GVI

gGVI

IgGVI public gGVI

DAI

ERC20 public DAI

dao

address public dao

terms

mapping(address => Term) public terms

walletChange

mapping(address => address) public walletChange

totalAllocated

uint256 public totalAllocated

maximumAllocated

uint256 public maximumAllocated

PERCENT_PRECISION

uint256 public constant PERCENT_PRECISION = 1_000_000

GVI_PRECISION

uint256 public constant GVI_PRECISION = 1_000_000_000

DAI_PRECISION

uint256 public constant DAI_PRECISION = 1_000_000_000_000_000_000

Functions

constructor

constructor(
Kernel kernel_,
address previous_,
address previousGenesis_,
address gvi_,
address ggvi_,
address dai_,
address dao_,
uint256 maximumAllocated_
) Policy(kernel_);

configureDependencies

Define module dependencies for this policy.

function configureDependencies() external override returns (Keycode[] memory dependencies);

Returns

NameTypeDescription
dependenciesKeycode[]- Keycode array of module dependencies.

requestPermissions

Function called by kernel to set module function permissions.

function requestPermissions() external view override returns (Permissions[] memory permissions);

Returns

NameTypeDescription
permissionsPermissions[]requests - Array of keycodes and function selectors for requested permissions.

claim

Claims vested GVI by exchanging DAI

function claim(address to_, uint256 amount_) external;

Parameters

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

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_) public view returns (uint256);

Parameters

NameTypeDescription
account_addressThe account to check the redeemable amount for

Returns

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

redeemableFor

Calculates the current amount a user is eligible to redeem

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

Parameters

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

Returns

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

getCirculatingSupply

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

function getCirculatingSupply() public view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint256 GVI circulating supply

getAccountClaimed

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

function getAccountClaimed(address account_) public view returns (uint256);

Parameters

NameTypeDescription
account_addressThe account to check the claim for

Returns

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

getAccountClaimed

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

function getAccountClaimed(Term memory accountTerms_) public view returns (uint256);

Parameters

NameTypeDescription
accountTerms_TermThe terms of the account to check the claim for

Returns

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

validateClaim

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

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

Parameters

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

Returns

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

migrate

Migrates claim data from old pOLY contracts to this one

function migrate(address[] calldata accounts_) external onlyRole("poly_admin");

Parameters

NameTypeDescription
accounts_address[]Array of accounts to migrate

migrateGenesis

Migrates claim data from the Genesis Claim contract to this one

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 onlyRole("poly_admin");

Parameters

NameTypeDescription
accounts_address[]Array of accounts to migrate

setTerms

Sets the claim terms for an account

function setTerms(address account_, uint256 percent_, uint256 gClaimed_, uint256 max_)
public
onlyRole("poly_admin");

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 gGVI the account has claimed
max_uint256The maximum amount of GVI the account can claim

_claim

function _claim(uint256 amount_) internal returns (uint256 toSend);