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
const { expect } = require("chai"); | |
describe('Staking', function () { | |
beforeEach(async function() { | |
[owner, wallet1, wallet2] = await ethers.getSigners(); | |
Staking = await ethers.getContractFactory('Staking', owner); | |
Wbtc = await ethers.getContractFactory('Wbtc', wallet1); | |
staking = await Staking.deploy(); | |
wbtc = await Wbtc.deploy(); |
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
const axios = require('axios') | |
const { ethers } = require('ethers') | |
const address = '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599' | |
const apiKey = '' | |
const url = `https://api.etherscan.io/api?module=contract&action=getabi&address=${address}&apikey=${apiKey}` | |
const infuraUrl = '' | |
const getAbi = async () => { | |
const res = await axios.get(url) |
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
INFURA_URL=<your_url> | |
ETHERSCAN_API_KEY=<your_api_key> |
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
INFURA_URL_TESTNET=<your_url_and_key> |
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
INFURA_URL_TESTNET= | |
WALLET_ADDRESS= | |
WALLET_SECRET= |
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
INFURA_URL_TESTNET= | |
WALLET_ADDRESS= | |
WALLET_SECRET= |
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
INFURA_URL_TESTNET= | |
WALLET_ADDRESS= | |
WALLET_SECRET= |
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
{ | |
"name": "client", | |
"version": "0.1.0", | |
"private": true, | |
"dependencies": { | |
"@testing-library/jest-dom": "^5.16.4", | |
"@testing-library/react": "^13.2.0", | |
"@testing-library/user-event": "^13.5.0", | |
"bootstrap": "^5.1.3", | |
"ethers": "^5.6.6", |
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
WALLET_ADDRESS= | |
WALLET_SECRET= | |
INFURA_TEST_URL= |
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
async function main() { | |
[signer1, signer2] = await ethers.getSigners(); | |
const Staking = await ethers.getContractFactory('Staking', signer1); | |
staking = await Staking.deploy({ | |
value: ethers.utils.parseEther('10') | |
}); | |
console.log("Staking contract deployed to:", staking.address, "by", signer1.address) |
OlderNewer