-
Notifications
You must be signed in to change notification settings - Fork 33
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
base: master
Are you sure you want to change the base?
Add FEI #12
Conversation
test/test-listing-fei.spec.ts
Outdated
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(); |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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
test/test-listing-fei.spec.ts
Outdated
await ( | ||
await incentivesController | ||
.connect(feiDao) | ||
.configureAssets([VARIABLE_DEBT_TOKEN], [parseEther('100')]) |
There was a problem hiding this comment.
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();
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proxy address
I am missing the IAaveIncentivesController interface in the repo. Could you please add it to the |
Done, I didn't include DistributionTypes because those are only used in the impl not the interface |
No description provided.