Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FEI #12

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Add FEI #12

wants to merge 9 commits into from

Conversation

Joeysantoro
Copy link

No description provided.

it("Incentives active on borrowing", async () => {
// The admin + emissions manager can't be the same address due to proxy restrictions
// so we change it
await (await incentivesController.connect(feiDao).changeAdmin(FEI_HOLDER)).wait();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use the contract interface of the Proxy.
You can use this code to easily load the right function ABI and execute the transaction:

    const adminProxyAbi = ['function changeAdmin(address newOwner)'];
    const adminProxyInterface = new ethers.utils.Interface(adminProxyAbi);
    const encodedChangeAdmin = adminProxyInterface.encodeFunctionData('changeAdmin', [FEI_HOLDER]);
    await (
      await feiDao.sendTransaction({ data: encodedChangeAdmin, to: incentivesController.address })
    ).wait();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the changeAdmin function to the IAaveIncentivesController interface to make this code work, but your solution is more transparent so I'll change it

await (
await incentivesController
.connect(feiDao)
.configureAssets([VARIABLE_DEBT_TOKEN], [parseEther('100')])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to get the real variableDebtToken address. The VARIABLE_DEBT_TOKEN gets placed under a proxy when the asset is listed. Also, set an smaller emission or you will cause an index overflow.

    const feiReserveData = await pool.getReserveData(fei.address);
    const emission = parseEther('0.00002');
    await (
      await incentivesController
        .connect(feiDao)
        .configureAssets([feiReserveData.variableDebtTokenAddress], [emission])
    ).wait();

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By real do you mean the address of the proxy or the implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proxy address

@miguelmtzinf
Copy link
Collaborator

I am missing the IAaveIncentivesController interface in the repo. Could you please add it to the contracts/assetListing/interfaces folder?
https://github.com/aave/incentives-proposal/blob/master/contracts/interfaces/IAaveIncentivesController.sol
You will need to also include the IAaveDistributionManager and the DistributionTypes

@Joeysantoro
Copy link
Author

am missing the IAaveIncentivesController interface in the repo. Could you please add it to the contracts/assetListing/interfaces folder?
https://github.com/aave/incentives-proposal/blob/master/contracts/interfaces/IAaveIncentivesController.sol
You will need to also include the IAaveDistributionManager and the DistributionTypes

Done, I didn't include DistributionTypes because those are only used in the impl not the interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants