-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from subspace/ft/deployFaucetOnNova
Deploy faucet on nova
- Loading branch information
Showing
10 changed files
with
189 additions
and
6 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
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
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 @@ | ||
import { addressBook, ethers, network } from 'hardhat' | ||
|
||
async function main() { | ||
const [deployer] = await ethers.getSigners() | ||
const deployerAddress = await deployer.getAddress() | ||
|
||
let faucetAddressIfDeployed: string | undefined = undefined | ||
faucetAddressIfDeployed = addressBook.retrieveContract('Faucet', network.name) | ||
if (network.name === 'localhost' || network.name === 'hardhat') | ||
faucetAddressIfDeployed = '0x5FbDB2315678afecb367f032d93F642f64180aa3' | ||
|
||
const faucet = await ethers.getContractAt('Faucet', faucetAddressIfDeployed, deployer) | ||
const addMinter = await faucet.addMinter(deployerAddress) | ||
console.log('addMinter txHash', addMinter.hash) | ||
|
||
const receipt = await addMinter.wait() | ||
console.log('receipt', receipt) | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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,14 @@ | ||
import { ethers } from 'hardhat' | ||
|
||
async function main() { | ||
const randomWallet = ethers.Wallet.createRandom() | ||
|
||
console.log('randomWallet.address', randomWallet.address) | ||
console.log('randomWallet.privateKey', randomWallet.privateKey) | ||
console.log('randomWallet.mnemonic', randomWallet.mnemonic) | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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,22 @@ | ||
import { addressBook, ethers, network } from 'hardhat' | ||
|
||
async function main() { | ||
const [deployer] = await ethers.getSigners() | ||
|
||
let faucetAddressIfDeployed: string | undefined = undefined | ||
faucetAddressIfDeployed = addressBook.retrieveContract('Faucet', network.name) | ||
if (network.name === 'localhost' || network.name === 'hardhat') | ||
faucetAddressIfDeployed = '0x5FbDB2315678afecb367f032d93F642f64180aa3' | ||
|
||
const faucet = await ethers.getContractAt('Faucet', faucetAddressIfDeployed, deployer) | ||
const lockTime = await faucet.lockTime() | ||
console.log('lockTime', lockTime.toString()) | ||
|
||
const withdrawalAmount = await faucet.withdrawalAmount() | ||
console.log('withdrawalAmount', withdrawalAmount.toString()) | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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,29 @@ | ||
import { addressBook, ethers, network } from 'hardhat' | ||
|
||
async function main() { | ||
const [deployer] = await ethers.getSigners() | ||
const deployerAddress = await deployer.getAddress() | ||
const deployerBalance = await deployer.provider.getBalance(deployerAddress) | ||
console.log('deployerBalance', deployerBalance) | ||
|
||
let faucetAddressIfDeployed: string | undefined = undefined | ||
faucetAddressIfDeployed = addressBook.retrieveContract('Faucet', network.name) | ||
if (network.name === 'localhost' || network.name === 'hardhat') | ||
faucetAddressIfDeployed = '0x5FbDB2315678afecb367f032d93F642f64180aa3' | ||
|
||
const faucet = await ethers.getContractAt('Faucet', faucetAddressIfDeployed, deployer) | ||
|
||
const requestTokens = await faucet.requestTokens(deployerAddress) | ||
console.log('requestTokens txHash', requestTokens.hash) | ||
|
||
const receipt = await requestTokens.wait() | ||
console.log('receipt', receipt) | ||
|
||
const deployerBalanceFinal = await deployer.provider.getBalance(deployerAddress) | ||
console.log('deployerBalance', deployerBalanceFinal) | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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,45 @@ | ||
import { addressBook, ethers, network } from 'hardhat' | ||
|
||
const SECONDS_BETWEEN_REQUEST = 60 * 60 * 24 | ||
const AMOUNT_BY_REQUEST = ethers.parseEther('0.2') | ||
|
||
async function main() { | ||
const [deployer] = await ethers.getSigners() | ||
const deployerAddress = await deployer.getAddress() | ||
|
||
let faucetAddressIfDeployed: string | undefined = undefined | ||
faucetAddressIfDeployed = addressBook.retrieveContract('Faucet', network.name) | ||
if (network.name === 'localhost' || network.name === 'hardhat') | ||
faucetAddressIfDeployed = '0x5FbDB2315678afecb367f032d93F642f64180aa3' | ||
|
||
const faucet = await ethers.getContractAt('Faucet', faucetAddressIfDeployed, deployer) | ||
|
||
const lockTime = await faucet.lockTime() | ||
console.log('lockTime', lockTime.toString()) | ||
|
||
const setLockTime = await faucet.setLockTime(SECONDS_BETWEEN_REQUEST) | ||
console.log('setLockTime txHash', setLockTime.hash) | ||
|
||
const receipt = await setLockTime.wait() | ||
console.log('receipt', receipt) | ||
|
||
const lockTimeFinal = await faucet.lockTime() | ||
console.log('lockTimeFinal', lockTimeFinal.toString()) | ||
|
||
const withdrawalAmount = await faucet.withdrawalAmount() | ||
console.log('withdrawalAmount', withdrawalAmount.toString()) | ||
|
||
const setWithdrawalAmount = await faucet.setWithdrawalAmount(AMOUNT_BY_REQUEST) | ||
console.log('setWithdrawalAmount txHash', setWithdrawalAmount.hash) | ||
|
||
const receipt2 = await setWithdrawalAmount.wait() | ||
console.log('receipt', receipt2) | ||
|
||
const withdrawalAmountFinal = await faucet.withdrawalAmount() | ||
console.log('withdrawalAmountFinal', withdrawalAmountFinal.toString()) | ||
} | ||
|
||
main().catch((error) => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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