move to Alchemy node

This commit is contained in:
Drygin 2022-02-16 12:52:53 +03:00
parent 9ff6229ebd
commit bffcaeacb9
6 changed files with 34 additions and 27 deletions

View File

@ -1,3 +1,4 @@
ALCHEMY_KEY=
etherscan_api_key= etherscan_api_key=
goerli_rpc_key= goerli_rpc_key=
mainnet_rpc_key= mainnet_rpc_key=

2
.gitignore vendored
View File

@ -107,3 +107,5 @@ artifacts
cache cache
coverage coverage
coverage.json coverage.json
.vscode

View File

@ -80,6 +80,8 @@ yarn deploy:proposal:test <factory address>
The last step, or first depending on if you are simply proposing the proposal, is taking the address of the deployed proposal and calling: The last step, or first depending on if you are simply proposing the proposal, is taking the address of the deployed proposal and calling:
// THIS IS ASSUMING YOU HAVE ENOUGH LOCKED TORN TO PROPOSE
```bash ```bash
yarn propose <proposal address> yarn propose <proposal address>
``` ```

View File

@ -37,7 +37,7 @@ module.exports = {
networks: { networks: {
hardhat: { hardhat: {
forking: { forking: {
url: `https://mainnet.infura.io/v3/${process.env.mainnet_rpc_key}`, url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`,
blockNumber: process.env.use_latest_block == 'true' ? undefined : 13017436, blockNumber: process.env.use_latest_block == 'true' ? undefined : 13017436,
}, },
loggingEnabled: false, loggingEnabled: false,

View File

@ -29,7 +29,7 @@ describe('Deployments test setup', () => {
let TornadoInstanceFactoryContract let TornadoInstanceFactoryContract
/// HARDCODED /// HARDCODED // TODO take from config
let denominations = [ let denominations = [
'33333333333333333333', '33333333333333333333',
'333333333333333333333', '333333333333333333333',
@ -145,13 +145,15 @@ describe('Deployments test setup', () => {
gasLimit: BigNumber.from('30000000'), gasLimit: BigNumber.from('30000000'),
} }
await GovernanceContract.execute(id, overrides) await GovernanceContract.execute(id, overrides)
expect(await GovernanceContract.state(id)).to.be.equal(ProposalState.Executed)
}) })
it('Should set correct params for factory', async () => { it('Should set correct params for factory', async () => {
expect(await TornadoInstanceFactoryContract.verifier()).to.equal(Verifier) expect(await TornadoInstanceFactoryContract.verifier()).to.equal(Verifier)
expect(await TornadoInstanceFactoryContract.hasher()).to.equal(Hasher) expect(await TornadoInstanceFactoryContract.hasher()).to.equal(Hasher)
expect(await TornadoInstanceFactoryContract.merkleTreeHeight()).to.equal(20) expect(await TornadoInstanceFactoryContract.merkleTreeHeight()).to.equal(20)
clog(await TornadoInstanceFactoryContract.implementation()) // clog(await TornadoInstanceFactoryContract.implementation())
}) })
it('Factory should be able to generate an instance without reverting', async () => { it('Factory should be able to generate an instance without reverting', async () => {
@ -251,11 +253,11 @@ describe('Deployments test setup', () => {
secret: rbigint(31), secret: rbigint(31),
}) })
const note = toHex(depo.preimage, 62) // const note = toHex(depo.preimage, 62)
const noteString = `tornado-RAI-33-1-${note}` // const noteString = `tornado-RAI-33-1-${note}`
clog('Note: ', note) // clog('Note: ', note)
clog('Note string: ', noteString) // clog('Note string: ', noteString)
clog('Commitment: ', toHex(depo.commitment)) // clog('Commitment: ', toHex(depo.commitment))
await expect(RAIToken.approve(TornadoProxy.address, pE(5000000))).to.not.be.reverted await expect(RAIToken.approve(TornadoProxy.address, pE(5000000))).to.not.be.reverted
TornadoInstance = await ethers.getContractAt( TornadoInstance = await ethers.getContractAt(
@ -300,11 +302,11 @@ describe('Deployments test setup', () => {
nullifier: rbigint(31), nullifier: rbigint(31),
secret: rbigint(31), secret: rbigint(31),
}) })
const note = toHex(depo.preimage, 62) // const note = toHex(depo.preimage, 62)
const noteString = `tornado-RAI-33-1-${note}` // const noteString = `tornado-RAI-33-1-${note}`
clog('Note: ', note) // clog('Note: ', note)
clog('Note string: ', noteString) // clog('Note string: ', noteString)
clog('Commitment: ', toHex(depo.commitment)) // clog('Commitment: ', toHex(depo.commitment))
const proxy = await TornadoProxy.connect(accounts[i]) const proxy = await TornadoProxy.connect(accounts[i])
await expect(() => await expect(() =>
@ -337,7 +339,7 @@ describe('Deployments test setup', () => {
await ethers.provider.send('hardhat_reset', [ await ethers.provider.send('hardhat_reset', [
{ {
forking: { forking: {
jsonRpcUrl: `https://mainnet.infura.io/v3/${process.env.mainnet_rpc_key}`, jsonRpcUrl: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`,
blockNumber: process.env.use_latest_block == 'true' ? undefined : 13017436, blockNumber: process.env.use_latest_block == 'true' ? undefined : 13017436,
}, },
}, },

View File

@ -101,7 +101,7 @@ describe('Deployments test setup', () => {
expect(await TornadoInstanceFactoryContract.verifier()).to.equal(Verifier) expect(await TornadoInstanceFactoryContract.verifier()).to.equal(Verifier)
expect(await TornadoInstanceFactoryContract.hasher()).to.equal(Hasher) expect(await TornadoInstanceFactoryContract.hasher()).to.equal(Hasher)
expect(await TornadoInstanceFactoryContract.merkleTreeHeight()).to.equal(20) expect(await TornadoInstanceFactoryContract.merkleTreeHeight()).to.equal(20)
clog(await TornadoInstanceFactoryContract.implementation()) // clog(await TornadoInstanceFactoryContract.implementation())
}) })
it('Factory should be able to generate an instance without reverting', async () => { it('Factory should be able to generate an instance without reverting', async () => {
@ -260,11 +260,11 @@ describe('Deployments test setup', () => {
secret: rbigint(31), secret: rbigint(31),
}) })
const note = toHex(depo.preimage, 62) // const note = toHex(depo.preimage, 62)
const noteString = `tornado-RAI-33-1-${note}` // const noteString = `tornado-RAI-33-1-${note}`
clog('Note: ', note) // clog('Note: ', note)
clog('Note string: ', noteString) // clog('Note string: ', noteString)
clog('Commitment: ', toHex(depo.commitment)) // clog('Commitment: ', toHex(depo.commitment))
await expect(RAIToken.approve(TornadoProxy.address, pE(5000000))).to.not.be.reverted await expect(RAIToken.approve(TornadoProxy.address, pE(5000000))).to.not.be.reverted
TornadoInstance = await ethers.getContractAt( TornadoInstance = await ethers.getContractAt(
@ -309,11 +309,11 @@ describe('Deployments test setup', () => {
nullifier: rbigint(31), nullifier: rbigint(31),
secret: rbigint(31), secret: rbigint(31),
}) })
const note = toHex(depo.preimage, 62) // const note = toHex(depo.preimage, 62)
const noteString = `tornado-RAI-33-1-${note}` // const noteString = `tornado-RAI-33-1-${note}`
clog('Note: ', note) // clog('Note: ', note)
clog('Note string: ', noteString) // clog('Note string: ', noteString)
clog('Commitment: ', toHex(depo.commitment)) // clog('Commitment: ', toHex(depo.commitment))
const proxy = await TornadoProxy.connect(accounts[i]) const proxy = await TornadoProxy.connect(accounts[i])
await expect(() => await expect(() =>
@ -346,7 +346,7 @@ describe('Deployments test setup', () => {
await ethers.provider.send('hardhat_reset', [ await ethers.provider.send('hardhat_reset', [
{ {
forking: { forking: {
jsonRpcUrl: `https://mainnet.infura.io/v3/${process.env.mainnet_rpc_key}`, jsonRpcUrl: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`,
blockNumber: process.env.use_latest_block == 'true' ? undefined : 13017436, blockNumber: process.env.use_latest_block == 'true' ? undefined : 13017436,
}, },
}, },