diff --git a/boba_community/hc-twitter/contracts/AuthenticatedFaucet.sol b/boba_community/hc-twitter/contracts/AuthenticatedFaucet.sol index 519d412228..67ac4294bc 100644 --- a/boba_community/hc-twitter/contracts/AuthenticatedFaucet.sol +++ b/boba_community/hc-twitter/contracts/AuthenticatedFaucet.sol @@ -17,8 +17,8 @@ contract AuthenticatedFaucet is Ownable { uint256 lastEpochStart; uint256 amountClaimsInLastEpoch; uint256 maxClaimsPerEpoch; - uint256 testnetETHPerClaim; - uint256 bobaTokenPerClaim; + uint256 public testnetETHPerClaim; + uint256 public bobaTokenPerClaim; event GasClaimed(uint256 authorId); diff --git a/boba_community/hc-twitter/hardhat.config.ts b/boba_community/hc-twitter/hardhat.config.ts index a4e62ba136..7df35383b4 100644 --- a/boba_community/hc-twitter/hardhat.config.ts +++ b/boba_community/hc-twitter/hardhat.config.ts @@ -17,6 +17,14 @@ const config: HardhatUserConfig = { url: 'https://goerli.boba.network', accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], }, + boba_bnb_testnet: { + url: 'https://testnet.bnb.boba.network', + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, + boba_avax_testnet: { + url: 'https://testnet.avax.boba.network/', + accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], + }, boba_rinkeby: { url: 'https://rinkeby.boba.network', accounts: process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [], diff --git a/boba_community/hc-twitter/scripts/change_settings.ts b/boba_community/hc-twitter/scripts/change_settings.ts new file mode 100644 index 0000000000..5680b08aba --- /dev/null +++ b/boba_community/hc-twitter/scripts/change_settings.ts @@ -0,0 +1,40 @@ +import hre, { artifacts, ethers } from 'hardhat' +import { ContractFactory, providers, Wallet } from 'ethers' +// @ts-ignore +import TuringHelperFactoryJson from './abis/TuringHelperFactory.json' +import FaucetFactoryJson from '../artifacts/contracts/AuthenticatedFaucet.sol/AuthenticatedFaucet.json' +import { parseEther } from 'ethers/lib/utils' + +const cfg = hre.network.config + +async function main() { + const local_provider = new providers.JsonRpcProvider(cfg['url']) + const testPrivateKey = process.env.PRIVATE_KEY_FAUCET ?? '0x___________' + const testWallet = new Wallet(testPrivateKey, local_provider) + + const faucetFactory = new ContractFactory( + FaucetFactoryJson.abi, + FaucetFactoryJson.bytecode, + testWallet + ).attach('0x5f6D019832FA4522DB7b94A4fe0DDBb73212FAcE') + + console.log("OWNER: ", await faucetFactory.owner()) + + /*const helperAddr = await faucetFactory.turingHelper() + + const turingFactory = new ContractFactory( + TuringHelperFactoryJson.abi, + TuringHelperFactoryJson.bytecode, + testWallet + ).attach(helperAddr)*/ + + const tx = await faucetFactory.setConfig('https://o9gvgzsjw5.execute-api.us-east-1.amazonaws.com/Prod/', 10, + ethers.utils.parseEther('2'), ethers.utils.parseEther('0.02')); + const res = await tx.wait() + console.log('updated config', res) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +})