- a3c8d89: The Magic Protocol web app is now built for version 2 of the Magic protocol. Improvements include segwit capabilities, less transactions, and improved security.
- 58c2d4b: Adds validation to an inbound's swap expiration to ensure it doesn't expire too far in the future.
- c877f7b: Fixes issues with Gaia hub integration due to domain migration
-
6e076a7
Thanks @dumbledope! - Fixed an issue where validating outbound swap expiry usedblock-height
instead ofburn-block-height
.In
bridge.clar
, outbound swaps have acreated-at
field which is set when the swap is initiated. This field represents the burn block height where the swap transaction was confirmed.In the
revoke-outbound-swap
function, there is validation to ensure that the swap has expired (200 blocks have passed). Unfortunately, this function was checking the Stacks block height, not the burn block height.While not exploitable, this unfortunately would prevent users from revoking outbound swaps in production environments. This is because a Stacks block height is thousands of blocks lower than burn chain heights - meaning it would take years for a swap to "expire".
The fix was to change line 759 in
bridge.clar
to useburn-block-height
instead ofblock-height
.
3027586
Thanks @dumbledope! - Added betterprint
events to major contract calls, which allows for better off-chain monitoring.
515f698
Thanks @dumbledope! - Updated the project to use the official xBTC contract, using Clarinet requirements for development.
- #10
6a90055
Thanks @dumbledope! - Removedname
from the supplier registry
- #11
30d6fd4
Thanks @dumbledope! - Inescrow-swap
, validate that the tx-sender is equal to the swapper. This ensures thatmin-to-receive
is specified by the end user.
af53850
Thanks @dumbledope! - Adds arevoke-expired-inbound
function. This is used after an inbound swap is expired and not finalized. It will mark the swap as finalized and move funds from escrow back to the supplier.
ac0e1bf
Thanks @dumbledope! - Adds a script to run electrum_server via docker
- #9
eb2df29
Thanks @dumbledope! - Adds fee validation to theupdate-supplier-fees
method
-
dd7c72e
Thanks @dumbledope! - Removed theupdate-supplier
method in favor of 3 separate methods:update-supplier-fees
,update-supplier-name
, andupdate-supplier-public-key
.Also added docs for the main public-facing functions in the bridge contract.
- #1
a965339
Thanks @dumbledope! - - We’ve extended theclarity-bitcoin
contract to enable validating BTC transactions that occurred during a Stacks block- The new function is called
was-tx-mined-prev?
- Previously, this would lead to users or suppliers being “stuck” in some situations
- Updated the bridge contract to support this new functionality
- Tests and code for recovering an inbound swap
- In rare scenarios, an inbound swap can fail at the “escrow” phase if the supplier runs out of liquidity before the escrow is completed. In this scenario, the swapper needs to wait 500 blocks before recovering their BTC.
- Contract code for recovering an outbound swap (
revoke-expired-outbound-swap
)- If the supplier never sends BTC to a swapper, a user can recover their xBTC after waiting 1 day.
- Renamed all
operator
contract variables tosupplier
- The new function is called
- First version!