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

[NES-255] make pUSD a ComponentToken #97

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open

[NES-255] make pUSD a ComponentToken #97

wants to merge 35 commits into from

Conversation

ungaro
Copy link
Contributor

@ungaro ungaro commented Nov 13, 2024

What's new in this PR?

make pUSD a ComponentToken.

need to have a second look and add tests..

WIP

@ungaro ungaro requested a review from eyqs November 13, 2024 21:06
@ungaro ungaro changed the title make pUSD a ComponentToken [NES-255] make pUSD a ComponentToken Nov 13, 2024
nest/src/token/pUSD.sol Outdated Show resolved Hide resolved
nest/src/token/pUSD.sol Outdated Show resolved Hide resolved
nest/src/token/pUSD.sol Show resolved Hide resolved
@ungaro ungaro requested a review from eyqs November 14, 2024 21:27
Copy link
Member

@eyqs eyqs left a comment

Choose a reason for hiding this comment

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

LGTM

address(pUSDToken),
abi.encodeCall(pUSD.initialize, (NEST_ADMIN_ADDRESS, IERC20(USDC_ADDRESS), VAULT_ADDRESS))
);

Copy link
Member

Choose a reason for hiding this comment

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

Remove deploying pUSD here since we have a different script to deploy pUSD

function convertToShares(
uint256 assets
) public view virtual override returns (uint256) {
return _convertToShares(assets, Math.Rounding.Floor);
Copy link
Member

Choose a reason for hiding this comment

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

Check which should be Floor and which should be Ceil

return _balances[account];
}

function setBeforeTransferHook(
Copy link
Member

Choose a reason for hiding this comment

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

Don't need

if (newVault == address(0)) {
revert InvalidVault();
}

Copy link
Member

Choose a reason for hiding this comment

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

Could add supportsInterface check here for ERC-20 (imo unnecessary)

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