Skip to content

Commit

Permalink
NEAR: add Withdraw Event. Update common dependency (#44)
Browse files Browse the repository at this point in the history
* Add `FastBridgeWithdrawEvent`.
* Update `fast-bridge-common` dependency to v0.1.2.
* Update binary file.

Co-authored-by: Kirill <[email protected]>
  • Loading branch information
olga24912 and sept-en authored Jan 19, 2023
1 parent bf5b945 commit 57ac83a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion near/contracts/bridge/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rlp = "0.4.2"
tiny-keccak = "1.4.0"
parse_duration = "2.1.1"
eth-types = { git = "https://github.com/aurora-is-near/rainbow-bridge", rev = "3e859904f445105850c2a08b5a4b0fdc7680c841", default-features = false, features = ["eip1559"] }
fast-bridge-common = { git = "https://github.com/aurora-is-near/fast-bridge-common.git", tag = "0.1.1" }
fast-bridge-common = { git = "https://github.com/aurora-is-near/fast-bridge-common.git", tag = "0.1.2" }
near-plugins = { git = "https://github.com/aurora-is-near/near-plugins", rev = "c043add4c2a0810872c4326a55c5162bccd3f4ee" }
near-plugins-derive = { git = "https://github.com/aurora-is-near/near-plugins", rev = "c043add4c2a0810872c4326a55c5162bccd3f4ee" }

Expand Down
7 changes: 7 additions & 0 deletions near/contracts/bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,13 @@ impl FastBridge {
require!(is_promise_success(), "Error transfer");

self.decrease_balance(&sender_id, &token_id, &u128::try_from(amount).unwrap());

Event::FastBridgeWithdrawEvent {
recipient_id: sender_id,
token: token_id,
amount,
}
.emit();
}

#[access_control_any(roles(Role::ConfigManager))]
Expand Down
Binary file modified near/res/fastbridge.wasm
Binary file not shown.

0 comments on commit 57ac83a

Please sign in to comment.