-
Notifications
You must be signed in to change notification settings - Fork 0
Bitcoin-Stacks Bridge Smart Contract Implementation #1
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
Open
adeshola-code
wants to merge
12
commits into
main
Choose a base branch
from
feature/add-smart-contract
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- 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.
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