The Whitehat Contract this script regards: https://github.com/BitySA/whetcwithdraw
This script is intended to withdraw Whitehat ETC.
- Clone this repo and cd into it
- Install Hardhat
npm install hardhat
- add this information to ./hardhat.config.js:
require("@nomicfoundation/hardhat-toolbox");
privateKey1 = ""; //replace empty string with your account private key
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.19",
networks: {
etc: {
url: "https://etc.rivet.link",
accounts: [privateKey1],
},
},
};
- copy the getMyEtc.js script file into the ./scripts folder (if the scripts folder is not there, create it first)
- Add your private key to the privateKey1 variable string in the above code
- to do a dry run, comment out these two lines of code in the getMyEtc.js script:
var tx = await myContract.withdraw(myAccount, percentPaidToWhiteHats);
console.log(tx);
- run
npx hardhat run getMyEtc.js --network etc