Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results for cid solidity
Search options not deleted
0 votes
2 answers
364 views

correct solidity type for a cid?

Im writing a function in solidity where the user enters a CID from an IPFS link, which looks like: QmcQvCyLAncpEzvmYtKfvVPVayGqFvTQrYpUpPAJeoXGke So far im using string type, and it works. … Which is the correct and most efficient type for a CID? (int / uint?, bytes? ) function storeCID(string memory cid) public returns (uint256){ // some login here... } …
Xunorus's user avatar
0 votes

How to store IPFS hash using bytes32?

i < hashLength; ++i) { hashString[i + 2] = sha256Hash_[i]; } return Base58.encodeToString(hashString); } More examples in the repo: https://github.com/0x00000002/ipfs-cid-solidity
tikonoff's user avatar
  • 330
1 vote
1 answer
2k views

Storing IPFS hash in solidity

I'm storing IPFS hash in solidity using this guide https://www.reddit.com/r/ethdev/comments/6lbmhy/a_practical_guide_to_cheap_ipfs_hash_storage_in/ const cid = "QmNXnCWPS2szLaQGVA6TFtiUAJB2YnFTJJFTXPGuc4wocQ … pragma solidity ^0.4.4; contract Hello { bytes32 x; function getBytes() returns(bytes32){ return x; } function setBytes(bytes32 b) { x = b; } } …
Slim Shady's user avatar
0 votes
3 answers
3k views

Metadata not showing up for ERC-721 OpenSea NFT

Here is my smart contract: // SPDX-License-Identifier: MIT pragma solidity ^ 0.8.10; //import Open Zepplin contracts import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts … I am sure I did not use the jpeg CID. …
e n's user avatar
  • 41
0 votes
1 answer
2k views

nft images not showing on opensea

I created 13 images and corresponding JSON files uploaded the images to pinata then changed the file_url in the JSON file to cid of the image "ipfs://cid/image.png" uploaded the json file as well. changed … owner.address); console.log("Owner has tokens: ", tokens); } main() .then(() => process.exit(0)) .catch((error) => { console.error(error); process.exit(1); }); and here is my contract pragma solidity
ajkatom's user avatar
  • 11
1 vote
1 answer
311 views

Information lost when getting string from byte32 Solidiy smart contract

_id)); // Its logs 'M' }); Here is the solidity code: pragma solidity ^0.4.21; contract test2 { bytes32 public _id; event LogTestCase( bytes32 _id ); function setID(bytes32 … cId) returns (bool){ _id = cId; emit LogTestCase(_id); return true; } } Now when I put '1234' as a parameter, fetching it from the contract event results in 'M'. …
Apar Adhikari's user avatar
0 votes
1 answer
192 views

ERC721Burnable TypeError: Definition of base has to precede definition of derived contract

@openzeppelin/contracts/token/ERC721/ERC721Burnable.sol:12:46: abstract contract ERC721Burnable is Context, ERC721 ^----^ ERC-721 Contract pragma solidity … (uint256 tokenId) public view returns (string memory) { require(_exists(tokenId), "ERC721Metadata: CID query for nonexistent token"); string memory _CID = _CIDS[tokenId]; return _CID …
piña's user avatar
  • 209
0 votes
2 answers
976 views

Updatable attributes for ERC721 Tokens without touching to immutable rarity attributes

I just have to upload metadata files into an IPFS bucket and put CID into my contract as constant variable (so even me, the owner of the contract, will not be able to update them). … I never ear about a Solidity file fetcher or even JSON parser. Generate 2 tokens linked each other When a user will mint a token, I'll in fact mint 2. …
Arthur's user avatar
  • 194
1 vote

Metadata not showing up for ERC-721 OpenSea NFT

man you are missing a slash / pragma solidity ^ 0.8.10; //import Open Zepplin contracts import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import … create an NFT function mint() public returns (uint256) { _tokenIds += 1; _safeMint(msg.sender, _tokenIds); return _tokenIds; } //in the function below include the CID
baibars313's user avatar