Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Added ibc-hooks middleware by Osmosis.
WASM hooks: allows ICS-20 token transfers to initiate contract calls, serving various use cases.
Example: Sending tokens to Secret and immediately wrapping them as SNIP-20 token. For example, ATOM on Hub -> ATOM on Secret -> sATOMS on Secret
(2 transactions on 2 chains) now becomes ATOM on Hub -> sATOM on Secret
(1 transaction).
Example: Cross-chain swaps. Using IBC Hooks, an AMM on Secret can atomically swap tokens that originated on a different chain and are headed to Secret. The AMM can also send those tokens back to the originating chain.
Axelar GMP: Using IBC Hooks, a contract on Ethereum can call a contract on Secret and get a response back.
Ack callbacks: allow non-IBC contracts that send an IbcMsg::Transfer
to listen for the ack/timeout of the token transfer. This allows these contracts to definitively know whether the transfer was successful or not and act accordingly (refund if failed, continue if succeeded). See usage example here.
Added an optional memo
field to IbcMsg::Transfer
, to ease to use of the IBC Hooks ack callbacks feature. See usage example here.
Added contract upgrade feature.
On init, the creator can specify an admin address.
The admin can migrate the contract to a new code ID.
The admin can update or clear the admin address.
The admins of contracts that were instantiated before v1.10 are hardcoded according to proposal 262.
Hardcoded admins can only be updated/cleared with a future gov proposal.
When the new MsgMigrateContract
is invoked, the migrate()
function is being called on the new contract code, where the new contract can optionally perform state migrations. See usage example here.
Fixed a scenario where the enclave's light client might fail a valid node registration transaction.
Add support for uploading contracts that were compiled with Rust v1.70+.
Update Cosmos SDK to v0.45.16
Update Tendermint to CometBFT v0.34.29
Update IBC to v4.4.2
Update IAVL to v0.19.6
Update Packet Forward Middleware to v4.1.0
Fix initialization of x/vesting module
Add env.transaction.hash
to support SNIP-52
SNIP-52: https://github.com/SolarRepublic/SNIPs/blob/3cc16b7/SNIP-52.md#notification-data-algorithms
See usage example here.
Flush the enclave's cache in a random order
Fix the hardcoded admins feature
Fix PFM to stop dropping packets of IBC contracts.
This has always been a bug in PFM. It was introduced in v1.9 and was missed because of a bug in our CI system.
Fixed the bug in PFM and updated the dependency.
For more info see cosmos/ibc-apps#105.
Update IBC to v4.5.0
Fixed a bug in the v1.12 upgrade handler (8a67990)
Fixed Rosetta server
Patch a security issue (IBC vulnerability)
Support DCAP attestation
EPID attestation is still supported, until it'll be phased-out by Intel
Migrate to SGX 2.20
Bump github.com/cosmos/ibc-go/v4 from 4.5.1 to 4.6.0
Hardcode genesis block for Rosetta API
New Feature: Randomness injection for secret contracts.
Eliminates the need for contracts to bootstrap their own entropy pool.
Unique for every contract call.
Useful in lotteries, gaming, secure authentication protocols, protocols where unpredictable outcomes are essential for fairness and security, and much more. For more infomation on how to use this feature, see the documentation
New Feature: FinalizeTx.
Contracts can force the transaction to finalize at a certain point, otherwise revert.
Example: protect against sandwich attacks and potential transaction rollbacks.
Example: protect against cheating in gaming applications, where a malicious player could try to rollback a transaction in which they lost.
IBC: Updated ibc-go from v3.4.0 to v4.3.0.
New IBC Feature: Added packet-forward-middleware by Strangelove.
Other chains would be able to more easily route SCRT in the interchain. For example, sending SCRT from Osmosis to Hub now becomes a single transaction from Osmosis -> Secret
rather than a transaction from Osmosis -> Secret
, then a transaction from Secret -> Hub
.
New IBC Feature: Added IBC fee middleware.
Creates a fee market for relaying IBC packets.
New IBC Feature: Added IBC panic button.
Quickly shut down IBC in case of an emergency.
New Feature: Evaporate & Check Gas APIs The new Check Gas and Evaporate APIs allow contract developers to create contracts that consume a constant amount of gas, independently of their code path. This helps harden contracts against information leakage from the amount of gas consumed by a contract.
Bug Fix: Fixed an issue where nodes would sometimes stop if failing to enter SGX enclave
Bug Fix: Fixed a bug where stopping and restarting a node would often cause the node to apphash
Bug Fix: Fixed an issue where storing and deleting a key from storage in the same msg would cause it not to be deleted
Patch against SGX Downfall vulnerability.
HumanAddr
has been deprecated in favour of simply String
. It never added any significant safety bonus over String
and was just a marker type. The new type Addr
was created to hold validated addresses. Those can be created via Addr::unchecked
, Api::addr_validate
, Api::addr_humanize
and JSON deserialization. In order to maintain type safety, deserialization into Addr
must only be done from trusted sources like a contract's state or a query response. User inputs must be deserialized into String
.
deps.api.human_address(&CanonicalAddr)
=> deps.api.addr_humanize(&CanonicalAddr)
deps.api.canonical_address(&HumanAddr)
=> deps.api.addr_canonicalize(&str)
Use the new entry point system. From lib.rs remove
Then add the macro attribute #[cfg_attr(not(feature = "library"), entry_point)]
to your contract.rs as follows:
init
Env
split into Env
and MessageInfo
InitResponse
and InitResult
deprecated, please use Response
function name changed from init
to instantiate
handle
Env
split into Env
and MessageInfo
HandleResponse
and HandleResult
deprecated, please use Response
function name changed from handle
to execute
query
new argument Env
added
migrate
Env
split into Env
and MessageInfo
MigrateResponse
and MigrateResult
deprecated, please use Response
Response
can no longer be built using a struct literal. Please use Response::new
as well as relevant builder-style setters to set the data.
This is a step toward better API stability.
The sub-messages feature can be used to get the response data or events from the executed contract. For example, if a contract wants to get the address of the child contract which is instantiated from the contract. The contract can send MsgInstantiate
as sub-messages with ReplyOn::Success
option like https://github.com/terraswap/terraswap/blob/7cf47f5e811fe0c4643a7cd09500702c1e7f3a6b/contracts/terraswap_factory/src/contract.rs#L128-L142.
Then the reply is only executed when the instantiate is successful with the instantiate response data. https://github.com/terraswap/terraswap/blob/7cf47f5e811fe0c4643a7cd09500702c1e7f3a6b/contracts/terraswap_factory/src/contract.rs#L148-L170.
Rename the type Extern
to Deps
, and radically simplify the init/handle/migrate/query
entrypoints. Rather than &mut Extern<S, A, Q>
, use DepsMut
. And instead of &Extern<S, A, Q>
, use Deps
. If you ever pass eg. foo<A: Api>(api: A)
around, you must now use dynamic trait pointers: foo(api: &dyn Api)
. Here is the quick search-replace guide on how to fix contract.rs:
In production (non-test) code:
In test code only:
If you use cosmwasm-storage, in state.rs:
We can still use singleton
and bucket
. But if you want more advanced storage access, you can use cw-storage-plus
with following migration steps.
cowmasm_storage::Singleton
-> cw_stroage_plus::Item
Remove read_*
and store_*
functions
Define Item
as following (must prepend the length of key)
cosmwasm_storage::Bucket
-> cw_storage_plus::Map
Remove read_*
and store_*
functions
Define Map
as following
The core now just returns raw bytes without json encoding, so we can receive the query response as what the data was stored.
Also, mock_querier
has to remove one to_binary
from its raw query response.
Detailed Changelog of Secret Network can be found on the Github.
The Secret Network v1.5 update did not introduce any breaking changes for developers, other than some bug fixes described below;
Fix secret message parsing when a message is plaintext in IBC (#1199)
Update Cosmos SDK 0.45.9 -> 0.45.10 & Tendermint 0.34.21 -> 0.34.22 (#1230)
Update IBC 3.3.0 -> 3.3.1 (#1237)
Fix nested attributes signatures (#1241)
Fix some protobuf type names (256d9b2)
For more details on this upgrade, check the official release.
The Secret Network v1.6 update did not introduce any breaking changes for developers. General performance improvements were introduced and described below;
Changed internal WASM engine to Wasm3 from Wasmi. Contract performance increased greatly.
Reduced gas costs:
Default instruction cost 1 -> 2
Div instruction cost 16 -> 2
Mul instruction cost 4 -> 2
Mem instruction cost 2 -> 2
Contract Entry cost 100,000 -> 20,000
Read from storage base cost 1,000 -> 10
Write to storage base cost 2,000 -> 20
SecretJS 1.5 has been released, and uses GRPC-Gateway endpoints. Check it out here.
For more details on this upgrade, check the official release.
Fixed a critical bug in 1.7.0 that prevented new nodes from joining the network and existing nodes from restarting their secretd process.
Added the ability to rotate consensus seed during a network upgrade
this will be executed during this upgrade
Added expedited gov proposals
Initial params (can be amended with a param change proposal):
Minimum deposit: 750 SCRT
Voting time: 24 hours
Voting treshhold: 2/3 yes to pass
If an expedited proposal fails to meet the threshold within the scope of shorter voting duration, the expedited proposal is then converted to a regular proposal and restarts voting under regular voting conditions.
Added auto-restaking - an opt-in feature that enables automatic compounding of staking rewards
Added light-client validation for blocks
Protects against leaking private data using an offline fork attack
Enables trusted block heights and block time to be relied on by contracts