PatrickAlphaC/rwa-creator

amountOfTokensToMint (uint256) not working

Closed this issue · 3 comments

Whenever I put a greater value of 0 into the amountOfTokensToMint I get the following error in the screenshot:

Screenshot 2024-06-25 at 12 00 16 AM

As a result, I get a failed or dropped Contract interaction:

Screenshot 2024-06-25 at 12 00 51 AM

The function has access controls, specifically:

    /**
     * @notice Sends an HTTP request for character information
     * @dev If you pass 0, that will act just as a way to get an updated portfolio balance
     * @return requestId The ID of the request
     */
    function sendMintRequest(uint256 amountOfTokensToMint)
        external
        onlyOwner               // HERE
        whenNotPaused     // HERE
        returns (bytes32 requestId)
    {

So only the owner can mint tokens. You are likely not using the owner account.

Please, please, please test this all locally before attempting to do transactions with this codebase on-chain.

@PatrickAlphaC I took off the access controls as part of my testing and I was still running into the following above issues. I am currently in the process of testing locally.

As, @PatrickAlphaC has mentioned, instead of testing on actual testnet, you should test using local anvil node. And also, instead of interacting with the functions via scripts, first test the functions using the targeted unit tests.

In the Base_Test.t.sol file, there's a test named as testCanSendMintRequestWithTslaBalance.

So, when you're executing that test using the command:

forge test --match-test testCanSendMintRequestWithTslaBalance

What is the error that you're getting in your console?