-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: loader contract being called via proxy (#3122)
* fix: resolve loader contract being called via a proxy * chore: changeset * chore: lint and add timeout * chore: update code ref
- Loading branch information
1 parent
8faeaa4
commit e9ad8d0
Showing
7 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@fuel-ts/contract": patch | ||
--- | ||
|
||
fix: loader contract being called via proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/fuel-gauge/test/fixtures/forc-projects/proxy-contract/Forc.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[project] | ||
authors = ["Fuel Labs <[email protected]>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "proxy-contract" | ||
|
||
[dependencies] |
29 changes: 29 additions & 0 deletions
29
packages/fuel-gauge/test/fixtures/forc-projects/proxy-contract/src/main.sw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
contract; | ||
|
||
use std::execution::run_external; | ||
|
||
abi Proxy { | ||
#[storage(write)] | ||
fn set_target_contract(id: ContractId); | ||
|
||
// this targets the method of the `large_contract project | ||
#[storage(read)] | ||
fn something() -> u64; | ||
} | ||
|
||
storage { | ||
target_contract: Option<ContractId> = None, | ||
} | ||
|
||
impl Proxy for Contract { | ||
#[storage(write)] | ||
fn set_target_contract(id: ContractId) { | ||
storage.target_contract.write(Some(id)); | ||
} | ||
|
||
#[storage(read)] | ||
fn something() -> u64 { | ||
let target = storage.target_contract.read().unwrap(); | ||
run_external(target) | ||
} | ||
} |