Skip to content

Commit 84ca045

Browse files
committed
chore: resolve merge conflicts
2 parents 63018b6 + fe545df commit 84ca045

14 files changed

+155
-111
lines changed

.changeset/famous-walls-matter.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuel-bridge/solidity-contracts': minor
3+
---
4+
5+
fix pnpm audit findings

.changeset/polite-spiders-applaud.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@fuel-bridge/solidity-contracts': minor
3+
---
4+
5+
add `_disableInitializers()` to FuelMessagePortal V2 and V3

package.json

+12-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
"@fuels/eslint-plugin": "0.20.0",
3333
"@fuels/prettier-config": "0.0.10",
3434
"@fuels/ts-config": "0.0.10",
35+
"eslint": "^8.49.0",
3536
"fuels": "0.94.0",
36-
"eslint": "8.49.0",
37-
"prettier": "2.7.1",
38-
"tsup": "7.2.0",
39-
"tsx": "3.12.7",
40-
"turbo": "1.10.7"
37+
"prettier": "^2.7.1",
38+
"tsup": "^7.2.0",
39+
"tsx": "^3.12.7",
40+
"turbo": "^1.10.7"
4141
},
4242
"devDependencies": {
4343
"@changesets/cli": "2.26.2",
@@ -46,7 +46,13 @@
4646
"pnpm": {
4747
"overrides": {
4848
"braces": ">=3.0.3",
49-
"ws@<7.5.10": "7.5.10"
49+
"ws@<7.5.10": "7.5.10",
50+
"axios@>=0.8.1 <0.28.0": ">=0.28.0",
51+
"axios@>=1.3.2 <=1.7.3": ">=1.7.4",
52+
"elliptic@>=4.0.0 <=6.5.6": ">=6.5.7",
53+
"elliptic@>=2.0.0 <=6.5.6": ">=6.5.7",
54+
"elliptic@>=5.2.1 <=6.5.6": ">=6.5.7",
55+
"micromatch@<4.0.8": ">=4.0.8"
5056
}
5157
}
5258
}

packages/base-asset/Forc.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ license = "Apache-2.0"
55
name = "base-asset-contract"
66

77
[dependencies]
8-
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
8+
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.6.0" }

packages/base-asset/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The contract deployed on the Fuel Network which implements the SRC-20 standard f
1313

1414
## Contract ID
1515

16-
The `ContractId` of the base asset SRC-20 implementation is `0xa20eb159e6460c47f438cb9e9f653a8d5084146ca115c774181c0620608d15a3`. This is calculated using the zero salt (`0x00..00`).
16+
The `ContractId` of the base asset SRC-20 implementation is `0xf746b8dfe2a6545119b421753ab465a9c21094709f0df7926c6d33cb90797d45`. This is calculated using the zero salt (`0x00..00`).
1717

1818
## Asset Id
1919

20-
The `AssetId` fo the base asset SRC-20 implementation is `0xa48cdc6b0bc20843b9a755a6fffc6ff9a0965b1aff0d58cc9247dc72b8bbd61f`. This calculated by taking the SHA256 hash digest of the ContractId and the zero SubId (`0x00..00`) i.e. sha256((contract_id, sub_id)).
20+
The `AssetId` fo the base asset SRC-20 implementation is `0x2361e96b094f3bb902d53d86f3172333587054de09c7ab6c639bd3c52e252aa7`. This calculated by taking the SHA256 hash digest of the ContractId and the zero SubId (`0x00..00`) i.e. sha256((contract_id, sub_id)).
2121

2222
## Compiled Output
2323

3.38 KB
Binary file not shown.

packages/base-asset/bin/base-asset-contract.hex

+1-1
Large diffs are not rendered by default.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[toolchain]
2+
channel = "nightly-2024-08-20"
3+
4+
[components]
5+
forc = "0.63.1"
6+
fuel-core = "0.33.0"

packages/base-asset/src/main.sw

+37-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
contract;
22

33
use std::string::String;
4-
use standards::src20::SRC20;
4+
use standards::src20::{SetDecimalsEvent, SetNameEvent, SetSymbolEvent, SRC20, TotalSupplyEvent,};
55

