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

IApi3Pool.getUser() returned variable naming is misleading #310

Open
bbenligiray opened this issue Feb 10, 2023 · 0 comments
Open

IApi3Pool.getUser() returned variable naming is misleading #310

bbenligiray opened this issue Feb 10, 2023 · 0 comments

Comments

@bbenligiray
Copy link
Member

This is the Api3Pool.getUser() signature

function getUser(address userAddress)
        external
        view
        returns (
            uint256 unstaked,
            uint256 vesting,
            uint256 unstakeAmount,
            uint256 unstakeShares,
            uint256 unstakeScheduledFor,
            uint256 lastDelegationUpdateTimestamp,
            uint256 lastProposalTimestamp
            )

and this is the IApi3Pool.getUser() signature

function getUser(address userAddress)
        external
        view
        returns (
            uint256 unstaked,
            uint256 vesting,
            uint256 unstakeShares,
            uint256 unstakeAmount,
            uint256 unstakeScheduledFor,
            uint256 lastDelegationUpdateTimestamp,
            uint256 lastProposalTimestamp
            );

Note that the names of the third and fourth returned variables are swapped around. This means that when the user is calling getUser() of an Api3Pool contract, they should expect unstakeAmount to be the third returned variable and unstakeShares to be the fourth returned variable (in other words, disregard the IApi3Pool.getUser() version).
This doesn't affect Api3Pool functionality, and the Etherscan UI already prefers the Api3Pool.getUser() signature over IApi3Pool.getUser() signature. This issue only concerns contracts and off-chain apps that depend on IApi3Pool.

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

1 participant