Libre Chain Docs
WebsiteAppWalletCreate Account
  • Libre: A Bitcoin-Native Lending Marketplace
  • Core Features
    • Borrowing
    • Lending
    • Custody & Security
  • Understanding the Platform
    • Mechanics
      • Liquidation Process
      • Tokenomics & TP Value
  • For Developers
    • Developers
  • Advanced Features
    • Cross-Chain Bridges
      • CrossLink MPC Bridge
      • Bridge Comparison
      • Bitcoin Lightning Network
      • USDT / Ethereum
      • Legacy pNetwork
    • Governance
      • Voting Power
      • Validator Election
      • Libre DAO
    • Technical Details
      • Core Constants
      • Smart Contract Versions
      • Verifying Code Updates
  • Legacy Documentation
    • Legacy Docs
  • Old Platform Docs
    • Borrow
    • Lend
    • Run A Libre Node
    • Validators
    • Building on Libre
      • Building Smart Contracts
      • Developer Tools
      • Testnet
      • API Docs
  • Old DeFi Docs
    • DeFi Overview
    • libreDEX
  • Old Token Docs
    • LIBRE Rewards
    • Supply
    • Mint Rush
    • Spindrop
      • How to Claim
      • Eligibility
  • Old Accounts & Wallets
    • LIBRE Account Names
      • Cryptographic Keys
    • Creating Multiple Accounts
    • Bitcoin Libre Wallet
    • Anchor Wallet
      • Mainnet Account
      • Testnet Account
      • Getting Testnet Tokens
    • Ledger Hardware Wallet
  • Old Earn Docs
    • Staking
    • Mining
    • Referrals
    • Become a Validator
    • DAO Tax
    • Lightning Provider
Powered by GitBook
On this page
Edit on GitLab
  1. Advanced Features
  2. Technical Details

Verifying Code Updates

How to verify code updates of smart contracts deployed on Libre.

PreviousSmart Contract VersionsNextLegacy Docs

Last updated 1 month ago

Was this helpful?

CtrlK
  • Code Verification Instructions
  • About Code Verification
  • Multisig Execution Instructions
  • How to Approve

Was this helpful?

Code Verification Instructions

About Code Verification

The purpose here is to be able to read and even deploy locally both the current version and the proposed changes for testing.

Ideally, you should know how to use git, how to run a diff on code changes, and how to calculate a sha256sum. That being said, we have written it all out for you anyway.\

Generally, there are 3 steps here:

  1. Verify currently deployed code locally

  2. Verify proposed code locally

  3. Compare proposed changes to deployed code (can be done in Gitlab UI or VS Code)\

Steps are listed below and we are working on a video walkthrough for the future so basically anyone with a terminal and a keyboard will be able to do this verification.

Steps to verify:

  1. Clone repo

  2. Get sha256sum hash of currently deployed contract libre.sh get code stake.libre - compare to table above “currently deployed”

  3. Git checkout commit of currently deployed contract (provided in proposal)

  4. Build WASM (docker if avail) ./docker-build.sh(or older repos) ./build.sh

  5. Verify sha256sum of built wasm matches deployed contract (from step 2) sha256sum $PATH_TO_WASM (provided in proposal)

  6. Git checkout commit of proposed update (provided in proposal)

  7. Build WASM of the proposed update ./docker-build.sh (or older repos) ./build.sh

  8. Check sha256sum of wasm you built sha256sum $PATH_TO_WASM (provided in proposal)

  9. If it matches the sha256sum in the multisig on-chain, then you are looking at the correct version of code! (only the sha256sum of the wasm matters here - abi will not match, but you can download it from the multisig proposal and review if you like)

  10. Inspect code changes between proposed update and deployed version using the Code Comparison link (provided in proposal) or by running a diff between commits (source: proposed, target: deployed)

Multisig Execution Instructions

How to Approve

  1. Use Anchor and login to local.blocks.io and click “Approve” (recommended)

  2. Use these CLI multisig commands below (2 versions that require cleos to be installed)

CLI Example 1 - use libre.sh

Create libre.sh for CLI transactions on Linux

#!/bin/bash
CLEOS=/usr/opt/eosio/2.1.0-rc2/bin/cleos #this path will vary
API=https://api.libre.eossweden.org/ #server can change
$CLEOS -u $API "$@"

Replace "sweden" with your account name in the "actor" key below:

CLI example 2 - simple cleos

Replace sweden with your producer name in all 4 actor keys:

cleos -u http://lb.libre.org push transaction '{
  "delay_sec": 0,
  "max_cpu_usage_ms": 0,
  "actions": [
    {
      "account": "eosio.msig",
      "name": "approve",
      "data": {
        "proposer": "quantum",
        "proposal_name": "feb23stake",
        "level": {
          "actor": "sweden",
          "permission": "active"
        }
      },
      "authorization": [
        {
          "actor": "sweden",
          "permission": "active"
        }
      ]
    }
  ]
}'

\