diff --git a/.changeset/tidy-spiders-wonder.md b/.changeset/tidy-spiders-wonder.md new file mode 100644 index 00000000000..97236f06139 --- /dev/null +++ b/.changeset/tidy-spiders-wonder.md @@ -0,0 +1,5 @@ +--- +"@fuel-ts/versions": patch +--- + +chore: support `forc@0.61.1` diff --git a/apps/docs-snippets/src/guide/transactions/transaction-request.test.ts b/apps/docs-snippets/src/guide/transactions/transaction-request.test.ts index 0956d87f02c..fd9f4f43dcb 100644 --- a/apps/docs-snippets/src/guide/transactions/transaction-request.test.ts +++ b/apps/docs-snippets/src/guide/transactions/transaction-request.test.ts @@ -224,7 +224,7 @@ describe('Transaction Request', () => { // #endregion transaction-request-7 expect(transactionId).toBe( - '0x8c1e78a1c6efc2301eea8a50c653ce1d936144af0948f911eb95e53254ccc721' + '0xdc83dc7d36caaaacd96e4bf4649c3ef5c372a87c3fb49b14d218e3d8a5b8d240' ); }); }); diff --git a/apps/docs-snippets/test/fixtures/abi/encode-and-decode.jsonc b/apps/docs-snippets/test/fixtures/abi/encode-and-decode.jsonc index 87bc39162d3..7b1da8fc184 100644 --- a/apps/docs-snippets/test/fixtures/abi/encode-and-decode.jsonc +++ b/apps/docs-snippets/test/fixtures/abi/encode-and-decode.jsonc @@ -37,7 +37,7 @@ "type": 0, "typeArguments": null, }, - "offset": 784, + "offset": 824, }, ], } diff --git a/apps/docs-snippets/test/fixtures/forc-projects/echo-values/src/main.sw b/apps/docs-snippets/test/fixtures/forc-projects/echo-values/src/main.sw index 9d6c7c85396..87bb47a673d 100644 --- a/apps/docs-snippets/test/fixtures/forc-projects/echo-values/src/main.sw +++ b/apps/docs-snippets/test/fixtures/forc-projects/echo-values/src/main.sw @@ -22,11 +22,6 @@ impl EchoValues for Contract { value } - // Avoid executing this function; it is currently unsupported. - // Refer to: https://github.com/FuelLabs/sway/issues/5110 for more details. - // The function is defined here to include the type 'str' in the ABI, - // ensuring Typegen can accurately interpret it. - // For further information, see: https://github.com/FuelLabs/fuels-ts/issues/1469 fn echo_str(value: str) -> str { value } diff --git a/internal/forc/VERSION b/internal/forc/VERSION index 7e750b4ebf3..6bcc0367034 100644 --- a/internal/forc/VERSION +++ b/internal/forc/VERSION @@ -1 +1 @@ -0.60.0 +0.61.1 diff --git a/packages/abi-typegen/src/abi/types/StrSliceType.ts b/packages/abi-typegen/src/abi/types/StrSliceType.ts index a8623eaf669..f47223f96b3 100644 --- a/packages/abi-typegen/src/abi/types/StrSliceType.ts +++ b/packages/abi-typegen/src/abi/types/StrSliceType.ts @@ -14,10 +14,15 @@ export class StrSliceType extends AType implements IType { } public parseComponentsAttributes(_params: { types: IType[] }) { + const capitalizedName = 'StrSlice'; + this.attributes = { - inputLabel: 'StrSlice', - outputLabel: 'StrSlice', + inputLabel: capitalizedName, + outputLabel: capitalizedName, }; + + this.requiredFuelsMembersImports = [capitalizedName]; + return this.attributes; } } diff --git a/packages/abi-typegen/src/abi/types/StrSlicesType.test.ts b/packages/abi-typegen/src/abi/types/StrSlicesType.test.ts index ac9242642ab..2dfa02647e1 100644 --- a/packages/abi-typegen/src/abi/types/StrSlicesType.test.ts +++ b/packages/abi-typegen/src/abi/types/StrSlicesType.test.ts @@ -31,6 +31,6 @@ describe('StrSlicesType.ts', () => { expect(strSlices.attributes.inputLabel).toEqual('StrSlice'); expect(strSlices.attributes.outputLabel).toEqual('StrSlice'); - expect(strSlices.requiredFuelsMembersImports).toStrictEqual([]); + expect(strSlices.requiredFuelsMembersImports).toStrictEqual(['StrSlice']); }); }); diff --git a/packages/abi-typegen/test/fixtures/forc-projects/full/src/main.sw b/packages/abi-typegen/test/fixtures/forc-projects/full/src/main.sw index 7fa07f1d81c..f71ae5ec2aa 100644 --- a/packages/abi-typegen/test/fixtures/forc-projects/full/src/main.sw +++ b/packages/abi-typegen/test/fixtures/forc-projects/full/src/main.sw @@ -80,6 +80,7 @@ abi MyContract { fn types_evm_address(x: EvmAddress) -> EvmAddress; fn types_bytes(x: Bytes) -> Bytes; fn types_raw_slice(x: raw_slice) -> raw_slice; + fn types_str_slice(x: str) -> str; fn types_std_string(x: String) -> String; fn types_result(x: Result) -> Result; fn type_address(x: Address) -> Address; @@ -175,6 +176,9 @@ impl MyContract for Contract { fn types_raw_slice(x: raw_slice) -> raw_slice { x } + fn types_str_slice(x: str) -> str { + x + } fn types_std_string(x: String) -> String { x } diff --git a/packages/abi-typegen/test/fixtures/templates/contract/bytecode.hbs b/packages/abi-typegen/test/fixtures/templates/contract/bytecode.hbs index 389c50929c4..4e1bc4e7157 100644 --- a/packages/abi-typegen/test/fixtures/templates/contract/bytecode.hbs +++ b/packages/abi-typegen/test/fixtures/templates/contract/bytecode.hbs @@ -9,4 +9,4 @@ Fuel-Core version: 33.33.33 */ -export default '0x1af030007400000200000000000005605dffc00110ffff00740000001aec5000910002005d43f009104100c01a4460005d4bf001104514801ae9100020f8330058fbe00250fbe004740000c61a47d0005fed10355fec00365053b1a85d47b0355d4bb0361b481480104514805d4bb0365d4ff002104924c05d4510005fed2036504bb0f81ae940001ae510001ae1200020f8330058fbe00250fbe004740000bc1a4bd000504fb1e072500010284d2500504bb1e0504fb17872500010284d25001ae9300020f8330058fbe00250fbe004740001121a4bd000504fb0105fed20025fed10035047b19872480010284534805047b1985fed00005d43f0035fed00015043b068724800102843b480504bb128724c0010284914c01ae9200020f8330058fbe00250fbe004740000b71a4bd000504fb13872500010284d05001ae9300020f8330058fbe00250fbe004740000ae1a4fd000134924c0134920001a4c00007648001c504bb158724c0010284914c01ae9200020f8330058fbe00250fbe004740000b11a4bd000504fb16872500010284d05001ae9300020f8330058fbe00250fbe004740000a81a43d000504fb14872500010284d15001ae9300020f8330058fbe00250fbe0047400008f1a47d000294d2411764c0001740000601a4060005d47f004104104401ae9000020f8330058fbe00250fbe0047400005a1a43d0005fed00375fec00385043b1b85047b1081ae900001ae5100020f8330058fbe00250fbe004740000985047b1181ae900001ae5100020f8330058fbe00250fbe004740000915d43f005264000001a4070005047b0505fed000a5d43f0055fed000b5fec000c5043b07872480018284114805047b0b872480018284504805043b02072480018284114805d47b004504100085d4bb006104d14805c53f0305e4d400010492040504fb0905fed10125045300872500008284505005fed20145d4130005d4530015d4930025fed00395fed103a5fed203b5043b1c85047b0d072480018284504805043b03872480018284114805d47b00750410010504bb0a85fed101550452008724c0008284504c05043b1f072440010284124405043b1f05047b18872480010284504801ae9100020f8330058fbe00250fbe004740000781a43d0005047b1f0504bb0e8724c0010284914c05d45200112451040254110005d43f0073640000095000003960800001aec50001a43a0001a47e0005d4100001af500001af9100098080000970000034af800009500007f960800001aec5000910000201a43a0001a4790001a4b80001a4fe0005d510001105144405d5500005d5900011b581580105555805fed50005fed10011a47b0005057b01072580010285515805f4140015043b01072440010284904401af52000920000201af93000980800009700007f4af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100011af50000920000101af9100098080000970000074af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100001af50000920000101af9100098080000970000074af800009500001f960800001aec5000910000301a43a0001a4790001a4be0001ae900005d43f0081ae500001ae3b00020f8330058fbe00250fbe0047500004b1a43d000504fb02072500010284d05005043b020504fb01072500010284d05001ae9300020f8330058fbe00250fbe004740000091a43d000724c0010284504c01af51000920000301af92000980800009700001f4af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100001af50000920000101af9100098080000970000074af80000470000006d61696e00000000000000000000024800000000000000080000000000000004000000000000025000000000000004000100000000000000000000000000007b000000000000000a0000000000000538' +export default '0x1af030007400000200000000000005f05dffc00110ffff00740000001aec5000910002885d43f001104100c01a44600072480250104514801ae9100020f8330058fbe00250fbe004740000e51a47d000504bb0105fed10025047b210724c0008284524c01a44600072480248104514801ae9100020f8330058fbe00250fbe004740000d71a47d000504bb0405fed10085047b258724c0008284524c05047b2585d4bb04b5d4920005d4fb04b72500008104d35005fed304b504fb1501ae910001ae520001ae1300020f8330058fbe00250fbe004740000cd1a47d000504fb27872500010284d15005047b278504fb18072500010284d15001ae9300020f8330058fbe00250fbe004740000db1a47d000504fb0185fed10035fed20045047b21872480010284534805047b2185fed0000724000045fed00015043b0a8724800102843b480504bb1a0724c0010284914c01ae9200020f8330058fbe00250fbe004740000d51a4bd000504fb1b072500010284d05001ae9300020f8330058fbe00250fbe004740000cc1a4fd000134924c0134920001a4c00007648001c504bb1d0724c0010284914c01ae9200020f8330058fbe00250fbe004740000cf1a4bd000504fb1e072500010284d05001ae9300020f8330058fbe00250fbe004740000c61a43d000504fb1c072500010284d15001ae9300020f8330058fbe00250fbe004740000ad1a47d000294d2411764c0001740000715043b2105047b1601ae900001ae5100020f8330058fbe00250fbe004740000c11a47d000504bb1701ae900001ae5200020f8330058fbe00250fbe004740000b91a43d000504bb060724c0010284914c050452010724c0010284504c05043b23872440020284124405043b2385047b23850451010504bb1f0724c0010284904c05043b200724c0010284114c01ae920001ae5000020f8330058fbe00250fbe004740000c51a53d00072400400264000001a4070005047b0805fed0010724004005fed00115fec00125043b0b872480018284114805047b1107248001828450480504bb02872400018284914005d43b005504520085d4bb007104d04805e4d400010492040504fb0d05fed001a5041300872500008284115005fed201c5043b0f872440018284134405047b26072480018284504805043b2605047b12872480018284504805043b04872480018284114805d47b00950410010504bb0e85fed101d50452008724c0008284504c05043b22872440010284124405043b2285047b19072480010284504801ae9100020f8330058fbe00250fbe004740000321a43d0005047b228504bb140724c0010284914c05047b098724c0010284524c05d47b014254110007240007b3640000095000003960800001aec50001a43a0001a47e0005d4100001af500001af9100098080000970000034af800009500007f960800001aec5000910000201a43a0001a4790001a4b80001a4fe0007250000828ed05005fed10011a53b0005057b01072580010285545805d510000104544405f4110005043b01072440010284904401af52000920000201af93000980800009700007f4af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100001af50000920000101af9100098080000970000074af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100011af50000920000101af9100098080000970000074af8000095000007960800001aec5000910000101a43a0001a47e0007248001028ed04801a43b0005d4100001af50000920000101af9100098080000970000074af800009500001f960800001aec5000910000301a43a0001a4790001a4be0001ae900007240000a1ae500001ae3b00020f8330058fbe00250fbe004750000581a43d000504fb02072500010284d05005043b020504fb01072500010284d05001ae9300020f8330058fbe00250fbe0047500004a1a43d000724c0010284504c01af51000920000301af92000980800009700001f4af8000095000001960800001aec50001a43e0001af410001af9000098080000970000014af800006d61696e0000000000000000000005c8' diff --git a/packages/abi-typegen/test/fixtures/templates/contract/dts.hbs b/packages/abi-typegen/test/fixtures/templates/contract/dts.hbs index 384c6e7d18b..88205949c4e 100644 --- a/packages/abi-typegen/test/fixtures/templates/contract/dts.hbs +++ b/packages/abi-typegen/test/fixtures/templates/contract/dts.hbs @@ -22,6 +22,7 @@ import type { InvokeFunction, RawSlice, StdString, + StrSlice, } from 'fuels'; import type { Option, Enum, Vec, Result } from "./common"; @@ -78,6 +79,7 @@ interface MyContractAbiInterface extends Interface { types_result: FunctionFragment; types_std_string: FunctionFragment; types_str: FunctionFragment; + types_str_slice: FunctionFragment; types_struct: FunctionFragment; types_tuple: FunctionFragment; types_u16: FunctionFragment; @@ -120,6 +122,7 @@ export class MyContractAbi extends Contract { types_result: InvokeFunction<[x: Result], Result>; types_std_string: InvokeFunction<[x: StdString], StdString>; types_str: InvokeFunction<[x: string], string>; + types_str_slice: InvokeFunction<[x: StrSlice], StrSlice>; types_struct: InvokeFunction<[x: MyStructInput], MyStructOutput>; types_tuple: InvokeFunction<[x: [BigNumberish, BigNumberish, BigNumberish]], [number, number, number]>; types_u16: InvokeFunction<[x: BigNumberish], number>; diff --git a/packages/abi-typegen/test/fixtures/templates/predicate-with-configurable/factory.hbs b/packages/abi-typegen/test/fixtures/templates/predicate-with-configurable/factory.hbs index 13eb6c64505..bbda33210f2 100644 --- a/packages/abi-typegen/test/fixtures/templates/predicate-with-configurable/factory.hbs +++ b/packages/abi-typegen/test/fixtures/templates/predicate-with-configurable/factory.hbs @@ -78,7 +78,7 @@ const _abi = { "type": 2, "typeArguments": null }, - "offset": 1152 + "offset": 904 }, { "name": "ADDRESS", @@ -87,7 +87,7 @@ const _abi = { "type": 0, "typeArguments": null }, - "offset": 1168 + "offset": 872 } ] } diff --git a/packages/abi-typegen/test/fixtures/templates/script-with-configurable/factory.hbs b/packages/abi-typegen/test/fixtures/templates/script-with-configurable/factory.hbs index 51c5cc63942..fbc6aa2d591 100644 --- a/packages/abi-typegen/test/fixtures/templates/script-with-configurable/factory.hbs +++ b/packages/abi-typegen/test/fixtures/templates/script-with-configurable/factory.hbs @@ -86,7 +86,7 @@ const _abi = { "type": 0, "typeArguments": null }, - "offset": 536 + "offset": 616 } ] } diff --git a/packages/fuel-gauge/src/raw-slice.test.ts b/packages/fuel-gauge/src/raw-slice.test.ts index 375bd522c72..ff6e0f9c241 100644 --- a/packages/fuel-gauge/src/raw-slice.test.ts +++ b/packages/fuel-gauge/src/raw-slice.test.ts @@ -112,8 +112,7 @@ describe('Raw Slice Tests', () => { expect(isStatusSuccess); }); - // see https://github.com/FuelLabs/fuels-ts/issues/1344 - it.skip('should test raw slice input [script-raw-slice]', async () => { + it('should test raw slice input [script-raw-slice]', async () => { const wallet = await setup(); type MainArgs = [number, Wrapper]; const scriptInstance = getScript('script-raw-slice', wallet); @@ -124,7 +123,7 @@ describe('Raw Slice Tests', () => { inner_enum: { Second: bytes }, }; - const { value } = await scriptInstance.functions.main(1, INPUT).call(); - expect(value).toStrictEqual([1, 2, 3]); + const { value } = await scriptInstance.functions.main(3, INPUT).call(); + expect(value).toStrictEqual([0, 1, 2]); }); }); diff --git a/packages/fuel-gauge/src/str-slice.test.ts b/packages/fuel-gauge/src/str-slice.test.ts new file mode 100644 index 00000000000..26485cc7c16 --- /dev/null +++ b/packages/fuel-gauge/src/str-slice.test.ts @@ -0,0 +1,77 @@ +import { bn } from 'fuels'; +import { launchTestNode } from 'fuels/test-utils'; + +import type { PredicateStrSliceAbiInputs } from '../test/typegen'; +import { + PredicateStrSliceAbi__factory, + ScriptStrSliceAbi__factory, + StrSliceAbi__factory, +} from '../test/typegen'; +import contractBytes from '../test/typegen/contracts/StrSliceAbi.hex'; + +/** + * @group node + */ +describe('str slice', () => { + it('echoes a str slice [CONTRACT]', async () => { + using launched = await launchTestNode({ + contractsConfigs: [ + { + deployer: StrSliceAbi__factory, + bytecode: contractBytes, + }, + ], + }); + const { + contracts: [strSliceContract], + } = launched; + + const input = 'contract-input'; + const output = 'contract-return'; + const { value } = await strSliceContract.functions.echoes_str_slice(input).call(); + expect(value).toEqual(output); + }); + + it('validates a str slice [PREDICATE]', async () => { + using launched = await launchTestNode(); + + const { + wallets: [sender, receiver], + provider, + } = launched; + + const predicateData: PredicateStrSliceAbiInputs = ['predicate-input']; + const predicate = PredicateStrSliceAbi__factory.createInstance(provider, predicateData); + const baseAssetId = provider.getBaseAssetId(); + + const amountToPredicate = 250_000; + const amountToReceiver = 50_000; + + const setupTx = await sender.transfer(predicate.address, amountToPredicate, baseAssetId); + await setupTx.waitForResult(); + + const initialReceiverBalance = await receiver.getBalance(); + + const tx = await predicate.transfer(receiver.address, amountToReceiver, baseAssetId); + const { isStatusSuccess } = await tx.waitForResult(); + const finalReceiverBalance = await receiver.getBalance(); + expect(bn(initialReceiverBalance).add(amountToReceiver).toHex()).toEqual( + finalReceiverBalance.toHex() + ); + expect(isStatusSuccess).toBe(true); + }); + + it('echoes a str slice [SCRIPT]', async () => { + using launched = await launchTestNode(); + + const { + wallets: [sender], + } = launched; + + const script = await ScriptStrSliceAbi__factory.createInstance(sender); + const input = 'script-input'; + const output = 'script-return'; + const { value } = await script.functions.main(input).call(); + expect(value).toEqual(output); + }); +}); diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/Forc.toml b/packages/fuel-gauge/test/fixtures/forc-projects/Forc.toml index eb8d8a6182d..e853095e252 100644 --- a/packages/fuel-gauge/test/fixtures/forc-projects/Forc.toml +++ b/packages/fuel-gauge/test/fixtures/forc-projects/Forc.toml @@ -23,6 +23,7 @@ members = [ "predicate-main-args-vector", "predicate-multi-args", "predicate-raw-slice", + "predicate-str-slice", "predicate-std-lib-string", "predicate-input-data", "predicate-triple-sig", @@ -37,6 +38,7 @@ members = [ "complex-predicate", "complex-script", "raw-slice", + "str-slice", "reentrant-bar", "reentrant-foo", "reentrant-foobar-abi", @@ -47,7 +49,8 @@ members = [ "script-main-args", "script-main-return-struct", "script-main-two-args", - # "script-raw-slice", see https://github.com/FuelLabs/fuels-ts/issues/1344 + "script-raw-slice", + "script-str-slice", "script-std-lib-string", "script-with-array", "script-with-configurable", diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/predicate-str-slice/Forc.toml b/packages/fuel-gauge/test/fixtures/forc-projects/predicate-str-slice/Forc.toml new file mode 100644 index 00000000000..20898480eb7 --- /dev/null +++ b/packages/fuel-gauge/test/fixtures/forc-projects/predicate-str-slice/Forc.toml @@ -0,0 +1,7 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "predicate-str-slice" + +[dependencies] diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/predicate-str-slice/src/main.sw b/packages/fuel-gauge/test/fixtures/forc-projects/predicate-str-slice/src/main.sw new file mode 100644 index 00000000000..29d0c4866ca --- /dev/null +++ b/packages/fuel-gauge/test/fixtures/forc-projects/predicate-str-slice/src/main.sw @@ -0,0 +1,5 @@ +predicate; + +fn main(input: str) -> bool { + input == "predicate-input" +} diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/script-raw-slice/src/main.sw b/packages/fuel-gauge/test/fixtures/forc-projects/script-raw-slice/src/main.sw index 2d888eeb5a1..d1752335ab3 100644 --- a/packages/fuel-gauge/test/fixtures/forc-projects/script-raw-slice/src/main.sw +++ b/packages/fuel-gauge/test/fixtures/forc-projects/script-raw-slice/src/main.sw @@ -12,7 +12,7 @@ struct Wrapper { } fn validate_raw_slice(input: raw_slice) { - let vec: Vec = Vec::from(input); + let vec: Vec = Vec::from(input); require(vec.len() == 3, "raw slice len is not 3"); require( vec @@ -40,7 +40,7 @@ fn validate_vec(vec: Vec) { validate_raw_slice(vec.get(1).unwrap()); } -fn main(_arg: u64, wrapper: Wrapper>) -> raw_slice { +fn main(length: u8, wrapper: Wrapper>) -> raw_slice { if let SomeEnum::Second(enum_raw_slice) = wrapper.inner_enum { validate_raw_slice(enum_raw_slice); @@ -50,10 +50,11 @@ fn main(_arg: u64, wrapper: Wrapper>) -> raw_slice { validate_vec(wrapper.inner); - let mut rtn: Vec = Vec::new(); - rtn.push(1); - rtn.push(2); - rtn.push(3); - - rtn.as_raw_slice() + let mut vec = Vec::new(); + let mut counter = 0u8; + while counter < length { + vec.push(counter); + counter = counter + 1; + } + vec.as_raw_slice() } diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/script-str-slice/Forc.toml b/packages/fuel-gauge/test/fixtures/forc-projects/script-str-slice/Forc.toml new file mode 100644 index 00000000000..51f067710ca --- /dev/null +++ b/packages/fuel-gauge/test/fixtures/forc-projects/script-str-slice/Forc.toml @@ -0,0 +1,7 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "script-str-slice" + +[dependencies] diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/script-str-slice/src/main.sw b/packages/fuel-gauge/test/fixtures/forc-projects/script-str-slice/src/main.sw new file mode 100644 index 00000000000..f9d31cb7129 --- /dev/null +++ b/packages/fuel-gauge/test/fixtures/forc-projects/script-str-slice/src/main.sw @@ -0,0 +1,7 @@ +script; + +fn main(input: str) -> str { + assert_eq(input, "script-input"); + + "script-return" +} diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/str-slice/Forc.toml b/packages/fuel-gauge/test/fixtures/forc-projects/str-slice/Forc.toml new file mode 100644 index 00000000000..ecb9c187b30 --- /dev/null +++ b/packages/fuel-gauge/test/fixtures/forc-projects/str-slice/Forc.toml @@ -0,0 +1,7 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "str-slice" + +[dependencies] diff --git a/packages/fuel-gauge/test/fixtures/forc-projects/str-slice/src/main.sw b/packages/fuel-gauge/test/fixtures/forc-projects/str-slice/src/main.sw new file mode 100644 index 00000000000..b62c59520ad --- /dev/null +++ b/packages/fuel-gauge/test/fixtures/forc-projects/str-slice/src/main.sw @@ -0,0 +1,13 @@ +contract; + +abi MyContract { + fn echoes_str_slice(arg: str) -> str; +} + +impl MyContract for Contract { + fn echoes_str_slice(arg: str) -> str { + assert_eq(arg, "contract-input"); + + "contract-return" + } +} diff --git a/packages/interfaces/src/index.ts b/packages/interfaces/src/index.ts index 12511d37596..45aa8d169cf 100644 --- a/packages/interfaces/src/index.ts +++ b/packages/interfaces/src/index.ts @@ -35,6 +35,7 @@ export type AssetId = { }; export type StdString = string; +export type StrSlice = string; /** * @hidden diff --git a/packages/versions/src/lib/getBuiltinVersions.ts b/packages/versions/src/lib/getBuiltinVersions.ts index 7f1de3aebfe..804cf73b086 100644 --- a/packages/versions/src/lib/getBuiltinVersions.ts +++ b/packages/versions/src/lib/getBuiltinVersions.ts @@ -1,6 +1,6 @@ export function getBuiltinVersions() { return { - FORC: '0.60.0', + FORC: '0.61.1', FUEL_CORE: '0.30.0', FUELS: '0.90.0', }; diff --git a/templates/nextjs/sway-programs/fuel-toolchain.toml b/templates/nextjs/sway-programs/fuel-toolchain.toml index e670af0afb7..e3d74998ce4 100644 --- a/templates/nextjs/sway-programs/fuel-toolchain.toml +++ b/templates/nextjs/sway-programs/fuel-toolchain.toml @@ -2,5 +2,5 @@ channel = "testnet" [components] -forc = "0.60.0" +forc = "0.61.1" fuel-core = "0.30.0" \ No newline at end of file