Skip to content

Commit ff6e769

Browse files
Agusx1211ScreamingHawk
authored andcommitted
Add old anypay contracts
1 parent b2dac70 commit ff6e769

File tree

3 files changed

+64
-2
lines changed

3 files changed

+64
-2
lines changed

scripts/deploy-contracts.ts

Lines changed: 39 additions & 1 deletion
Large diffs are not rendered by default.

scripts/mirror-transaction.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { ethers } from 'ethers'
2+
3+
export const mirrorTransaction = async (
4+
signer: ethers.Signer,
5+
expected: string,
6+
to: string,
7+
data: string,
8+
txParams?: ethers.providers.TransactionRequest
9+
): Promise<{ address: string; deployed: boolean }> => {
10+
const code = await signer.provider?.getCode(expected)
11+
if (code !== '0x' && code !== '') {
12+
return { address: expected, deployed: false }
13+
}
14+
15+
const tx = await signer.sendTransaction({ to, data, ...txParams })
16+
await tx.wait()
17+
18+
const code2 = await signer.provider?.getCode(to)
19+
if (code2 === '0x' || code2 === '') {
20+
throw new Error(`Mirror transaction failed to deploy ${expected}`)
21+
}
22+
23+
return { address: to, deployed: true }
24+
}

scripts/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ export type ContractName =
5656
| 'GuestV3Dev1'
5757
| 'PasskeysV3Dev1'
5858

59-
export type ContractEntry = Partial<Record<ContractName, string>>
59+
export type ContractEntry = Partial<Record<ContractName, string>> & { misc?: Record<string, string> }

0 commit comments

Comments
 (0)