Skip to content

ReMeLife/remelife-smart-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

remelife-smart-contracts

REME, LUKI, CAP → REME conversion & swap bridge contracts (Solana + EVM)


1. Overview

This repo contains the on-chain logic for the ReMeLife token ecosystem:

  • $REME – Primary utility/governance token (fixed supply).
  • $LUKI – Solana SPL utility token powering the LUKi AI engagement layer.
  • CAP → REME Converter – Off-chain oracle + on-chain mint logic for Care Action Points.
  • Swap Bridge – Trust-minimised bridge to swap $LUKI ↔ $REME (SPL ⇄ ERC20).
  • Treasury / Vesting / Airdrop contracts.
  • Access control & upgradability scaffolding.

This code is public for transparency & external audits.


2. Tech Stack

  • Solana: Anchor framework (SPL tokens, PDA state).
  • EVM: Foundry (forge) or Hardhat (solc 0.8.x), OpenZeppelin libs.
  • Bridge Relayer: Off-chain Rust/TS relayer posting signed proofs.
  • Testing:
    • Solana: Anchor tests (Mocha/TS).
    • EVM: Foundry (forge test), or Hardhat + Waffle/Chai.
  • Static Analysis: Slither, MythX/ConsenSys Diligence (optional).
  • CI: GitHub Actions (lint, build, test).

3. Repository Structure

remelife-smart-contracts/
├── README.md
├── LICENSE
├── solana/                       # SPL side
│   ├── programs/
│   │   ├── luki_token/           # $LUKI mint/authority logic
│   │   ├── cap_converter/        # CAP -> REME proof verifier (if on Solana)
│   │   └── bridge_listener/      # Bridge verification program
│   ├── Anchor.toml
│   ├── Cargo.toml
│   ├── tests/
│   └── scripts/
├── evm/                          # ERC20 side
│   ├── src/
│   │   ├── REME.sol              # ERC20 REME token
│   │   ├── Bridge.sol            # Bridge vault & proof verify
│   │   ├── Vesting.sol           # Linear vesting/lockup
│   │   └── Treasury.sol          # DAO treasury hooks
│   ├── script/                   # deployment scripts (Foundry)
│   ├── test/                     # forge tests
│   ├── foundry.toml
│   └── lib/                      # OpenZeppelin, etc.
├── bridge/
│   ├── relayer/                  # Off-chain signer/relayer service
│   ├── schemas/                  # attestations / proof formats
│   └── README.md
├── audits/
│   ├── checklist.md
│   └── <future_reports>.pdf
└── .github/
    └── workflows/
        ├── solana_ci.yml
        └── evm_ci.yml

4. Quick Start (Solana / Anchor)

# prerequisites: rust + anchor + solana toolchain
cd solana
anchor build
anchor test

Deploy (devnet example):

solana config set --url https://api.devnet.solana.com
anchor deploy
# save program IDs in Anchor.toml & env files

Mint $LUKI locally:

anchor run mint_luki --amount 1_000_000_000

5. Quick Start (EVM / Foundry)

cd evm
forge install
forge build
forge test

Deploy to testnet (Sepolia):

export RPC_URL=https://sepolia.infura.io/v3/<id>
export PRIVATE_KEY=0xabc... # dev key
forge script script/DeployREME.s.sol --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

6. Bridge Flow (High-Level)

  1. Lock & Mint model:

    • User sends $LUKI to Solana bridge program → emits event.
    • Relayer signs proof → submits to EVM Bridge.sol → mints wrapped $LUKI (or swaps to $REME).
  2. Reverse direction:

    • Burn on EVM side → submit proof to Solana program → unlock native $LUKI.
  3. Security:

    • Multi-sig on relayer keys.
    • Rate limits & pause switches.
    • Future: light-client / zk-proof based validation (phase 2/3).

See bridge/relayer/README.md for implementation details.


7. CAP → REME Conversion

  • CAP is off-chain point tracked by backend.
  • Daily conversion batch signed by oracle key; on-chain contract mints REME accordingly.
  • Signature scheme: EIP-712 (EVM) / ed25519 (Solana).
  • Anti-sybil: daily caps per wallet, backend KYC/eligibility signals.

8. Testing & Security

  • Unit tests: 100% branch coverage for core token & bridge logic.
  • Property tests: fuzz with Foundry (forge fuzz).
  • Static Analysis:
    • Solana: cargo audit, Anchor lints.
    • EVM: slither ., Mythril.
  • External Audit: mandatory before mainnet.
  • Bug bounty: TBD, announce post-launch.

9. Deployment Checklist

  • Finalize token metadata (name, symbol, decimals)
  • Set multisig owners & threshold
  • Activate pause/guardians
  • Publish program/contract addresses in DEPLOYMENTS.md
  • Freeze mint authority if required (post initial distribution)
  • Verify contracts on Etherscan / Solscan metadata

10. Environment Variables & Config

  • Solana: Anchor.toml + .env for keypairs.
  • EVM: .env with RPC_URL, PRIVATE_KEY, ETHERSCAN_API_KEY.
  • Bridge relayer: .env for both chains’ RPC + signer keys.

11. Roadmap

  • ZK-bridge or Wormhole integration for trust minimisation
  • On-chain CAP attestation (if cost-effective)
  • DAO-controlled parameter changes (fees, limits)
  • Cross-chain governance module

12. Contributing

This repo is open for review & community audits, but PR write access is limited to core devs.

  • Fork & PR with clear description.
  • Include tests and gas report diffs.
  • Follow coding standards (Solidity style guide, Anchor best practices).

13. License

MIT License – to maximise auditability & reuse of generic components.
Add via GitHub’s “Choose a license template” or paste MIT text into LICENSE.


Transparent contracts. Secure bridges. Real utility.

About

REME/LUKI token contracts, CAP→REME converter, and SPL↔ERC20 bridge logic.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published