Skip to content

Commit

Permalink
import full ABI for contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid Ateir committed Apr 26, 2024
1 parent 2112dff commit a0521fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions infrastructure/local-setup-preparation/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { utils } from 'zksync-ethers';
import { ethers } from 'ethers';
import * as fs from 'fs';
import * as path from 'path';
import { ValidatorTimelockFactory } from '../../../contracts/l1-contracts/typechain/ValidatorTimelockFactory';
import { StateTransitionManagerFactory } from '../../../contracts/l1-contracts/typechain/StateTransitionManagerFactory';

interface WalletKey {
address: string;
Expand Down Expand Up @@ -29,14 +31,12 @@ async function getContractInstances() {

if (!contractCache.stm) {
const stateTransitionManagerAddr = await contractCache.contractMain.getStateTransitionManager();
const stmABI = ['function validatorTimelock() view returns (address)'];
contractCache.stm = new ethers.Contract(stateTransitionManagerAddr, stmABI, ethProvider);
contractCache.stm = StateTransitionManagerFactory.connect(stateTransitionManagerAddr, ethProvider);
}

if (!contractCache.validatorTimelock) {
const validatorTimelockAddr = await contractCache.stm.validatorTimelock();
const validatorTimelockABI = ['function validators(uint256, address) view returns (bool)'];
contractCache.validatorTimelock = new ethers.Contract(validatorTimelockAddr, validatorTimelockABI, ethProvider);
contractCache.validatorTimelock = ValidatorTimelockFactory.connect(validatorTimelockAddr, ethProvider);
}

return {
Expand Down

0 comments on commit a0521fc

Please sign in to comment.