Skip to content

Commit

Permalink
deployed contract on dojima and integrate abi in app
Browse files Browse the repository at this point in the history
  • Loading branch information
karankulshrestha committed Apr 16, 2023
1 parent 6733a69 commit 4dc15b8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
30 changes: 30 additions & 0 deletions dojimaABI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[
{
"inputs": [
{
"internalType": "string",
"name": "dataHash",
"type": "string"
},
{
"internalType": "string",
"name": "fileHash",
"type": "string"
},
{
"internalType": "string",
"name": "name",
"type": "string"
}
],
"name": "createToken",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
}
]
3 changes: 2 additions & 1 deletion src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { ethers } from "ethers";
import Web3Modal from "web3modal";
import { dataChainAddress } from "../../config";
import UserData from "../../artifacts/contracts/Data.sol/UserData.json";
import dojimaABI from "../../dojimaABI.json"

const Form = () => {
const [thumbnail, setThumbnail] = useState("");
Expand All @@ -28,7 +29,7 @@ const Form = () => {
const connection = await web3Modal.connect();
const provider = new ethers.providers.Web3Provider(connection);
const signer = provider.getSigner();
let contract = new ethers.Contract(dataChainAddress, UserData.abi, signer);
let contract = new ethers.Contract("0x7B3fE25c6572eb375570d47a7812a1CF4563b973", dojimaABI, signer);
const amount = { value: ethers.utils.parseEther("0.01") };
let transaction = await contract.createToken(
dataHash,
Expand Down

0 comments on commit 4dc15b8

Please sign in to comment.