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

use the gonsForBalance function in transfer function of sOlympusE… #131

Merged
merged 1 commit into from
Dec 24, 2021

Conversation

bajpai244
Copy link

…RC20.sol, instead of writing the code again

The first line of the transfer function in the sOlympusERC20.sol contract
calculates the gonValue of the given fragments represented by the
value parameter.

The contract has a function gonsForBalance for this purpose and using
this can help maintain consistency in the codebase and can help avoid
any bugs in the future if gonsForBalance goes through some change!

old code =>

uint256 gonValue = value.mul( _gonsPerFragment );

new change =>

uint256 gonValue = gonsForBalance(value);

…RC20.sol, instead of writing the code again

The first line of transfer function in the sOlympusERC20.sol contract
calculates the gonValue of the given fragments representated by the
value parameter.

The contract has a function `gonsForBalance` for this purpose and using
this can help maintain consistency in the codebase and can help avoid
any bugs in future if `gonsForBalance` goes through some change!

old code =>

```
uint256 gonValue = value.mul( _gonsPerFragment );
```

new change =>

```
uint256 gonValue = gonsForBalance(value);
```
@bajpai244
Copy link
Author

can someone please review this 👀

@olyzeus
Copy link
Contributor

olyzeus commented Dec 24, 2021

smart!

@olyzeus olyzeus merged commit f614d9e into OlympusDAO:Version-1.1 Dec 24, 2021
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