Skip to main content

ClaimTransfer

Git Source

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;

OHM

ERC20 public OHM;

DAI

ERC20 public DAI;

gOHM

IgOHM public gOHM;

fractionalizedTerms

mapping(address => Term) public fractionalizedTerms;

allowance

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

Functions

constructor

constructor(address poly_, address ohm_, address dai_, address gohm_);

fractionalizeClaim

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

function fractionalizeClaim() external;

claim

Claim OHM 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 OHM 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 OHM the account can redeem
<none>uint256uint256 The amount of DAI required to claim the amount of OHM

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 OHM. The recipient will receive a claimable amount of OHM 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 OHM. They claim 10 OHM, leaving 90 OHM 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 OHM. 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 OHM. The recipient will receive a claimable amount of OHM 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 OHM. They claim 10 OHM, leaving 90 OHM 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 OHM. 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;
uint256 gClaimed;
uint256 max;
}