diff --git a/.changeset/cyan-panthers-carry.md b/.changeset/cyan-panthers-carry.md new file mode 100644 index 00000000000..817ae1f110a --- /dev/null +++ b/.changeset/cyan-panthers-carry.md @@ -0,0 +1,7 @@ +--- +"@fuel-ts/abi-typegen": patch +"@fuel-ts/contract": patch +"fuels": patch +--- + +fix: typegen and storage slots integration diff --git a/internal/benchmarks/src/cost-estimation.bench.ts b/internal/benchmarks/src/cost-estimation.bench.ts index cffa9ba7351..d18017bc8df 100644 --- a/internal/benchmarks/src/cost-estimation.bench.ts +++ b/internal/benchmarks/src/cost-estimation.bench.ts @@ -29,7 +29,7 @@ describe('Cost Estimation Benchmarks', () => { const wallet = new WalletUnlocked(process.env.DEVNET_WALLET_PVT_KEY as string, provider); const contractFactory = new CallTestContractFactory(wallet); - const { waitForResult } = await contractFactory.deploy(); + const { waitForResult } = await contractFactory.deploy(); const { contract: deployedContract } = await waitForResult(); contract = deployedContract; } else { diff --git a/packages/abi-typegen/src/templates/contract/factory.hbs b/packages/abi-typegen/src/templates/contract/factory.hbs index c232f423fc3..d069631eebe 100644 --- a/packages/abi-typegen/src/templates/contract/factory.hbs +++ b/packages/abi-typegen/src/templates/contract/factory.hbs @@ -1,33 +1,29 @@ {{header}} -import { Contract, ContractFactory, decompressBytecode } from "fuels"; -import type { Provider, Account, DeployContractOptions, DeployContractResult } from "fuels"; +import { ContractFactory, decompressBytecode } from "fuels"; +import type { Provider, Account, DeployContractOptions } from "fuels"; import { {{capitalizedName}} } from "./{{capitalizedName}}"; const bytecode = decompressBytecode("{{compressedBytecode}}"); -export class {{capitalizedName}}Factory extends ContractFactory { +export class {{capitalizedName}}Factory extends ContractFactory<{{capitalizedName}}> { static readonly bytecode = bytecode; constructor(accountOrProvider: Account | Provider) { - super(bytecode, {{capitalizedName}}.abi, accountOrProvider); + super( + bytecode, + {{capitalizedName}}.abi, + accountOrProvider, + {{capitalizedName}}.storageSlots + ); } - override deploy( - deployOptions?: DeployContractOptions - ): Promise> { - return super.deploy({ - storageSlots: {{capitalizedName}}.storageSlots, - ...deployOptions, - }); - } - - static async deploy ( + static deploy ( wallet: Account, options: DeployContractOptions = {} - ): Promise> { + ) { const factory = new {{capitalizedName}}Factory(wallet); return factory.deploy(options); } diff --git a/packages/abi-typegen/test/fixtures/templates/contract/factory.hbs b/packages/abi-typegen/test/fixtures/templates/contract/factory.hbs index 58db2e250ff..0496f767c2d 100644 --- a/packages/abi-typegen/test/fixtures/templates/contract/factory.hbs +++ b/packages/abi-typegen/test/fixtures/templates/contract/factory.hbs @@ -10,34 +10,30 @@ Fuel-Core version: 33.33.33 */ -import { Contract, ContractFactory, decompressBytecode } from "fuels"; -import type { Provider, Account, DeployContractOptions, DeployContractResult } from "fuels"; +import { ContractFactory, decompressBytecode } from "fuels"; +import type { Provider, Account, DeployContractOptions } from "fuels"; import { MyContract } from "./MyContract"; const bytecode = decompressBytecode("0x-bytecode-here"); -export class MyContractFactory extends ContractFactory { +export class MyContractFactory extends ContractFactory { static readonly bytecode = bytecode; constructor(accountOrProvider: Account | Provider) { - super(bytecode, MyContract.abi, accountOrProvider); + super( + bytecode, + MyContract.abi, + accountOrProvider, + MyContract.storageSlots + ); } - override deploy( - deployOptions?: DeployContractOptions - ): Promise> { - return super.deploy({ - storageSlots: MyContract.storageSlots, - ...deployOptions, - }); - } - - static async deploy ( + static deploy ( wallet: Account, options: DeployContractOptions = {} - ): Promise> { + ) { const factory = new MyContractFactory(wallet); return factory.deploy(options); } diff --git a/packages/contract/src/contract-factory.ts b/packages/contract/src/contract-factory.ts index 9adcfb3a55b..3427651eb40 100644 --- a/packages/contract/src/contract-factory.ts +++ b/packages/contract/src/contract-factory.ts @@ -52,11 +52,12 @@ export type DeployContractResult = { /** * `ContractFactory` provides utilities for deploying and configuring contracts. */ -export default class ContractFactory { +export default class ContractFactory { bytecode: BytesLike; interface: Interface; provider!: Provider | null; account!: Account | null; + storageSlots: StorageSlot[]; /** * Create a ContractFactory instance. @@ -68,7 +69,8 @@ export default class ContractFactory { constructor( bytecode: BytesLike, abi: JsonAbi | Interface, - accountOrProvider: Account | Provider | null = null + accountOrProvider: Account | Provider | null = null, + storageSlots: StorageSlot[] = [] ) { // Force the bytecode to be a byte array this.bytecode = arrayify(bytecode); @@ -99,6 +101,8 @@ export default class ContractFactory { this.provider = accountOrProvider; this.account = null; } + + this.storageSlots = storageSlots; } /** @@ -118,17 +122,19 @@ export default class ContractFactory { * @returns The CreateTransactionRequest object for deploying the contract. */ createTransactionRequest(deployOptions?: DeployContractOptions & { bytecode?: BytesLike }) { - const storageSlots = deployOptions?.storageSlots - ?.map(({ key, value }) => ({ + const storageSlots = (deployOptions?.storageSlots ?? []) + .concat(this.storageSlots) + .map(({ key, value }) => ({ key: hexlifyWithPrefix(key), value: hexlifyWithPrefix(value), })) + .filter((el, index, self) => self.findIndex((s) => s.key === el.key) === index) .sort(({ key: keyA }, { key: keyB }) => keyA.localeCompare(keyB)); const options = { salt: randomBytes(32), - ...deployOptions, - storageSlots: storageSlots || [], + ...(deployOptions ?? {}), + storageSlots, }; if (!this.provider) { @@ -192,16 +198,16 @@ export default class ContractFactory { * @param deployOptions - Options for deploying the contract. * @returns A promise that resolves to the deployed contract instance. */ - async deploy( + async deploy( deployOptions: DeployContractOptions = {} - ): Promise> { + ): Promise> { const account = this.getAccount(); const { consensusParameters } = account.provider.getChain(); const maxContractSize = consensusParameters.contractParameters.contractMaxSize.toNumber(); return this.bytecode.length > maxContractSize ? this.deployAsBlobTx(deployOptions) - : this.deployAsCreateTx(deployOptions); + : this.deployAsCreateTx(deployOptions); } /** @@ -210,9 +216,9 @@ export default class ContractFactory { * @param deployOptions - Options for deploying the contract. * @returns A promise that resolves to the deployed contract instance. */ - async deployAsCreateTx( + async deployAsCreateTx( deployOptions: DeployContractOptions = {} - ): Promise> { + ): Promise> { const account = this.getAccount(); const { consensusParameters } = account.provider.getChain(); const maxContractSize = consensusParameters.contractParameters.contractMaxSize.toNumber(); @@ -230,7 +236,7 @@ export default class ContractFactory { const waitForResult = async () => { const transactionResult = await transactionResponse.waitForResult(); - const contract = new Contract(contractId, this.interface, account) as TContract; + const contract = new Contract(contractId, this.interface, account) as T; return { contract, transactionResult }; }; @@ -248,11 +254,11 @@ export default class ContractFactory { * @param deployOptions - Options for deploying the contract. * @returns A promise that resolves to the deployed contract instance. */ - async deployAsBlobTx( + async deployAsBlobTx( deployOptions: DeployContractOptions = { chunkSizeMultiplier: CHUNK_SIZE_MULTIPLIER, } - ): Promise> { + ): Promise> { const account = this.getAccount(); const { configurableConstants, chunkSizeMultiplier } = deployOptions; if (configurableConstants) { @@ -362,7 +368,7 @@ export default class ContractFactory { txIdResolver(createRequest.getTransactionId(account.provider.getChainId())); const transactionResponse = await account.sendTransaction(createRequest); const transactionResult = await transactionResponse.waitForResult(); - const contract = new Contract(contractId, this.interface, account) as TContract; + const contract = new Contract(contractId, this.interface, account) as T; return { contract, transactionResult }; }; diff --git a/packages/fuel-gauge/src/contract-factory.test.ts b/packages/fuel-gauge/src/contract-factory.test.ts index 6f6b35b63f9..8cb8300385c 100644 --- a/packages/fuel-gauge/src/contract-factory.test.ts +++ b/packages/fuel-gauge/src/contract-factory.test.ts @@ -283,7 +283,7 @@ describe('Contract Factory', () => { const factory = new ContractFactory(LargeContractFactory.bytecode, LargeContract.abi, wallet); expect(factory.bytecode.length % 8 === 0).toBe(true); - const deploy = await factory.deployAsBlobTx(); + const deploy = await factory.deployAsBlobTx(); const { contract } = await deploy.waitForResult(); @@ -311,7 +311,7 @@ describe('Contract Factory', () => { } = launched; const factory = new ContractFactory(LargeContractFactory.bytecode, LargeContract.abi, wallet); - const deploy = await factory.deployAsBlobTx(); + const deploy = await factory.deployAsBlobTx(); const initTxId = deploy.waitForTransactionId(); expect(initTxId).toStrictEqual(new Promise(() => {})); const { contract } = await deploy.waitForResult(); @@ -339,7 +339,7 @@ describe('Contract Factory', () => { const bytecode = concat([arrayify(LargeContractFactory.bytecode), new Uint8Array(3)]); const factory = new ContractFactory(bytecode, LargeContract.abi, wallet); expect(factory.bytecode.length % 8 === 0).toBe(false); - const deploy = await factory.deployAsBlobTx({ chunkSizeMultiplier: 0.5 }); + const deploy = await factory.deployAsBlobTx({ chunkSizeMultiplier: 0.5 }); const { contract } = await deploy.waitForResult(); expect(contract.id).toBeDefined(); @@ -361,7 +361,7 @@ describe('Contract Factory', () => { const chunkSizeMultiplier = 2; await expectToThrowFuelError( - () => factory.deployAsBlobTx({ chunkSizeMultiplier }), + () => factory.deployAsBlobTx({ chunkSizeMultiplier }), new FuelError( ErrorCode.INVALID_CHUNK_SIZE_MULTIPLIER, 'Chunk size multiplier must be between 0 and 1' @@ -534,12 +534,12 @@ describe('Contract Factory', () => { const sendTransactionSpy = vi.spyOn(wallet, 'sendTransaction'); const factory = new ContractFactory(LargeContractFactory.bytecode, LargeContract.abi, wallet); - const firstDeploy = await factory.deployAsBlobTx({ + const firstDeploy = await factory.deployAsBlobTx({ salt: concat(['0x01', new Uint8Array(31)]), }); const { contract: firstContract } = await firstDeploy.waitForResult(); const firstDeployCalls = sendTransactionSpy.mock.calls.length; - const secondDeploy = await factory.deployAsBlobTx({ + const secondDeploy = await factory.deployAsBlobTx({ salt: concat(['0x02', new Uint8Array(31)]), }); const { contract: secondContract } = await secondDeploy.waitForResult(); diff --git a/packages/fuel-gauge/src/storage-test-contract.test.ts b/packages/fuel-gauge/src/storage-test-contract.test.ts index f34b4ef0c45..64d59f4cafc 100644 --- a/packages/fuel-gauge/src/storage-test-contract.test.ts +++ b/packages/fuel-gauge/src/storage-test-contract.test.ts @@ -124,10 +124,16 @@ describe('StorageTestContract', () => { it('should allow for overriding storage slots', async () => { const { storageSlots } = StorageTestContract; - const expectedStorageSlots = storageSlots.map(({ key }) => ({ + + expect(storageSlots.length).toBeGreaterThan(2); + const modifiedStorageSlots = storageSlots.slice(1).map(({ key }) => ({ key: `0x${key}`, value: ZeroBytes32, })); + const expectedStorageSlots = [ + { key: `0x${storageSlots[0].key}`, value: `0x${storageSlots[0].value}` }, + ...modifiedStorageSlots, + ]; using launched = await launchTestNode(); @@ -138,7 +144,7 @@ describe('StorageTestContract', () => { // via constructor const storageContractFactory = new StorageTestContractFactory(wallet); const deployConstructor = await storageContractFactory.deploy({ - storageSlots: expectedStorageSlots, + storageSlots: modifiedStorageSlots, }); const { transactionResult: transactionResultConstructor } = await deployConstructor.waitForResult(); @@ -146,10 +152,68 @@ describe('StorageTestContract', () => { // via static deploy const deployStatically = await StorageTestContractFactory.deploy(wallet, { - storageSlots: expectedStorageSlots, + storageSlots: modifiedStorageSlots, }); const { transactionResult: transactionResultStatically } = await deployStatically.waitForResult(); expect(transactionResultStatically.transaction.storageSlots).toEqual(expectedStorageSlots); + + // via deployAsBlobTx + const deployBlob = await storageContractFactory.deployAsBlobTx({ + storageSlots: modifiedStorageSlots, + }); + + const { transactionResult: txResultBlob } = await deployBlob.waitForResult(); + expect(txResultBlob.transaction.storageSlots).toEqual(expectedStorageSlots); + + // via deployAsCreateTx + const deployCreate = await storageContractFactory.deployAsBlobTx({ + storageSlots: modifiedStorageSlots, + }); + + const { transactionResult: txResultCreate } = await deployCreate.waitForResult(); + expect(txResultCreate.transaction.storageSlots).toEqual(expectedStorageSlots); + }); + + test('automatically loads storage slots when using deployAsCreateTx', async () => { + const { storageSlots } = StorageTestContract; + const expectedStorageSlots = storageSlots.map(({ key, value }) => ({ + key: `0x${key}`, + value: `0x${value}`, + })); + + using launched = await launchTestNode(); + + const { + wallets: [wallet], + } = launched; + + // via constructor + const storageContractFactory = new StorageTestContractFactory(wallet); + const deployConstructor = await storageContractFactory.deployAsCreateTx(); + const { transactionResult: transactionResultConstructor } = + await deployConstructor.waitForResult(); + expect(transactionResultConstructor.transaction.storageSlots).toEqual(expectedStorageSlots); + }); + + test('automatically loads storage slots when using deployAsBlobTx', async () => { + const { storageSlots } = StorageTestContract; + const expectedStorageSlots = storageSlots.map(({ key, value }) => ({ + key: `0x${key}`, + value: `0x${value}`, + })); + + using launched = await launchTestNode(); + + const { + wallets: [wallet], + } = launched; + + // via constructor + const storageContractFactory = new StorageTestContractFactory(wallet); + const deployConstructor = await storageContractFactory.deployAsBlobTx(); + const { transactionResult: transactionResultConstructor } = + await deployConstructor.waitForResult(); + expect(transactionResultConstructor.transaction.storageSlots).toEqual(expectedStorageSlots); }); }); diff --git a/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts b/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts index 0b696a6f97e..0a142a18e5d 100644 --- a/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts +++ b/packages/fuels/src/cli/commands/deploy/proxy/types/Src14OwnedProxyFactory.ts @@ -8,34 +8,30 @@ Fuels version: 0.97.0 */ -import { Contract, ContractFactory, decompressBytecode } from "../../../../.."; -import type { Provider, Account, DeployContractOptions, DeployContractResult } from "../../../../.."; +import { ContractFactory, decompressBytecode } from "../../../../.."; +import type { Provider, Account, DeployContractOptions } from "../../../../.."; import { Src14OwnedProxy } from "./Src14OwnedProxy"; const bytecode = decompressBytecode("H4sIAAAAAAAAA9Vbe3Abx3lfgCAFvayz+TAFSjaUUjJkRwosUQ4ly9IhIATSEM2DSVpUGBhg64c0cSyIlVQ5tsccN001aSZlHcdlO06GrtOp6z4GAB+C7T7YR2bUiTtlZhxbTeMWmiatFAst60YZqm6j/r5v93DHw4GOJ84f0QznFne73+5+j9/32FVgISxOCOEV/K/Dn7o259GuXRO/JcSQ8c6CML4nwkZJF8HFnWLovZLXeK/kOyG89+JbGN9C+BZe+q2uEfRE4LIBGiv1VHThdi0i5gJdGTHa7TW0WNNY4JLmoFfXE4jPi3T5ep/q112j337Vr8WIF3PV373nAol5YfTls6OG8Id6m9E3+DG0tVB5F96/onG7b0akejWh9XaMpWNhYcSnL44exPv49JzLnNtoTtDMpMvaR0FvmxHPaaPd6B/rGDMSxRCP7WmaMxJ5I10Wt47qYg2etxnR/CJ/i7Tj29nuSr/42Tlux3yYLygC36+aMxiIzotTuuck+LeD+If9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NCf/NW3Wo/vXP/7r06u2ub76pu9W1viT24589bR7LmJvx+UfY/9yqMPjjK9o48ePXF05JGjn31QkrHoyT4bv7vq7RduWeV5nf8J7/7s9hd3bXj+pmv8T4jXHnvm8eZ/3Py1F1vevVzY+uQj536t9cwfPn167vdK+wIrb/qDgQMjjzzyiyO/9OnY6Oix0T17BniR9xw70S+XL764+Zt3fP7A9t/N/+ZE57Nf/vrLvkvPvzZ7cNOb//qZYwfLl18+uv/V/5j8h4eu+8Ku/xk+uePbe3/06xf23ZVr+sG7/m8Uv9HxR0fvemvl2vu9D6f3bfzxUz/47sbnHn7u7V/9ja6rX/3i3kfH/9To/dHLkms7/1c+d7yuns+r50H5vF19335ePtvfkM8W9X3lEfn0qff1n1PPDvV8Vj7rJuXT88b/AzdExjYINgAA"); -export class Src14OwnedProxyFactory extends ContractFactory { +export class Src14OwnedProxyFactory extends ContractFactory { static readonly bytecode = bytecode; constructor(accountOrProvider: Account | Provider) { - super(bytecode, Src14OwnedProxy.abi, accountOrProvider); + super( + bytecode, + Src14OwnedProxy.abi, + accountOrProvider, + Src14OwnedProxy.storageSlots + ); } - override deploy( - deployOptions?: DeployContractOptions - ): Promise> { - return super.deploy({ - storageSlots: Src14OwnedProxy.storageSlots, - ...deployOptions, - }); - } - - static async deploy ( + static deploy ( wallet: Account, options: DeployContractOptions = {} - ): Promise> { + ): ReturnType { const factory = new Src14OwnedProxyFactory(wallet); return factory.deploy(options); }