Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up safe abi
  • Loading branch information
spsjvc committed Aug 8, 2024
commit 402c223578c70908e8fe0c48142e7ea93d5a95e5
3 changes: 1 addition & 2 deletions src/abi/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { rollupAdminLogicABI } from './rollupAdminLogicABI';
import { safeL2ABI } from './safeL2ABI';

export { rollupAdminLogicABI, safeL2ABI };
export { rollupAdminLogicABI };
2 changes: 1 addition & 1 deletion src/abi/safeL2ABI.ts → src/contracts/GnosisSafeL2.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://sepolia.arbiscan.io/address/0x3e5c63644e683549055b9be8653de26e0b4cd36e#code
export const safeL2ABI = [
export const gnosisSafeL2ABI = [
{
anonymous: false,
inputs: [
Expand Down
5 changes: 3 additions & 2 deletions src/getBatchPosters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import {
import { rollupCreatorABI } from './contracts/RollupCreator';
import { sequencerInboxABI } from './contracts/SequencerInbox';
import { upgradeExecutorABI } from './contracts/UpgradeExecutor';
import { safeL2ABI } from './abi';
import { gnosisSafeL2ABI } from './contracts/GnosisSafeL2';

import { createRollupFetchTransactionHash } from './createRollupFetchTransactionHash';

const createRollupABI = getAbiItem({ abi: rollupCreatorABI, name: 'createRollup' });
Expand All @@ -24,7 +25,7 @@ const setIsBatchPosterFunctionSelector = getFunctionSelector(setIsBatchPosterABI
const executeCallABI = getAbiItem({ abi: upgradeExecutorABI, name: 'executeCall' });
const upgradeExecutorExecuteCallFunctionSelector = getFunctionSelector(executeCallABI);

const execTransactionABI = getAbiItem({ abi: safeL2ABI, name: 'execTransaction' });
const execTransactionABI = getAbiItem({ abi: gnosisSafeL2ABI, name: 'execTransaction' });
const safeL2FunctionSelector = getFunctionSelector(execTransactionABI);

const ownerFunctionCalledEventAbi = getAbiItem({
Expand Down
6 changes: 4 additions & 2 deletions src/getBatchPosters.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ import {
} from 'viem';
import { arbitrum, arbitrumSepolia } from 'viem/chains';
import { it, expect, vi, describe } from 'vitest';
import { safeL2ABI } from './abi';

import { gnosisSafeL2ABI } from './contracts/GnosisSafeL2';
import { sequencerInboxABI } from './contracts/SequencerInbox';

import { sequencerInboxPrepareFunctionData } from './sequencerInboxPrepareTransactionRequest';
import { getBatchPosters } from './getBatchPosters';

Expand Down Expand Up @@ -124,7 +126,7 @@ function upgradeExecutorSetBatchPosterHelper(args: [Address, boolean]) {
function safeSetBatchPosterHelper(args: [Address, boolean]) {
const bytes = upgradeExecutorSetBatchPosterHelper(args);
return encodeFunctionData({
abi: safeL2ABI,
abi: gnosisSafeL2ABI,
functionName: 'execTransaction',
args: [
rollupAddress,
Expand Down
5 changes: 3 additions & 2 deletions src/getValidators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {

import { rollupCreatorABI } from './contracts/RollupCreator';
import { upgradeExecutorABI } from './contracts/UpgradeExecutor';
import { rollupAdminLogicABI, safeL2ABI } from './abi';
import { gnosisSafeL2ABI } from './contracts/GnosisSafeL2';
import { rollupAdminLogicABI } from './abi';
import { createRollupFetchTransactionHash } from './createRollupFetchTransactionHash';

const createRollupABI = getAbiItem({ abi: rollupCreatorABI, name: 'createRollup' });
Expand All @@ -23,7 +24,7 @@ const setValidatorFunctionSelector = getFunctionSelector(setValidatorABI);
const executeCallABI = getAbiItem({ abi: upgradeExecutorABI, name: 'executeCall' });
const upgradeExecutorExecuteCallFunctionSelector = getFunctionSelector(executeCallABI);

const execTransactionABI = getAbiItem({ abi: safeL2ABI, name: 'execTransaction' });
const execTransactionABI = getAbiItem({ abi: gnosisSafeL2ABI, name: 'execTransaction' });
const safeL2FunctionSelector = getFunctionSelector(execTransactionABI);

const ownerFunctionCalledEventAbi = getAbiItem({
Expand Down
7 changes: 5 additions & 2 deletions src/getValidators.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ import {
} from 'viem';
import { arbitrum, arbitrumSepolia } from 'viem/chains';
import { it, expect, vi, describe } from 'vitest';

import { gnosisSafeL2ABI } from './contracts/GnosisSafeL2';

import { getValidators } from './getValidators';
import { rollupAdminLogicABI, safeL2ABI } from './abi';
import { rollupAdminLogicABI } from './abi';
import { rollupAdminLogicPrepareFunctionData } from './rollupAdminLogicPrepareTransactionRequest';

const client = createPublicClient({
Expand Down Expand Up @@ -121,7 +124,7 @@ function upgradeExecutorSetValidatorHelper(args: [Address[], boolean[]]) {
function safeSetValidatorHelper(args: [Address[], boolean[]]) {
const bytes = upgradeExecutorSetValidatorHelper(args);
return encodeFunctionData({
abi: safeL2ABI,
abi: gnosisSafeL2ABI,
functionName: 'execTransaction',
args: [
rollupAddress,
Expand Down