Skip to content

Commit

Permalink
eth: fix unbound variable errors in shell utilities (wormhole-foundat…
Browse files Browse the repository at this point in the history
…ion#4103)

The `set -u` options in these scripts caused them to fail with 'unbound
variable' errors when CLI args or env variables were unset. This commit
fixes the validation so that the scripts output usage info or helpful
errors instead of exiting with unbound variable errors that the user
must read the source to diagnose.

for the script `ethereum/sh/upgrade_all_testnet.sh`, the commit updates
a variable name that appears incorrect.

node/hack: Print potential USD stablecoins that appear depegged (wormhole-foundation#4130)

* node/hack: Print potential USD stablecoins that appear depegged

* PR feedback

whitepapers: Clarify CCQ sol_pda support (wormhole-foundation#4129)

GitHub: Update code owners for go sdk (wormhole-foundation#4133)

Deploy Unichain testnet (wormhole-foundation#4134)

* Deploy Unichain testnet

* Add snaxchain to proto

node: Governor token list update (wormhole-foundation#4126)

* node: governor token list update

* Manually fix token price

---------

Co-authored-by: djb15 <[email protected]>

docs: Update SECURITY.md

Replace Guardian Key with abstracted Guardian Signer (wormhole-foundation#4120)

* node: add guardiansigner node/pkg

* node: replace use of guardian key with guardian signer

* node: replace use of vaa.AddSigner with guardian signer

* node: add nolint for armor import and fix test

* node: handle error returned from signing

* apply draft review suggestions

* apply pr reviews

* apply pr reviews

* apply pr reviews

* apply pr reviews

---------

Co-authored-by: pleasew8t <[email protected]>

Deploy Worldchain testnet (wormhole-foundation#4140)

* Deploy Worldchain testnet

* Update WETH address

* Fix cli test and add token bridge VAAs

add deprecation warning to the top of SDK readme (wormhole-foundation#4142)

spy: respect --port if set (wormhole-foundation#4139)

codeowners: Update for audits folder (wormhole-foundation#4144)

Deploy Monad Devnet (wormhole-foundation#4145)

* Deploy Monad Devnet

* Code review rework

docs: Audit reports (wormhole-foundation#4143)

* docs: Audit reports

* Rename

cosmwasm: add wormchain ibc receiver tests (wormhole-foundation#4121)

cosmwasm: add support for json schemas for all contracts (wormhole-foundation#4118)

* cosmwasm: add support for json schemas for all contracts

* cosmwasm: fixed formatting as per the linter

Node: Remove cutover checks (wormhole-foundation#4149)

Add interchaintest tests to wormchain
  • Loading branch information
johnsaigle authored and kakucodes committed Dec 10, 2024
1 parent 818fda3 commit bf5c42e
Show file tree
Hide file tree
Showing 97 changed files with 3,077 additions and 2,527 deletions.
8 changes: 6 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
/lp_ui/ @evan-gray @kev1n-peters
/relayer/generic_relayer @nonergodic @gator-boi
/scripts/ @evan-gray @kcsongor
/sdk/ @bruce-riley @evan-gray @kev1n-peters @SEJeff
/sdk/ @bruce-riley @evan-gray @kev1n-peters @panoel @SEJeff
/sdk/js-proto-node/ @evan-gray @kev1n-peters
/sdk/js-proto-web/ @evan-gray @kev1n-peters
/sdk/js-query/ @evan-gray @kev1n-peters @bruce-riley
/sdk/js-wasm/ @evan-gray @kev1n-peters
/sdk/js/ @evan-gray @kev1n-peters @panoel
/sdk/rust/ @a5-pickle
/sdk/vaa/ @bruce-riley @SEJeff
/sdk/vaa/ @bruce-riley @evan-gray @panoel @SEJeff
/spydk/ @evan-gray
/testing/ @a5-pickle @evan-gray
/wormchain/contracts/tools/ @evan-gray @kev1n-peters @panoel
Expand Down Expand Up @@ -95,3 +95,7 @@
## Documentation

/docs @evan-gray @SEJeff @bruce-riley

## Audit Reports

/audits @djb15 @SEJeff @johnsaigle @mdulin2 @pleasew8t
21 changes: 10 additions & 11 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,21 @@ As these 3rd party audits are completed and issues are sufficiently addressed, w
- **[April 2023 - Trail of Bits](https://github.com/wormhole-foundation/wormhole-audits/blob/main/Wormhole_Audit_Report_TrailOfBits_2023-04.pdf)**: _Guardian node: Governor and Watchers_
- **[April 2023 - OtterSec](https://github.com/wormhole-foundation/wormhole-audits/blob/main/Wormhole_OtterSec_Sui_2023-04.pdf)**: _Sui Contracts_
- **[May 2023 - Runtime Verification](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2023-05_Runtime_Verification_Wormhole_EVM.pdf)**: _Formal Verification of EVM contracts_
- **[Jan 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-01-10-cyfrin-thermae-v2.0.pdf)**: _Uniswap Liquidity Layer EVM Contracts_
- **[Jan 2024 - OtterSec](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-01-ottersec-terra.pdf)**: _Terra Classic Contract Upgrades_
- **[Feb 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-09-cyfrin-wormhole-evm-cctp-v2-1.pdf)**: _CCTP EVM Contracts_
- **[Mar 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-11-cyfrin-wormhole-evm-ntt.pdf)**: _NTT EVM Contracts_
- **[Mar 2024 - Cantina](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-cantina-wormhole-evm-ntt.pdf)**: _NTT EVM Contracts_
- **[Mar 2024 - OtterSec](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-03-28-ottersec-solana-ntt.pdf)**: _NTT Solana Contracts_
- **[Mar 2024 - Neodyme](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-12-neodyme-solana-ntt.pdf)**: _NTT Solana Contracts_
- **[January 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-01-10-cyfrin-thermae-v2.0.pdf)**: _Uniswap Liquidity Layer EVM Contracts_
- **[January 2024 - OtterSec](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-01-ottersec-terra.pdf)**: _Terra Classic Contract Upgrades_
- **[February 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-09-cyfrin-wormhole-evm-cctp-v2-1.pdf)**: _CCTP EVM Contracts_
- **[March 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-11-cyfrin-wormhole-evm-ntt.pdf)**: _NTT EVM Contracts_
- **[March 2024 - Cantina](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-cantina-wormhole-evm-ntt.pdf)**: _NTT EVM Contracts_
- **[March 2024 - OtterSec](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-03-28-ottersec-solana-ntt.pdf)**: _NTT Solana Contracts_
- **[March 2024 - Neodyme](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-04-12-neodyme-solana-ntt.pdf)**: _NTT Solana Contracts_
- **[July 2024 - Cyfrin](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-07-23-cyfrin-wormhole-evm-ntt-diff-v1.1.0.pdf)**: _NTT EVM v1.1.0_
- **[August 2024 - OtterSec](https://github.com/wormhole-foundation/wormhole-audits/blob/main/2024-08-02-ottersec-solana-ntt-token-extensions.pdf)**: _NTT Solana Token Extensions_

## Bug Bounty Program

The Wormhole project operates a bug bounty program to financially incentivize independent researchers for finding and responsibly disclosing security issues.

- [Immunefi-Hosted Program](https://immunefi.com/bounty/wormhole/)
- **Scopes**: Guardian and Smart Contracts
- **Rewards**: Up to $5,000,000 USDC
- **KYC**: Required
[Immunefi-Hosted Program](https://immunefi.com/bug-bounty/wormhole/information/)

If you find a security issue in Wormhole, please report the issue immediately using the bug bounty program above.

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added audits/2023-04-trailofbits-node.pdf
Binary file not shown.
Binary file added audits/algorand/2022-08-kudelski-algorand.pdf
Binary file not shown.
Binary file added audits/algorand/2022-10-coinspect-algorand.pdf
Binary file not shown.
Binary file added audits/aptos/2022-10-ottersec-aptos.pdf
Binary file not shown.
Binary file added audits/aptos/2022-11-zellic-aptos.pdf
Binary file not shown.
Binary file added audits/aptos/2023-02-ottersec-aptos-nft.pdf
Binary file not shown.
Binary file added audits/evm/2023-03-certik-evm.pdf
Binary file not shown.
Binary file added audits/evm/2023-05-runtimeverification-evm.pdf
Binary file not shown.
Binary file added audits/near/2022-09-ottersec-near.pdf
Binary file not shown.
Binary file added audits/near/2022-10-hacken-near.pdf
Binary file not shown.
Binary file added audits/sui/2023-04-ottersec-sui.pdf
Binary file not shown.
Binary file added audits/terra/2024-01-ottersec-terra.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion clients/js/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("Info Tests", () => {
return;
}

const expectedOutput = "https://bsc-dataseed.binance.org/";
const expectedOutput = "https://bsc-rpc.publicnode.com";

expect(stdout.trim()).toBe(expectedOutput.trim());
done();
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/consts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Mainnet = {
chain_id: 1,
},
Bsc: {
rpc: "https://bsc-dataseed.binance.org/",
rpc: "https://bsc-rpc.publicnode.com",
key: getEnvVar("ETH_KEY"),
chain_id: 56,
},
Expand Down
7 changes: 7 additions & 0 deletions cosmwasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cosmwasm/contracts/cw20-wrapped/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ library = []
[dependencies]
cosmwasm-std = { version = "1.0.0" }
cosmwasm-storage = { version = "1.0.0" }
cosmwasm-schema = { version = "1.0.0" }
schemars = "0.8.8"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
cw2 = { version = "0.13.2" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use cosmwasm_schema::write_api;
use cw20_wrapped_2::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
write_api! {
instantiate: InstantiateMsg,
execute: ExecuteMsg,
query: QueryMsg,
}
}
36 changes: 19 additions & 17 deletions cosmwasm/contracts/cw20-wrapped/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#![allow(clippy::field_reassign_with_default)]
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use cosmwasm_schema::{cw_serde, QueryResponses};

use cosmwasm_std::{Addr, Binary, Uint128};
use cw20::Expiration;
use cw20::{AllowanceResponse, BalanceResponse, Expiration, TokenInfoResponse};

type HumanAddr = String;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[cw_serde]
pub struct InstantiateMsg {
pub name: String,
pub symbol: String,
Expand All @@ -18,24 +17,22 @@ pub struct InstantiateMsg {
pub init_hook: Option<InitHook>,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[cw_serde]
pub struct InitHook {
pub msg: Binary,
pub contract_addr: HumanAddr,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[cw_serde]
pub struct InitMint {
pub recipient: HumanAddr,
pub amount: Uint128,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
pub struct MigrateMsg {}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
pub enum ExecuteMsg {
/// Implements CW20. Transfer is a base message to move tokens to another account without triggering actions
Transfer {
Expand Down Expand Up @@ -94,17 +91,22 @@ pub enum ExecuteMsg {
UpdateMetadata { name: String, symbol: String },
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
// Generic information about the wrapped asset
#[returns(WrappedAssetInfoResponse)]
/// Generic information about the wrapped asset
WrappedAssetInfo {},

#[returns(BalanceResponse)]
/// Implements CW20. Returns the current balance of the given address, 0 if unset.
Balance {
address: HumanAddr,
},
Balance { address: HumanAddr },

#[returns(TokenInfoResponse)]
/// Implements CW20. Returns metadata on the contract - name, decimals, supply, etc.
TokenInfo {},

#[returns(AllowanceResponse)]
/// Implements CW20 "allowance" extension.
/// Returns how much spender can use from owner account, 0 if unset.
Allowance {
Expand All @@ -113,7 +115,7 @@ pub enum QueryMsg {
},
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[cw_serde]
pub struct WrappedAssetInfoResponse {
pub asset_chain: u16, // Asset chain id
pub asset_address: Binary, // Asset smart contract address in the original chain
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use cosmwasm_schema::write_api;
use ibc_translator::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
write_api! {
instantiate: InstantiateMsg,
execute: ExecuteMsg,
query: QueryMsg,
}
}
1 change: 1 addition & 0 deletions cosmwasm/contracts/mock-bridge-integration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ library = []
[dependencies]
cosmwasm-std = { version = "1.0.0" }
cosmwasm-storage = { version = "1.0.0" }
cosmwasm-schema = { version = "1.0.0" }
schemars = "0.8.8"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }

Expand Down
16 changes: 7 additions & 9 deletions cosmwasm/contracts/mock-bridge-integration/src/msg.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
use cosmwasm_schema::{cw_serde, QueryResponses};
use cosmwasm_std::Binary;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

type HumanAddr = String;

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[cw_serde]
pub struct InstantiateMsg {
pub token_bridge_contract: HumanAddr,
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
pub enum ExecuteMsg {
CompleteTransferWithPayload { data: Binary },
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
pub struct MigrateMsg {}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
#[serde(rename_all = "snake_case")]
#[cw_serde]
#[derive(QueryResponses)]
pub enum QueryMsg {
#[returns(())]
WrappedRegistry { chain: u16, address: Binary },
}
1 change: 1 addition & 0 deletions cosmwasm/contracts/token-bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ default = ["full"]
[dependencies]
cosmwasm-std = { version = "1.0.0" }
cosmwasm-storage = { version = "1.0.0" }
cosmwasm-schema = { version = "1.0.0" }
schemars = "0.8.8"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
cw20 = "0.13.2"
Expand Down
Loading

0 comments on commit bf5c42e

Please sign in to comment.