forked from FILL-Lab/FILL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1,update filterUserMiners 2,update task script
- Loading branch information
john.yang
committed
Feb 2, 2023
1 parent
b4e6e58
commit f13d0c6
Showing
9 changed files
with
1,278 additions
and
1,201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
{ | ||
"language": "Solidity", | ||
"settings": { | ||
"optimizer": { | ||
"enabled": true, | ||
"runs": 2000 | ||
}, | ||
"outputSelection": { | ||
"*": { | ||
"": ["ast"], | ||
"*": ["abi", "metadata", "devdoc", "userdoc", "storageLayout", "evm.legacyAssembly", "evm.bytecode", "evm.deployedBytecode", "evm.methodIdentifiers", "evm.gasEstimates", "evm.assembly"] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fa = require("@glif/filecoin-address"); | ||
const { utils } = require("ethers"); | ||
const { task } = require("hardhat/config"); | ||
const { callRpc, hexToBytes } = require("./common"); | ||
|
||
task("fill-fillInfo", "fillInfo") | ||
.addParam("contractaddress", "The FILLContract address") | ||
.setAction(async (taskArgs) => { | ||
const contractAddr = taskArgs.contractaddress; | ||
const FILLContract = await ethers.getContractFactory("FILL"); | ||
//Get signer information | ||
const accounts = await ethers.getSigners(); | ||
const signer = accounts[0]; | ||
|
||
const FILLContractContract = new ethers.Contract( | ||
contractAddr, | ||
FILLContract.interface, | ||
signer | ||
); | ||
const fillInfo = await FILLContractContract.fillInfo(); | ||
console.log("fillInfo:", fillInfo); | ||
}); | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const util = require("util"); | ||
const request = util.promisify(require("request")); | ||
|
||
async function callRpc(url, method, params) { | ||
var options = { | ||
method: "POST", | ||
url: url, | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
jsonrpc: "2.0", | ||
method: method, | ||
params: params, | ||
id: 1, | ||
}), | ||
}; | ||
const res = await request(options); | ||
return JSON.parse(res.body).result; | ||
} | ||
|
||
function hexToBytes(hex) { | ||
for (var bytes = [], c = 0; c < hex.length; c += 2) | ||
bytes.push(parseInt(hex.substr(c, 2), 16)); | ||
return new Uint8Array(bytes); | ||
} | ||
|
||
module.exports = { | ||
callRpc, | ||
hexToBytes, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
exports.getAddress = require("./get-address"); | ||
|
||
exports.sendCoin = require("./FILL/send-coin"); | ||
exports.fill = require("./fill"); | ||
|
||
exports.minerInfo = require("./Miner/miner-info"); |
Oops, something went wrong.