sablier-labs / docs

Documentation and guides for Sablier
https://docs.sablier.com
GNU General Public License v3.0
15 stars 7 forks source link

Named parameters not working in ERC-20 approval #107

Closed codenamejason closed 8 months ago

codenamejason commented 8 months ago

Link for reference: https://docs.sablier.com/contracts/v2/guides/local-environment

In the LockupLinearStreamCreatorTest.t.sol file it shows on line 40 -->

creator.DAI().approve({ spender: address(creator), amount: 1337e18 });

This test fails with the following error: Compiler run failed: Error (4974): Named argument "amount" does not match function declaration.

I updated it to the following to pass the test:

creator.DAI().approve(address(creator), 1337e18);
PaulRBerg commented 8 months ago

Hi @codenamejason, thanks for taking the time to report this.

This seems like a dependency issue, i.e., the implementation of ERC-20 you are using has the amount parameter named differently. Make sure that you're using the latest versions of the submodules by running this reinit function.

Or maybe you are intentionally using a different ERC-20 implementation? In this case, you just have to rename amount to something else.

At any rate, see what named function parameters are.