Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding configurables breaks contracts | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 #1475

Closed
DefiCake opened this issue Aug 1, 2024 · 2 comments · Fixed by #1487
Closed

Adding configurables breaks contracts | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 #1475

DefiCake opened this issue Aug 1, 2024 · 2 comments · Fixed by #1487
Assignees
Labels
blocked bug Something isn't working

Comments

@DefiCake
Copy link
Member

DefiCake commented Aug 1, 2024

Reproduction: https://github.com/DefiCake/fuels-rs-65-configurables-issue
To run: forc build && cargo test

All transactions to a contract that has been initialized with configurables seem to fail. In the reproduction you can see that I am trying to call a pure function _proxy_pure_fn that is supposed to return 255.

Function definition:
https://github.com/DefiCake/fuels-rs-65-configurables-issue/blob/db85be605137a197d9979dc8b401b35a5839c443/src/main.sw#L103

Call in the tests:
https://github.com/DefiCake/fuels-rs-65-configurables-issue/blob/db85be605137a197d9979dc8b401b35a5839c443/tests/harness.rs#L131

In the test file, there are two functions test_with_configurables and test_without_configurables whose only difference is:

let configurables = MyContractConfigurables::default()
            .with_INITIAL_OWNER(State::Initialized(wallet.address().into()))
            .unwrap()
            .with_INITIAL_TARGET(
                ContractId::from_str(
                    "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
                ).unwrap()
            )
            .unwrap();

// With configurables:
let load_configuration = LoadConfiguration::default().with_configurables(configurables);
// Without configurables:
let load_configuration = LoadConfiguration::default();

UPDATE. It seems the issue revolves around

.with_INITIAL_TARGET(
    ContractId::from_str(
        "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
    ).unwrap()
)

Removing this specific configurable also makes the test pass

@DefiCake DefiCake changed the title Adding configurables botch the contract | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 Adding configurables breaks contracts | fuels v0.65.1, forc 0.61.2 / forc 0.62.0 Aug 1, 2024
@hal3e hal3e self-assigned this Aug 5, 2024
@hal3e hal3e added the bug Something isn't working label Aug 5, 2024
@hal3e
Copy link
Contributor

hal3e commented Aug 19, 2024

fix got merged: FuelLabs/sway#6366
we are waiting for a new forc release

@hal3e
Copy link
Contributor

hal3e commented Aug 20, 2024

the issue is resolved. I tested it with:

fuel-asm = "0.56.0"
fuel-tx = "0.56.0"
fuel-core-types = { version = "0.32.1", default-features = false }
fuels = { version = "0.66.1", features = ["fuel-core-lib"] }

and forc 0.63.1

ak-tech007 added a commit to ak-tech007/Rust-SDK that referenced this issue Dec 6, 2024
closes: FuelLabs/fuels-rs#1475

### Checklist
- [x] I have linked to any relevant issues.
- [x] I have added necessary labels.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.

Co-authored-by: Ahmed Sagdati <37515857+segfault-magnet@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants