Skip to content

[N1] - Whitelisted contracts can mint arbitrarily large amounts of debt tokens #114

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

Closed
lutr0 opened this issue Apr 5, 2023 · 2 comments
Closed
Assignees

Comments

@lutr0
Copy link
Contributor

lutr0 commented Apr 5, 2023

The role of the whitelisted contracts is not completely clear to us. There is only one related comment in DebtToken.sol :

// stores SC addresses that are allowed to mint/burn the token (AMO strategies, L2 suppliers)
mapping(address => bool) public whitelistedContracts;

These contracts can mint debt tokens without depositing any collateral calling DebtToken::mintFromWhitelistedContract. This could be a serious problem if such a contract was malicious. Also, even if these contracts work as expected, minting debt tokens without providing any collateral could have a serious impact on the price of the debt token.

@lutr0
Copy link
Contributor Author

lutr0 commented Apr 5, 2023

We want in the future to allow selected AMM smart contracts to mint/burn to reduce the volatility of the debtToken (e.g. minting when overpeg and burning when lower)

@0xfornax 0xfornax self-assigned this Apr 6, 2023
@0xfornax
Copy link
Collaborator

0xfornax commented Apr 6, 2023

Also, one of our design choices for our L2 future is to allow the creation of contracts that would be able to mint debt tokens and send them to a supported L2. When users borrow on the L2 they would receive these pre-minted tokens instead of minting on the L2 (which would require creating a new token on each L2). This would allow the tokens to be bridged as a single token instance and avoid having multiple ones that would require swapping solutions and cause broken liquidity.

Those future contracts would go through a new round of audits before being deployed and used on the system.

@0xfornax 0xfornax closed this as completed Apr 6, 2023
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

No branches or pull requests

2 participants