({
ctx,
address,
contractName,
...opts
}: {
ctx: BuilderContext
address: Address
contractName: string
storage?: AllocConfig['storage']
nonce?: AllocConfig['nonce']
balance?: AllocConfig['balance']
})
| 87 | }) |
| 88 | |
| 89 | export const buildSystemContractAlloc = async ({ |
| 90 | ctx, |
| 91 | address, |
| 92 | contractName, |
| 93 | ...opts |
| 94 | }: { |
| 95 | ctx: BuilderContext |
| 96 | address: Address |
| 97 | contractName: string |
| 98 | storage?: AllocConfig['storage'] |
| 99 | nonce?: AllocConfig['nonce'] |
| 100 | balance?: AllocConfig['balance'] |
| 101 | }) => |
| 102 | buildAccountAlloc({ |
| 103 | address, |
| 104 | code: await ctx.contractLoader.getCode(contractName), |
| 105 | balance: opts.balance ?? 0n, |
| 106 | nonce: opts.nonce ?? 1n, |
| 107 | storage: opts.storage, |
| 108 | }) |
| 109 | |
| 110 | export const addressToBigInt = (address: Address): bigint => fromHex(address, 'bigint') |
| 111 | export const addressToBytes32 = (address: Address): Bytes32 => toHex(addressToBigInt(address), { size: 32 }) |
no test coverage detected