7. Deploy Integration Contract (optional)

Guide to deploy an integration contract and connecting it to a vPool. You can ask Kiln to deploy an integration contract for you or deploy it yourself.

If you want to deploy it yourself ask Kiln to give the right to deploy using the IntegrationFactory and give us the address you want as deployer.

Deploying a new integration contract

Kiln or your can deploy an Integration contract using a deployer account on the IntegrationFactory:

/// @notice Deploy a proxy for the implementation of a Native vPool integration contract
function deployNative20vPoolIntegration(address proxyOwner, Native20Configuration calldata config) external returns (address);

/// @notice Deploy a proxy for the implementation of a liquid ERC20 aToken vPool integration contract
function deployLiquid20AvPoolIntegration(address proxyOwner, Native20Configuration calldata config) external returns (address);

/// @notice Deploy a proxy for the implementation of a liquid ERC20 cToken vPool integration contract
function deployLiquid20CvPoolIntegration(address proxyOwner, Native20Configuration calldata config) external returns (address);

These function use the following structs:

struct Native20Configuration {
    string name;
    string symbol;
    address admin;
    address[] pools;
    uint256[] poolFees;
    address[] commissionRecipients;
    uint256[] commissionDistribution;
    uint256[] poolPercentages;
    uint256 maxCommissionBps;
    uint256 monoTicketThreshold;
}

Let's go through all of them one by one:

Common parameters :

  • name : An ERC-20 style display name of the token.

  • symbol : an ERC-20 style display symbol of the token.

  • admin : The address of the admin. This account can change the fees, and commissionRecipient as well as add pools and enable/disable them.

  • pools : List of underlying pools addresses. Those are the pools to which the staked funds will flow to. You must provide at least one pool.

  • poolFees : List of fee for each pool, in basis points. Must be the same length as pools. The fee for a single pool must not exceed maxCommissionBps.

  • commissionRecipients : List of addresses to which the accumulated integrator fee will be dispatched.

  • commissionDistribution : List of the share of the fee each commissionRecipient will receive, in basis points, must add up to 10 000. Must be the the same length as commissionRecipients.

  • maxCommissionBps : A limit on the pool fee given at initialization so the stakers can be sure the fee will never go above a certain level.

  • poolPercentages : The desired repartitions of ETH between the pools. In basis points, must add up to 10 000. Must be the same length as pools. This can be changed by the admin.

  • monoTicketThreshold : A value that modify the behaviour of requestExit() when the contract is connected to multiple pools, when exiting we want to limit the number of tickets minted for gas efficiency but we also want to limit the imbalance caused by not exiting through all the pools using the the configured poolPercentages. If a user requests the exit of an ETH amount below monoTicketThreshold the code will try to exit through only one pool if possible thus minting only one ticket hence the name monoTicketThreshold. This value can be changed later on by the admin as the TVL grows and the pools can support bigger exit without significant imbalance.

cast: deploy a native20

from=DEPLOYER


cast send <factory address> \
"deployNative20vPoolIntegration(address,(string,string,address,address[],uint256[],address[],uint256[],uint256[],uint256,uint256))(address)" \
<proxy admin address> "('TEST ETH','stakedETH',<admin address>,[<pool address>],[1000],[<fee recipient address>],[10000],[10000],2000,1ether)" --rpc-url $RPC-URL
  • You can add the -i flag to interactively provide the private key for the transaction

  • You can add --ledger --from YOUR_ADDRESS to use a Ledger device to perform the transaction

Allow the integration contract to deposit to the pool

If you are using Kiln's pool ask us to allow your contract to deposit to our pool.

If you manage your pool, allow your integration contract to deposit on the vPool by calling this function :

function allowDepositor(address depositorAddress, bool allowed) external
cast : allowDepositor

from=FACTORY_ADMIN

cast send <pool address> "allowDepositor(address,bool)" \
<integration contract address> true  
  • You can add the -i flag to interactively provide the private key for the transaction

  • You can add --ledger --from YOUR_ADDRESS to use a Ledger device to perform the transaction

Last updated