Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement sway standards #240

Merged
merged 41 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2a1f215
feat: upgrade forc to 0.63.1
DefiCake Aug 20, 2024
5aa96cd
chore: commit forc.lock
DefiCake Aug 20, 2024
676e7fb
chore: update fuels-rs to 0.66.1
DefiCake Aug 20, 2024
f27e8ab
chore: add execution type to fuels-rs simulate() calls
DefiCake Aug 20, 2024
2af5f6e
chore: use trait programs::calls::ContractDependency
DefiCake Aug 20, 2024
2d140c4
chore: replace FuelCallResponse with CallResponse
DefiCake Aug 20, 2024
4074dc6
chore: upgrade fuels to 0.94.0
DefiCake Aug 20, 2024
68c29e5
chore: adapt new ts-sdk typegen
DefiCake Aug 20, 2024
b13bba5
chore: update base asset
DefiCake Aug 20, 2024
205a220
chore: upgrade Dockerfiles
DefiCake Aug 20, 2024
cd1baed
chore: add changeset
DefiCake Aug 20, 2024
4ddd424
chore: apply cargo fmt
DefiCake Aug 20, 2024
ea23ae1
ci: upgrade CI versions
DefiCake Aug 20, 2024
a80d94c
ci: try to fix ci
DefiCake Aug 21, 2024
d070bb9
chore: make full-env copy the forc binary version from the toolchain …
DefiCake Aug 21, 2024
19a4554
ci: fix dockerfile build
DefiCake Aug 21, 2024
d2b529f
feat: upgrade forc dependencies
DefiCake Aug 21, 2024
f30b16a
feat: implement SRC20, SRC7, SRC8
DefiCake Aug 21, 2024
8b750e1
test: adapt tests
DefiCake Aug 21, 2024
4bb9cd0
Merge branch 'main' into deficake/92-add-src8
DefiCake Aug 26, 2024
22429b6
chore: add changeset
DefiCake Aug 27, 2024
79033ee
chore: upgrade to fuel-core 0.34
DefiCake Aug 27, 2024
3ab1f80
chore: change changeset description
DefiCake Aug 27, 2024
2f15c56
chore: update github workflow
DefiCake Aug 27, 2024
c526d70
chore: downgrade fuel-core and fuels-rs
DefiCake Aug 27, 2024
e4250a8
Merge branch 'main' into deficake/92-add-src8
DefiCake Aug 27, 2024
81d8968
chore: regenerate Cargo.lock
DefiCake Aug 27, 2024
03277b5
chore: regenerate Cargo.lock
DefiCake Aug 27, 2024
dd0d607
Merge branch 'main' into deficake/92-add-src8
DefiCake Aug 27, 2024
83e0c12
chore: update sway standards
DefiCake Aug 27, 2024
01ddce2
Update fungible bridge contract to sway-standards v0.6.0 (#246)
bitzoic Aug 27, 2024
8ea2e58
feat: implement SRC7, SRC8
DefiCake Aug 28, 2024
e88c5bb
chore: apply cargo fmt
DefiCake Aug 28, 2024
9e679c6
chore: apply forc fmt
DefiCake Aug 28, 2024
33ab8ae
fix: use chain ID as first element of sub_id digegst
DefiCake Aug 28, 2024
aca048c
Merge branch 'main' into deficake/92-add-src8
DefiCake Aug 29, 2024
a7bf418
feat: add zero address withdrawal check
DefiCake Aug 29, 2024
d6c4c94
Update packages/fungible-token/bridge-fungible-token/implementation/s…
DefiCake Aug 29, 2024
721fd41
Update packages/fungible-token/bridge-fungible-token/implementation/s…
DefiCake Aug 29, 2024
22e92b8
feat: remove use of constants ZERO_B256, ZERO_U256 in favour of ::zero()
DefiCake Aug 29, 2024
88d5a03
Merge branch 'main' into deficake/92-add-src8
K1-R1 Aug 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading