GoodFundManager

Has permissions to collect interest from the staking contracts and permissions to tell GoodMarketMaker to mint. Anyone can trigger the collection and minting process.

Events

StakingRewardSet

Emitted when admin sets the reward for particular staking contract.

event StakingRewardSet(
    uint32 _rewardsPerBlock,
    address _stakingAddress,
    uint32 _blockStart,
    uint32 _blockEnd,
    bool _isBlackListed
);

GasCostSet

Emitted when admin sets the gas cost for G$ minting.

event GasCostSet(uint256 newGasCost);

CollectInterestTimeThresholdSet

Emitted when admin sets the number that is used in a calculation of time after collectInterest method call.

event CollectInterestTimeThresholdSet(uint256 newCollectInterestTimeThreshold);

InterestMultiplierSet

Emitted when admin sets the multiplier.

event InterestMultiplierSet(uint8 newInterestMultiplier);

GasCostSet

Emitted when admin sets the gas cost for G$ minting.

event GasCostExceptInterestCollectSet(uint256 newGasCostExceptInterestCollect);

buy

Converts cDai tokens to GD tokens and updates the bonding curve params. The buy occurs only if the G$ return is above the given minimum. It is possible to buy only with cDAI and when the contract is set to active. MUST call to cDAI approve prior this action to allow this contract to accomplish the conversion.

Returns: How much G$ tokens were transferred.

function buy(
    uint256 _tokenAmount,
    uint256 _minReturn,
    address _targetAddress
) external returns (uint256);

collectInterest

Collects UBI interest in iToken from a given staking contract and transfers that interest to the reserve contract. Then transfers the given G$ which received from the reserve contract back to the staking contract and to the bridge, which locks the funds and then the G$ tokens are been minted to the given address on the sidechain.

function collectInterest(
	address[] calldata _stakingContracts,
	bool _forceAndWaiverRewards
) external;

calcSortedContracts

The function gets interest informations of staking contracts in the sorted array. By highest interest to lowest interest amount.

Returns: An array of struct instances. The struct explained below.

function calcSortedContracts() public view returns (InterestInfo[] memory);

mintReward

This function mint to users reward tokens which they earned by staking contract.

function mintReward(address _token, address _user) public;

Last updated