6-
configurable {
7-
/// The decimals of the base asset.
8-
DECIMALS: u8 = 9u8,
9-
/// The base asset of the fuel network.
10-
NAME: str[5] = __to_str_array("Ether"),
11-
/// The symbol of the base asset of the fuel network.
12-
SYMBOL: str[3] = __to_str_array("ETH"),
13-
}
6+
/// The decimals of the base asset
7+
const DECIMALS: u8 = 9u8;
8+
/// The base asset of the fuel network.
9+
const NAME: str[5] = __to_str_array("Ether");
10+
/// The symbol of the base asset of the fuel network.
11+
const SYMBOL: str[3] = __to_str_array("ETH");
1412

1513
impl SRC20 for Contract {
1614
/// The total number of assets minted by a contract, for the base asset this is always one.
@@ -66,7 +64,7 @@ impl SRC20 for Contract {
6664
/// }
6765
/// ```
6866
#[storage(read)]
69-
fn total_supply(asset: AssetId) -> Option<u64> {
67+
fn total_supply(_asset: AssetId) -> Option<u64> {
7068
None
7169
}
7270

@@ -160,3 +158,32 @@ impl SRC20 for Contract {
160158
}
161159
}
162160
}
161+
162+
abi EmitSRC20Events {
163+
fn emit_src20_events();
164+
}
165+
166+
impl EmitSRC20Events for Contract {
167+
fn emit_src20_events() {
168+
let asset = AssetId::base();
169+
let sender = msg_sender().unwrap();
170+
171+
log(SetNameEvent {
172+
asset,
173+
name: Some(String::from_ascii_str(from_str_array(NAME))),
174+
sender,
175+
});
176+
177+
log(SetSymbolEvent {
178+
asset,
179+
symbol: Some(String::from_ascii_str(from_str_array(SYMBOL))),
180+
sender,
181+
});
182+
183+
log(SetDecimalsEvent {
184+
asset,
185+
decimals: DECIMALS,
186+
sender,
187+
});
188+
}
189+
}

packages/base-asset/tests/harness.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use std::{fs, str::FromStr};
77

88
// Matches the README addresses
99
const BASE_ASSET_CONTRACT_ID: &str =
10-
"0xd17f4e36757d33bee4efc86b49c38c1434a3beb21dee33146f311a5099f11789";
11-
const BASE_ASSET_ID: &str = "0x2797c97693be62496cb885c133ded97377ce0b5cd8f08f261f031fd78e2b17be";
10+
"0xf746b8dfe2a6545119b421753ab465a9c21094709f0df7926c6d33cb90797d45";
11+
const BASE_ASSET_ID: &str = "0x2361e96b094f3bb902d53d86f3172333587054de09c7ab6c639bd3c52e252aa7";
1212
const BASE_ASSET_CONTRACT_BYTECODE_PATH: &str = "out/release/base-asset-contract.bin";
1313
const BASE_ASSET_CONTRACT_HEX_PATH: &str = "bin/base-asset-contract.hex";
1414
const BASE_ASSET_CONTRACT_BIN_PATH: &str = "bin/base-asset-contract.bin";

packages/solidity-contracts/contracts/fuelchain/FuelMessagePortal/v2/FuelMessagePortalV2.sol

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ contract FuelMessagePortalV2 is FuelMessagePortal {
1616
constructor(uint256 _depositLimitGlobal) {
1717
/// @custom:oz-upgrades-unsafe-allow state-variable-assignment
1818
depositLimitGlobal = _depositLimitGlobal;
19+
_disableInitializers();
1920
}
2021

2122
////////////////////////

packages/solidity-contracts/contracts/fuelchain/FuelMessagePortal/v3/FuelMessagePortalV3.sol

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ contract FuelMessagePortalV3 is FuelMessagePortalV2 {
3838

3939
constructor(uint256 _depositLimitGlobal, uint256 _rateLimitDuration) FuelMessagePortalV2(_depositLimitGlobal) {
4040
rateLimitDuration = _rateLimitDuration;
41+
_disableInitializers();
4142
}
4243

4344
function initialize(FuelChainState) public virtual override {

packages/solidity-contracts/package.json

+37-37
Original file line numberDiff line numberDiff line change
@@ -30,47 +30,47 @@
3030
"lint": "prettier --list-different --plugin=prettier-plugin-solidity 'contracts/**/*.sol'"
3131
},
3232
"devDependencies": {
33-
"@fuel-ts/merkle": "0.21.2",
34-
"@inquirer/prompts": "5.3.8",
35-
"@nomicfoundation/hardhat-chai-matchers": "2.0.4",
36-
"@nomicfoundation/hardhat-ethers": "3.0.5",
37-
"@nomicfoundation/hardhat-network-helpers": "1.0.10",
33+
"@fuel-ts/merkle": "^0.21.2",
34+
"@inquirer/prompts": "^5.3.8",
35+
"@nomicfoundation/hardhat-chai-matchers": "^2.0.4",
36+
"@nomicfoundation/hardhat-ethers": "^3.0.5",
37+
"@nomicfoundation/hardhat-network-helpers": "^1.0.10",
3838
"@nomicfoundation/hardhat-verify": "1.1.1",
39-
"@openzeppelin/contracts": "4.8.3",
40-
"@openzeppelin/contracts-upgradeable": "4.8.3",
41-
"@openzeppelin/hardhat-upgrades": "3.0.4",
42-
"@typechain/ethers-v6": "0.5.1",
43-
"@typechain/hardhat": "9.1.0",
44-
"@types/chai": "4.3.4",
39+
"@openzeppelin/contracts": "^4.8.3",
40+
"@openzeppelin/contracts-upgradeable": "^4.8.3",
41+
"@openzeppelin/hardhat-upgrades": "^3.0.4",
42+
"@typechain/ethers-v6": "^0.5.1",
43+
"@typechain/hardhat": "^9.1.0",
44+
"@types/chai": "^4.3.4",
4545
"@types/cors": "2.8.17",
46-
"@types/express": "4.17.14",
47-
"@types/lodash": "4.14.202",
48-
"@types/mocha": "10.0.0",
49-
"@types/node": "18.11.9",
50-
"@typescript-eslint/eslint-plugin": "5.43.0",
51-
"@typescript-eslint/parser": "5.43.0",
52-
"chai": "4.3.7",
46+
"@types/express": "^4.17.14",
47+
"@types/lodash": "^4.14.202",
48+
"@types/mocha": "^10.0.0",
49+
"@types/node": "^18.11.9",
50+
"@typescript-eslint/eslint-plugin": "^5.43.0",
51+
"@typescript-eslint/parser": "^5.43.0",
52+
"chai": "^4.3.7",
5353
"cors": "2.8.5",
54-
"dotenv": "16.0.3",
54+
"dotenv": "^16.0.3",
5555
"ethers": "6.13.1",
56-
"express": "4.18.2",
56+
"express": "^4.18.2",
5757
"fuels": "0.94.0",
58-
"hardhat": "2.20.1",
59-
"hardhat-deploy": "0.11.44",
60-
"inquirer": "10.1.8",
61-
"lodash": "4.17.21",
62-
"markdownlint": "0.26.2",
63-
"markdownlint-cli": "0.32.2",
64-
"node-fetch": "2.6.7",
65-
"npm-run-all": "4.1.5",
66-
"prettier-plugin-solidity": "1.1.3",
67-
"solc": "0.8.17",
58+
"hardhat": "^2.20.1",
59+
"hardhat-deploy": "^0.12.4",
60+
"inquirer": "^10.1.8",
61+
"lodash": "^4.17.21",
62+
"markdownlint": "^0.26.2",
63+
"markdownlint-cli": "^0.32.2",
64+
"node-fetch": "^2.6.6",
65+
"npm-run-all": "^4.1.5",
66+
"prettier-plugin-solidity": "^1.1.3",
67+
"solc": "^0.8.17",
6868
"solhint": "3.3.7",
69-
"solidity-coverage": "0.8.5",
70-
"ts-generator": "0.1.1",
71-
"ts-node": "10.9.1",
72-
"tsup": "7.2.0",
73-
"typechain": "8.3.2",
74-
"typescript": "4.9.3"
69+
"solidity-coverage": "^0.8.5",
70+
"ts-generator": "^0.1.1",
71+
"ts-node": "^10.9.1",
72+
"tsup": "^7.2.0",
73+
"typechain": "^8.3.2",
74+
"typescript": "^4.9.3"
7575
}
76-
}
76+
}

0 commit comments

Comments
 (0)