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 install
Create a .env
file in the root directory with the following variables:
PRIVATE_KEY=
ANVIL_RPC_URL=
SEPOLIA_RPC_URL=
API_KEY_ETHERSCAN=
Run all tests:
make test-all
Run 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=false
The 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 anvil
More 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.