Skip to main content

ClaimTransfer

Git Source

Title: Tech Holding JSC Claim Transfer Contract

This contract is used to fractionalize pOLY claims and transfer portions of a user's claim to other addresses

State Variables

pOLY

IPOLY public pOLY

GVI

ERC20 public GVI

DAI

ERC20 public DAI

gGVI

IgGVI public gGVI

fractionalizedTerms

mapping(address => Term) public fractionalizedTerms

allowance

mapping(address => mapping(address => uint256)) public allowance

Functions

constructor

constructor(address poly_, address gvi_, address dai_, address ggvi_) ;

fractionalizeClaim

Convert pOLY claim that can only be fully transfered to a new wallet to a fractionalized claim

function fractionalizeClaim() external;

claim

Claim GVI from the pOLY contract via your fractionalized claim

function claim(uint256 amount_) external;

Parameters

NameTypeDescription
amount_uint256Amount of DAI to send to the pOLY contract

redeemableFor

Calculate the amount of GVI that can be redeemed for a given address's fractionalized claim

function redeemableFor(address user_) external view returns (uint256, uint256);

Parameters

NameTypeDescription
user_addressAddress of the user

Returns

NameTypeDescription
<none>uint256uint256 The amount of GVI the account can redeem
<none>uint256uint256 The amount of DAI required to claim the amount of GVI

approve

Approve a spender to spend a certain amount of your fractionalized claim (denominated in the percent value of a Term)

function approve(address spender_, uint256 amount_) external returns (bool);

Parameters

NameTypeDescription
spender_addressAddress of the spender
amount_uint256Amount of your fractionalized claim to approve

Returns

NameTypeDescription
<none>boolbool

transfer

Transfer a portion of your fractionalized claim to another address

Transferring a portion of your claim transfers both based on the percentage and claimable amount of GVI. The recipient will receive a claimable amount of GVI commensurate to the percentage of the sender's max claim ignoring what the sender has already claimed. Say the sender has a percent of 10_000 and a max claim of 100 GVI. They claim 10 GVI, leaving 90 GVI claimable. If they transfer 50% of their claim (5_000), the recipient gets a max value of 55 and the commensurate gClaimed so they have a true claimable amount of 50 GVI. The sender's fractionalized claim is updated to reflect the transfer.

function transfer(address to_, uint256 amount_) external returns (bool);

Parameters

NameTypeDescription
to_addressAddress of the recipient
amount_uint256Amount of your fractionalized claim to transfer

Returns

NameTypeDescription
<none>boolbool

transferFrom

Transfer a portion of a fractionalized claim from another address to a recipient (must have approval)

Transferring a portion of your claim transfers both based on the percentage and claimable amount of GVI. The recipient will receive a claimable amount of GVI commensurate to the percentage of the sender's max claim ignoring what the sender has already claimed. Say the sender has a percent of 10_000 and a max claim of 100 GVI. They claim 10 GVI, leaving 90 GVI claimable. If they transfer 50% of their claim (5_000), the recipient gets a max value of 55 and the commensurate gClaimed so they have a true claimable amount of 50 GVI. The sender's fractionalized claim is updated to reflect the transfer.

function transferFrom(address from_, address to_, uint256 amount_) external returns (bool);

Parameters

NameTypeDescription
from_addressAddress of the sender
to_addressAddress of the recipient
amount_uint256Amount of the sender's fractionalized claim to transfer

Returns

NameTypeDescription
<none>boolbool

_transfer

function _transfer(address from_, address to_, uint256 amount_) internal;

Errors

CT_IllegalClaim

error CT_IllegalClaim();

Structs

Term

struct Term {
uint256 percent; // PRECISION = 1_000_000 (i.e. 5000 = 0.5%)
uint256 gClaimed; // Rebase agnostic # of tokens claimed
uint256 max; // Maximum nominal GVI amount claimable
}