Libre Chain Docs
WebsiteAppWalletCreate Account
  • The Libre Platform
    • Libre is a Decentralized Lending Marketplace
    • Borrow
    • Lend
    • Run A Libre Node
    • Validators
    • The Smart Contract Platform
      • Building Smart Contracts on Libre
      • Libre Developer Tools
      • Libre Testnet
      • API Docs
  • DeFi on Libre DEX
    • DeFi
    • libreDEX
    • Ordinals
    • Building on Libre
      • How to add a trading pair
  • BitcoinFi on Libre
    • Glossary
  • The LIBRE Reward Coin
    • A reward system for validators and stakers
    • Supply
    • Mint Rush
    • Spindrop
      • How to Claim the LIBRE Spindrop
      • Eligibility Requirements for the LIBRE Spindrop
  • ACCOUNTS AND WALLETS
    • LIBRE Account Names
      • Cryptographic Keys
    • Creating Multiple Accounts
    • Bitcoin Libre Wallet
    • Anchor Wallet
      • Creating a Libre MainNet Account in Anchor
      • Creating a Libre Testnet Account in Anchor
      • Getting Testnet LIBRE Coins
    • Ledger Hardware Wallet
  • EARN
    • Staking
    • Mining
    • Referrals
    • Become a Validator
    • DAO Tax
    • Libre Lightning Provider
  • Governance
    • Voting Power
    • Validator Election
    • Libre DAO
    • Libre Governance Docs
      • Libre Blockchain Operating Agreement (LBOA)
      • Block Producer Agreement
      • Block Producer Minimum Requirements
    • Libre Mainnet Multisig Gov
      • Oct 2024
      • July 2023
      • June 2023
      • April 2023
      • March 2023
      • February 2023
      • December 2022
  • Technical Details
    • Libre Core Constants
    • Mint Rush Details
    • Staking Details
    • Verifying Code Updates
      • Deployed Smart Contract Versions
  • Cross-Chain Interoperability
    • Cross-Chain Overview
    • Bridge Comparison
    • Libre CrossLink Bridge
      • Technical Whitepaper
      • Bitcoin to Libre (Peg-In Process)
      • Libre to Bitcoin (Peg Out)
    • Bitcoin Lightning Network
    • USDT / Ethereum
    • Legacy pNetwork
    • Bitcoin Audit
Powered by GitBook
On this page
  • Code Verification Instructions
  • About Code Verification
  • Multisig Execution Instructions
  • How to Approve

Was this helpful?

Edit on GitLab
  1. Technical Details

Verifying Code Updates

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

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"
        }
      ]
    }
  ]
}'

\

PreviousStaking DetailsNextDeployed Smart Contract Versions

Last updated 1 year ago

Was this helpful?