Skip to content

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

@bbenligiray

Description

@bbenligiray

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions