Skip to content

Commit

Permalink
feat: implement sway standards (#240)
Browse files Browse the repository at this point in the history
Closes #92 
Closes #230

---------

Co-authored-by: Cameron Carstens <[email protected]>
Co-authored-by: K1-R1 <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent 4e2eaa5 commit c234e48
Show file tree
Hide file tree
Showing 27 changed files with 589 additions and 395 deletions.
7 changes: 7 additions & 0 deletions .changeset/six-wolves-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@fuel-bridge/message-predicates': minor
'@fuel-bridge/fungible-token': minor
'@fuel-bridge/test-utils': minor
---

Implement SRC-7 and SRC-20
34 changes: 34 additions & 0 deletions Cargo.lock

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

16 changes: 8 additions & 8 deletions Forc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "base-asset-contract"
source = "member"
dependencies = [
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.5.0#348f7175df4c012b23c86cdb18aab79025ca1f18",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.6.0#65e09f95ea8b9476b171a66c8a47108f352fa32c",
"std",
]

Expand All @@ -12,7 +12,7 @@ source = "member"
dependencies = [
"contract_message_receiver",
"interface",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.5.0#348f7175df4c012b23c86cdb18aab79025ca1f18",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.6.0#65e09f95ea8b9476b171a66c8a47108f352fa32c",
"std",
"sway_libs",
]
Expand Down Expand Up @@ -45,7 +45,7 @@ source = "member"
dependencies = [
"contract_message_receiver",
"interface",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.5.0#348f7175df4c012b23c86cdb18aab79025ca1f18",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.6.0#65e09f95ea8b9476b171a66c8a47108f352fa32c",
"std",
]

Expand All @@ -54,18 +54,18 @@ name = "reentrancy-attacker"
source = "member"
dependencies = [
"contract_message_receiver",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.5.0#348f7175df4c012b23c86cdb18aab79025ca1f18",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.6.0#65e09f95ea8b9476b171a66c8a47108f352fa32c",
"std",
]

[[package]]
name = "standards"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.4.3#6f63eb7dff2458a7d976184e565b5cbf26f61da2"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.5.2#270350e69bd7455b7e99f0aae2e29a94d42324bd"
dependencies = ["std"]

[[package]]
name = "standards"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.5.0#348f7175df4c012b23c86cdb18aab79025ca1f18"
source = "git+https://github.com/FuelLabs/sway-standards?tag=v0.6.0#65e09f95ea8b9476b171a66c8a47108f352fa32c"
dependencies = ["std"]

[[package]]
Expand All @@ -75,9 +75,9 @@ dependencies = ["core"]

[[package]]
name = "sway_libs"
source = "git+https://github.com/FuelLabs/sway-libs?tag=v0.21.0#6a227ed34c86fe1ebd334dbdfeccf66c43e3915b"
source = "git+https://github.com/FuelLabs/sway-libs?tag=v0.23.1#50be622109e3c584efc29edac5390c96f1ccc43a"
dependencies = [
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.4.3#6f63eb7dff2458a7d976184e565b5cbf26f61da2",
"standards git+https://github.com/FuelLabs/sway-standards?tag=v0.5.2#270350e69bd7455b7e99f0aae2e29a94d42324bd",
"std",
]

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@fuels/eslint-plugin": "0.20.0",
"@fuels/prettier-config": "0.0.10",
"@fuels/ts-config": "0.0.10",
"fuels": "0.94.1",
"eslint": "^8.49.0",
"fuels": "0.94.0",
"prettier": "^2.7.1",
"tsup": "^7.2.0",
"tsx": "^3.12.7",
Expand Down
2 changes: 2 additions & 0 deletions packages/fungible-token/bridge-fungible-token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ publish = false
[dependencies]
anyhow = "1.0.86"
ethers = {version = "=2.0.14"}
test-case = "3.1.0"

# Dependencies from fuel-core repository:
fuel-core-types = { workspace = true }
# Dependencies from fuels-rs repository:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ name = "bridge_fungible_token"
[dependencies]
contract_message_receiver = { path = "../../../message-predicates/contract-message-receiver" }
interface = { path = "../interface" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.5.0" }
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.21.0" }
standards = { git = "https://github.com/FuelLabs/sway-standards", tag = "v0.6.0" }
sway_libs = { git = "https://github.com/FuelLabs/sway-libs", tag = "v0.23.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use ::data_structures::{
deposit_message::DepositMessage,
metadata_message::MetadataMessage,
};
use std::{constants::ZERO_B256, inputs::input_message_data};
use std::inputs::input_message_data;

pub enum MessageData {
Deposit: DepositMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ library;
use std::{
alloc::alloc_bytes,
bytes::*,
constants::ZERO_B256,
inputs::input_message_data,
primitive_conversions::u64::*,
string::String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pub enum BridgeFungibleTokenError {
UnderflowError: (),
AssetNotFound: (),
InvalidAmount: (),
WithdrawalToZeroAddress: (),
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,3 @@ pub struct ClaimRefundEvent {
pub token_address: b256,
pub token_id: b256,
}

pub struct MetadataEvent {
pub token_address: b256,
// TODO: SDK does not support decoding these types
// pub symbol: String,
// pub name: String
}
Loading

0 comments on commit c234e48

Please sign in to comment.