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

Code review/v2 #6

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

Code review/v2 #6

wants to merge 2 commits into from

Conversation

giladHaimov
Copy link

No description provided.


// Mint stCORE and send to users
uint256 stCore = _exchangeSTCore(amount);
bytes memory callData = abi.encodeWithSignature("mint(address,uint256)", account, stCore);
Copy link
Author

Choose a reason for hiding this comment

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

@jackcrypto9527 @falcon2048 the only benefit I see in issuing a low-level call is removing the need for an explicit interface, I am not sure this interface justifies the bother.
Now as long as we do not implement fallback() there's no security concern. if the parameter signature ever changes in the destination file the operation will revert either way.
But as a general rule though I try to avoid low-level calls whenever possible. it's just harder to read and maintain. Using high-level calls also protects you from spelling errors which are possible in the low-level approach.

Also note that there's no need for adding new files, you can interleave an interface definition within the calling contract e.g.:

interface ISTCore is IERC20 {
function mint(address, uint256) external;
function burn(address,uint256) external;
}

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