hypercerts-org / hypercerts

Hypercerts are a tool to build scalable retrospective reward systems for impact.
https://hypercerts.org/
Other
91 stars 28 forks source link

Error (5704): Type is not callable #1308

Closed positonic closed 4 months ago

positonic commented 4 months ago

Which area(s) of Hypercerts are affected? (leave empty if unsure)

Smart Contracts

To Reproduce

I am importing HypercertMinter.sol into my Foundry project

import {HypercertMinter} from "hypercerts-contracts/HypercertMinter.sol";

and running tests.

Describe the Bug

When I try to run my tests I get this error:

Error: 
Compiler run failed:
Error (5704): Type is not callable
   --> /Users/james/code/hyperstaker-mono/lib/hypercerts/contracts/contracts/SemiFungible1155.sol:241:39:
    |
241 |     _beforeUnitTransfer(_msgSender(), owners(_tokenID), fromIDs, toIDs, values, "");

Owners is being called like a function, when it's actually a mapping.

I believe the line should be updated to be:

_beforeUnitTransfer(_msgSender(), owners[_tokenID], fromIDs, toIDs, values, "");

Expected Behavior

The code should run without error

bitbeckers commented 4 months ago

I believe you're importing from the wrong dir. In the src dir the contract have the correct brackets: https://github.com/hypercerts-org/hypercerts/blob/7671d06762c929bc2890a31e5dc392f8a30065c6/contracts/src/protocol/SemiFungible1155.sol#L338

Not sure why it's in this that in the contracts/contracts file you're referring to but I created a ticket to remove them: #1309

positonic commented 4 months ago

It's working with the contracts in hypercerts/contracts/src/protocol/ Thanks!