Skip to content

Commit

Permalink
Merge pull request #38 from stc-community/op
Browse files Browse the repository at this point in the history
Fix  cod call contract and site param
  • Loading branch information
rovast authored Aug 9, 2023
2 parents 331e911 + 6dd4469 commit a66d221
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 275 deletions.
10 changes: 9 additions & 1 deletion src/components/Modal/cod-call.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const getCurrentSiteName = () => {
throw new Error("No site selected!");
}
return "s" + relay?.name.substring(2) || "";
return "gw" + relay?.name.substring(2) || "";
};
const handleSubmit = async () => {
Expand All @@ -70,6 +70,14 @@ const handleSubmit = async () => {
listenIfNeeded();
try {
// console.log(
// data.requestID,
// getCurrentSiteName(),
// `${domain.value}${data.requestPath}`,
// "GET",
// window.btoa(data.requestData)
// );
const transaction = await contract.CallCOD(
data.requestID,
getCurrentSiteName(),
Expand Down
2 changes: 1 addition & 1 deletion src/config/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const chains: Chain[] = [

meshContract: "0x7A338445C1eAE2f13E294C28050541686187Cd5F",

codContract: "0x98e7f2Bc989Bd181a009DA780C83A78e00AD9549",
codContract: "0x0F5F6485F20E41325ce4feBBFCE92DCd47aF08Ea",

stcMarketContract: "0xE972F4bB8313102bFEF7Fe1F7adfC6Ae2Bc0f933",
stcMarketTokenContract: "0xc07f40758d3bb0f8B8E4C4d146f79265484ba6Fe",
Expand Down
237 changes: 124 additions & 113 deletions src/utils/contract/cod-abi.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,17 @@
[
{
"inputs": [],
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_requestID",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_siteName",
"type": "string"
"internalType": "uint256",
"name": "_fee",
"type": "uint256"
},
{
"internalType": "string",
"name": "_url",
"type": "string"
},
{
"internalType": "string",
"name": "_httpMethod",
"type": "string"
},
{
"internalType": "string",
"name": "_requestData",
"type": "string"
"internalType": "address",
"name": "_link",
"type": "address"
}
],
"name": "CallCOD",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
Expand Down Expand Up @@ -83,29 +54,6 @@
"name": "ChainlinkRequested",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_requestId",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_requestUID",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_stringData",
"type": "string"
}
],
"name": "fulfill",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
Expand Down Expand Up @@ -145,106 +93,79 @@
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"internalType": "string",
"name": "name",
"type": "string"
"indexed": true,
"internalType": "bytes32",
"name": "requestId",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "job",
"name": "data",
"type": "string"
},
{
"internalType": "address",
"name": "oracle",
"type": "address"
}
],
"name": "registerSite",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
"name": "RequestFulfilled",
"type": "event"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_requestUID",
"name": "_requestID",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_siteName",
"type": "string"
},
{
"internalType": "string",
"name": "_method",
"type": "string"
},
{
"internalType": "string",
"name": "_url",
"type": "string"
},
{
"internalType": "string",
"name": "_headers",
"name": "_httpMethod",
"type": "string"
},
{
"internalType": "string",
"name": "_requestData",
"type": "string"
},
{
"internalType": "string",
"name": "_func",
"type": "string"
}
],
"name": "request",
"name": "CallCOD",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "bytes32",
"name": "requestId",
"name": "_requestUID",
"type": "bytes32"
},
{
"indexed": true,
"internalType": "string",
"name": "data",
"type": "string"
}
],
"name": "RequestFulfilled",
"type": "event"
},
{
"inputs": [
"name": "GetResultData",
"outputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
"internalType": "string",
"name": "",
"type": "string"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdrawLink",
"name": "acceptOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
Expand All @@ -267,31 +188,35 @@
"name": "currentKey",
"outputs": [
{
"internalType": "string",
"internalType": "bytes32",
"name": "",
"type": "string"
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_requestId",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "_requestUID",
"type": "bytes32"
}
],
"name": "GetResultData",
"outputs": [
},
{
"internalType": "string",
"name": "",
"name": "_stringData",
"type": "string"
}
],
"stateMutability": "view",
"name": "fulfill",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
Expand All @@ -306,5 +231,91 @@
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "string",
"name": "job",
"type": "string"
},
{
"internalType": "address",
"name": "oracle",
"type": "address"
}
],
"name": "registerSite",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_requestUID",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_siteName",
"type": "string"
},
{
"internalType": "string",
"name": "_method",
"type": "string"
},
{
"internalType": "string",
"name": "_url",
"type": "string"
},
{
"internalType": "string",
"name": "_headers",
"type": "string"
},
{
"internalType": "string",
"name": "_requestData",
"type": "string"
},
{
"internalType": "string",
"name": "_func",
"type": "string"
}
],
"name": "request",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "withdrawLink",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
Loading

0 comments on commit a66d221

Please sign in to comment.