Smart contracts for the Scalar Protocol, enabling cross-chain Bitcoin bridging using Axelar's General Message Passing (GMP).
The Scalar Protocol consists of the following main components:
- ScalarToken: An ERC20 token representing bridged Bitcoin
- Protocol: Core contract handling cross-chain messaging and token minting/burning
- Axelar Integration: Uses Axelar's GMP for secure cross-chain communication
- Clone the repository:
git clone https://github.com/scalar-network/scalar-contracts.git
cd scalar-contracts- Install dependencies:
bun installCreate a .env file in the root directory with the following variables:
ALCHEMY_API_KEY=
API_KEY_ETHERSCAN=
PRIVATE_KEY=Run all tests:
make test-allRun specific test:
make test <test-file>- Default deployment:
make deploy| TOKEN_NAME | TOKEN_SYMBOL | REDEPLOY_AXELAR |
|---|---|---|
| Scalar BTC | sBTC | true |
- Custom deployment:
make deploy TOKEN_NAME="Pool BTC" TOKEN_SYMBOL="pBTC" REDEPLOY_AXELAR=falseThe deployment script will automatically detect if you're using a local network (Anvil) on http://localhost:8545 or a testnet (Sepolia) and deploy accordingly.
Start a local Anvil node:
make anvilMore details Makefile.
- ERC20 token with minting and burning capabilities
- Controlled by owner and protocol contract
- Used to represent bridged Bitcoin
- Handles cross-chain message passing via Axelar
- Manages token minting and burning
- Processes Bitcoin PSBT (Partially Signed Bitcoin Transactions)
This project is licensed under the MIT License - see the LICENSE.md file for details.