MCPcopy Create free account
hub / github.com/circlefin/arc-node / buildSystemContractAlloc

Function buildSystemContractAlloc

scripts/genesis/types.ts:89–108  ·  view source on GitHub ↗
({
  ctx,
  address,
  contractName,
  ...opts
}: {
  ctx: BuilderContext
  address: Address
  contractName: string
  storage?: AllocConfig['storage']
  nonce?: AllocConfig['nonce']
  balance?: AllocConfig['balance']
})

Source from the content-addressed store, hash-verified

87 })
88
89export 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
110export const addressToBigInt = (address: Address): bigint => fromHex(address, 'bigint')
111export const addressToBytes32 = (address: Address): Bytes32 => toHex(addressToBigInt(address), { size: 32 })

Calls 1

buildAccountAllocFunction · 0.85

Tested by

no test coverage detected