#285 Removes _with_configurables() functions from Bytecode Library in favor of using an Option.
The following demonstrates the breaking change.
Before:
// Compute bytecode root
let root_no_configurables: BytecodeRoot = compute_bytecode_root(my_bytecode);
let root_with_configurables: BytecodeRoot = compute_bytecode_root_with_configurables(my_bytecode, my_configurables);
// Compute predicate address
let address_no_configurables: Address = compute_predicate_address(my_bytecode);
let address_with_configurables: Address = compute_predicate_address_with_configurables(my_bytecode, my_configurables);
// Verify contract bytecode
verify_contract_bytecode(my_contract_id, my_bytecode); // No configurables
verify_contract_bytecode_with_configurables(my_contract_id, my_bytecode, my_configurables); // With configurables
// Verify predicate address
verify_predicate_address(my_predicate_address, my_bytecode); // No configurables
verify_predicate_address_with_configurables(my_predicate_address, my_bytecode, my_configurables); // With configurables
After:
// Compute bytecode root
let root_no_configurables: BytecodeRoot = compute_bytecode_root(my_bytecode, None);
let root_with_configurables: BytecodeRoot = compute_bytecode_root(my_bytecode, Some(my_configurables));
// Compute predicate address
let address_no_configurables: Address = compute_predicate_address(my_bytecode, None);
let address_with_configurables: Address = compute_predicate_address(my_bytecode, Some(my_configurables));
// Verify contract bytecode
verify_contract_bytecode(my_contract_id, my_bytecode, None); // No configurables
verify_contract_bytecode(my_contract_id, my_bytecode, Some(my_configurables)); // With configurables
// Verify predicate address
verify_predicate_address(my_predicate_address, my_bytecode, None); // No configurables
verify_predicate_address(my_predicate_address, my_bytecode, Some(my_configurables)); // With configurables
#286 The support functions for Metadata have been removed. They have been moved to sway-standards.
Before:
use sway_libs::asset::metadata::*;
fn foo(my_metadata: Metadata) {
let res: bool = my_metadata.is_b256();
let res: bool = my_metadata.is_string();
let res: bool = my_metadata.is_bytes();
let res: bool = my_metadata.is_uint();
}
After:
use standards::src7::*;
fn foo(my_metadata: Metadata) {
let res: bool = my_metadata.is_b256();
let res: bool = my_metadata.is_string();
let res: bool = my_metadata.is_bytes();
let res: bool = my_metadata.is_uint();
}
#286 The SetMetadata abi set_metadata function definition has changed. The metadata argument is now an Option<Metadata> and the argument order has changed.
#290 The _proxy_owner(), only_proxy_owner() and _set_proxy_owner() functions no longer take storage.proxy_owner as a parameter. Instead they directly read and write to the storage slot 0xbb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754 which is sha256("storage_SRC14_1").
Type of change
[Version 0.24.0]
Added v0.24.0
BytecodeRoot
andContractConfigurables
types to the Bytecode Library._metadata()
function to the Asset Library.Changed v0.24.0
_set_metadata()
,_set_name()
and_set_symbol()
now revert if the metadata is an empty string._set_metadata()
now reverts if the metadata is empty bytes._mint()
and_burn()
now revert if theamount
argument is zero.v0.63.3
, fuel-corev0.34.0
, and fuelsv0.66.2
.v0.24.0
release.Breaking v0.24.0
_with_configurables()
functions from Bytecode Library in favor of using anOption
.The following demonstrates the breaking change.
Before:
After:
Metadata
have been removed. They have been moved to sway-standards.Before:
After:
SetMetadata
abiset_metadata
function definition has changed. Themetadata
argument is now anOption<Metadata>
and the argument order has changed.Before:
After:
_set_name()
,_set_symbol()
,_mint()
, and_set_metdata()
functionsname
,symbol
,sub_id
, andmetadata
arguments are nowOption
s.Before:
After:
_proxy_owner()
,only_proxy_owner()
and_set_proxy_owner()
functions no longer takestorage.proxy_owner
as a parameter. Instead they directly read and write to the storage slot0xbb79927b15d9259ea316f2ecb2297d6cc8851888a98278c0a2e03e1a091ea754
which issha256("storage_SRC14_1")
.Before:
After: