Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions IPFS.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;

contract IPFSCaller {
function storeDataOnIPFS(string memory data) public {
bytes32 ipfsHash = addDataToIPFS(data);
emit LogIPFSHash(ipfsHash);
}

event LogIPFSHash(bytes32 ipfsHash);

function addDataToIPFS(string memory data) private returns (bytes32) {
// Your code to send the data to IPFS and return the hash goes here.
// This is just an example and not a working implementation.
return 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef;
}
}