Closed dcsan closed 3 years ago
the other traits
etc are coming from the IPFS hash so that's not secure to read from
Contract will have a getDna(tokenId) method.
It will have to be queried and assigned here in the react app. Then it should be available for use. useEffect(() => { const updateYourCollectibles = async ()
I did add that method, but it's not available in the debug contracts UI.
mintItem
is there but not rollToMint
http://localhost:3000/debugcontracts
Does it need to be declared in the ABI.json?
can you compile your contract and try again. That should update your ABI. I see only the ERC721 methods and none of our custom methods
I've updated the contract but new methods don't show up in the front-end.
Do i need to manually copy across the ABI file?
I noticed hardhat generates
artifacts/contracts/YourCollectible.sol/YourCollectible.json
but that the front end react uses
packages/react-app/src/contracts/YourCollectible.abi.js
so they're in different formats, in different places... surely an easier way or what am I missing?
I did yarn compile; yarn deploy
and updated the contract address
I manually edited the ABI
now I can call it but:
looks like the right version of contract isn't getting called:
Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":145,\"error\":{\"code\":-32603,\"message\":\"Transaction reverted: function selector was not recognized and there's no fallback function\"}}", error={"code":-32603}, requestBody="{\"method\":\"eth_call\",\"params\":[{\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x67d269191c92caf3cd7723f116c85e6e9bf55933\",\"data\":\"0x8da5cb5b\"},\"latest\"],\"id\":145,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:8545", code=SERVER_ERROR, version=web/5.3.0)
at Logger.makeError (index.ts:213) at Logger.throwError (index.ts:225) at index.ts:284 at Generator.next (<anonymous>) at fulfilled (index.ts:2)
Give me sometime and I will check and update. There must be an easy way.
On Wed, Aug 25, 2021, 8:45 PM DC @.***> wrote:
I manually edited the ABI but it looks like somehow the right version of contract isn't getting called?
Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":145,\"error\":{\"code\":-32603,\"message\":\"Transaction reverted: function selector was not recognized and there's no fallback function\"}}", error={"code":-32603}, requestBody="{\"method\":\"eth_call\",\"params\":[{\"from\":\"0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266\",\"to\":\"0x67d269191c92caf3cd7723f116c85e6e9bf55933\",\"data\":\"0x8da5cb5b\"},\"latest\"],\"id\":145,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:8545", code=SERVER_ERROR, version=web/5.3.0) at Logger.makeError (index.ts:213) at Logger.throwError (index.ts:225) at index.ts:284 at Generator.next (
) at fulfilled (index.ts:2) — You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/GraphemeNFT/rarible-scaffold/issues/15#issuecomment-905597747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQPVAG7PLPDB3E6CCEIQYLT6UCIDANCNFSM5CZF5ASA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .
Looks like we need to run hardhat\scripts\publish.js to populate contracts to react-app. But am getting an error on executing the script
finally. Update as this diff and then run publish-contracts.txt yarn publish-contracts
yeah that seems to get the function to show up in the dynamic "contract debugger" UI now, but calling it does nothing. it doesn't throw an error though, which is a big step forward!
getDNA
is working.
when the client renders it gets basic info from the contract, ie the object has these properties below
however I don't think the other properties (such as DNA) are automatically exposed / available. perhaps we need to call the
getDNA
on the object to read those values?or can certain properties be always exposed by default?