Commit 0e07326
committed
Make Address::from_contract_id pub (#989)
### What
Make Address::from_contract_id public and accessible to contracts.
### Why
I recently hid the function because it presents some problems and
constraints if used in contracts. From an portability point-of-view to
be able to run a contract already built on multiple networks contracts
would not have any hardcoded global state.
However @orbitlens pointed out that from an optimization standpoint it
may be preferred to have global state hardcoded even if that means
recompiling the contract for each network it is deployed on, or for each
specific deployment. The why is because no rent payments are required on
the additional data entries, and that there may be some savings in not
having to load a storage ledger entry.
We haven't yet done the work to confirm if it is indeed cheaper, but it
seems reasonable not to block developers from trying out different
workflows. The SDK doesn't need to be strongly opinionated on
everything, and this is an area where it feels like the SDK might be
being too parental.
Discussion about this occurred on Discord at:
https://discord.com/channels/897514728459468821/1118888566349631561/1119051351528321054
### Merging
This change is intended to be merged to `main`, and then backported into
a patch release based on the most recent release so that it can be
enjoyed today.
(cherry picked from commit 6d4b0b5)1 parent 1eefa1e commit 0e07326
2 files changed
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
240 | 243 | | |
241 | 244 | | |
242 | 245 | | |
| |||
310 | 313 | | |
311 | 314 | | |
312 | 315 | | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | 316 | | |
318 | 317 | | |
319 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | 183 | | |
187 | 184 | | |
188 | 185 | | |
| |||
0 commit comments