Bitcoin-Stacks Bridge Smart Contract Implementation#1
Open
adeshola-code wants to merge 12 commits intomainfrom
Open
Bitcoin-Stacks Bridge Smart Contract Implementation#1adeshola-code wants to merge 12 commits intomainfrom
adeshola-code wants to merge 12 commits intomainfrom
Conversation
- Added `bridgeable-token-trait` defining transfer and get-balance functions. - Defined error codes for various bridge-related errors. - Set constants for contract deployer, deposit limits, and required confirmations. - Initialized data variables for bridge status, total bridged amount, and last processed height.
- Added `bridgeable-token-trait` defining transfer and get-balance functions. - Defined error codes for various bridge-related errors. - Set constants for contract deployer, deposit limits, and required confirmations. - Initialized data variables for bridge status, total bridged amount, and last processed height.
- Set constants for contract deployer, deposit limits, and required confirmations. - Initialized data variables for bridge status, total bridged amount, and last processed height. - Defined data maps for deposits, validators, validator signatures, and bridge balances.
- Added `initialize-bridge` function to set the bridge paused state to false, callable only by the contract deployer. - Added `pause-bridge` function to set the bridge paused state to true, callable only by the contract deployer.
- Added `resume-bridge` function to resume the bridge if paused, callable only by the contract deployer. - Added `add-validator` function to add a validator to the bridge, callable only by the contract deployer.
- Added `remove-validator` function to remove a validator from the bridge, callable only by the contract deployer. - Added `initiate-deposit` function for validators to initiate a deposit into the bridge with necessary validations.
…bridge - Added `confirm-deposit` function for validators to confirm a deposit into the bridge with necessary validations. - Added `withdraw` function to withdraw an amount from the bridge to a Bitcoin recipient address with necessary validations.
- Added `emergency-withdraw` function to allow the contract deployer to perform an emergency withdrawal with necessary validations.
- Added `get-deposit` to retrieve deposit details using the transaction hash. - Added `get-bridge-status` to check if the bridge is paused. - Added `get-validator-status` to check if a given principal is a validator. - Added `get-bridge-balance` to retrieve the bridge balance of a user. - Added `is-valid-principal` to validate if a given principal address is valid.
- Added `is-valid-btc-address` to validate Bitcoin addresses. - Added `is-valid-tx-hash` to validate transaction hashes. - Added `is-valid-signature` to validate signatures. - Added `validate-deposit-amount` to check if a deposit amount is within the allowed range.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a secure cross-chain bridge enabling asset transfers between Bitcoin and Stacks blockchains. The implementation includes comprehensive validation, security measures, and emergency controls.
Key Features
Implementation Details
Core Components
Token Interface Implementation
Security Features
Data Management
Technical Specifications
Documentation
Security Considerations
Checklist