πŸŒ³πŸ“ Smart contracts for the Arbor Protocol

Overview

Arbor Smart Contracts

app testnet landing docs discord blog twitter

Security

Please report any security issues to [email protected]

V1

Smart Contracts powering the Arbor protocol.

Contracts

mainnet rinkeby
BondFactory 0x9f20521ef789fd2020e708390b1e6c701d8218ba 0x0ae42cF40Fb46A926e2dcCE92b2Fe785d2D1E0A0
Bond Implementation 0x79537dcba69fea2b8dc8292b3726195fe947e332 0xebc0d87f2fb27c967a3cb0e36f279579b0116261

What does it do? How does it work?

The Arbor protocol allows a borrower to create a Bond. Each minted bond share has some amount of collateral backing and will be redeemable 1 share for 1 stablecoin at maturity. To incentivize lenders, the bond shares will be sold at a discount either OTC or through an auction.

For more information on this process, the documentation site gives an overview of what the protocol does and some of the concepts like zero coupon bonds and the difference between "Simple" and "Convert" Bond types. For how the protocol works, check out the spec:

  • overview β€” An overview of the Bond and BondFactory as well as what actions Borrowers and Lenders can perform.
    • bond β€” More detailed look at the Bond actions and design decisions.
  • architecture β€” A technical document explaining how the Contracts interact and the lifecycle from deployment, creating a bond, and actions performed on that bond.
  • permissions β€” The trust model and implementation of that model.
  • state machine β€” The Bond represented as distinct states.

Development

For local development there are environment variables necessary to enable some hardhat plugins. To interact with the frontend, you will also need to update your wallet with a new network pointing to hardhat's network.

Network Name: Hardhat
RPC URL: http://localhost:8545
Chain ID: 31337
Currency: ETH

Then, run the local node with npx hardhat node. If forking a blockchain, avoid deploying dependencies with the --no-deploy flag: npx hardhat node --no-deploy.

Deployment

Using hardhat-deploy all of the scripts in the ./deploy folder are run. This will run the whole integration flow as well which includes deploying of the factory, tokens, creating bonds, doing bond actions, and starting auctions. If that is not desired, add a tags flag with what you want to deploy.

npx hardhat deploy --tags main-deployment # deploy bond factory
npx hardhat deploy --tags test-deployment # and deploy tokens
npx hardhat deploy --tags permissions # and grant roles & permissions
npx hardhat deploy --tags e2e # and run e2e test
npx hardhat deploy --tags bonds # and deploy test bonds
npx hardhat deploy --tags auctions # and start bond auctions
npx hardhat deploy --tags actions # and do bond actions

Additionally, all of the above commands can be run with --network rinkeby to deploy to the Rinkeby test network.

Note: The deploy script will run with the npx hardhat node as well as the npx hardhat test tasks.

Verification

The deployment script will automatically verify the BondFactory, Implementation contract, and TestERC20 token. To verify a contract not deployed within that script, use the hardhat-etherscan task.

npx hardhat verify <address>

Testing

Running the hardhat test suite

npx hardhat test

Fork testing requires first running the mainnet-fork

npx hardhat node

and making the target for testing the local node

npx hardhat test --network localhost

Running the fuzzing test suite with Echidna

Other useful commands

npx hardhat help
npx hardhat compile # create contract artifacts
npx hardhat clean # removes artifacts and maybe other things
npx hardhat coverage # runs the contract coverage report
npx hardhat integration # runs the integration task
npx hardhat settle-auction --auctionId <auctionId> # settles an auction
npx eslint '**/*.{js,ts}' --fix
npx prettier '**/*.{json,sol,md,ts}' --write
npx solhint 'contracts/**/*.sol' --fix
You might also like...

Run CosmWasm smart contracts in Node.js and web browsers

Run CosmWasm smart contracts in Node.js and web browsers

Nov 25, 2022

A 'to do list' powered by Ethereum smart contracts

A 'to do list' powered by Ethereum smart contracts. built with JavaScript, Ganache, Truffle, Node.js, Metamask, jQuery, and Bootstrap

Feb 17, 2022

Context-aware smart contracts for blockchain IoT systems

Context-aware smart contracts for blockchain IoT systems It contains 2 directories: contracts: contains the ContextAwareSmartContract.sol contract wit

Jun 17, 2022

This is the main repository for NFT collection dao smart contracts.

Basic Sample Hardhat Project This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, a sample s

Apr 11, 2022

Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collections

eznft Yet another library for generating NFT artwork, uploading NFT assets and metadata to IPFS, deploying NFT smart contracts, and minting NFT collec

Sep 21, 2022

a quick start boilerplate for developing web3 apps and deploying smart contracts.

create-web3 A boilerplate for starting a web3 project. This boilerplate quickly creates a mono repo with 2 environments, a Next JS environment for fro

Dec 16, 2022

πŸš€ NFTank (NFT tank for dummies) will allow developers to quickly request NFTs to personal wallets or smart contracts in just a few clicks.

πŸš€ NFTank (NFT tank for dummies) will allow developers to quickly request NFTs to personal wallets or smart contracts in just a few clicks.

πŸ‘·β€β™‚οΈ NFTank πŸš€ NFTank (NFT tank for dummies) will allow developers to quickly request NFTs to personal wallets or smart contracts in just a few click

Nov 8, 2022

Toolkit for development, test and deploy smart-contracts on Waves Enterprise ecosystem.

JS Contract SDK Toolkit for development, test and deploy smart-contracts on Waves Enterprise ecosystem. Quickstart The fastest way to get started with

Dec 15, 2022

A simple project to learn more about developing smart contracts on polygon.

polygon-books-hardhat A simple project to learn more about developing smart contracts using Solidity. Local Development Environment Setup Install all

Jan 25, 2022
Comments
  • Switch to GΓΆrli

    Switch to GΓΆrli

    Since Rinkeby is being deprecated, I have deployed the contracts to the GΓΆrli testnet and updated all relevant documentation. There is no longer any mention of Rinkeby in the codebase.

    opened by Namaskar-1F64F 0
Owner
Always Be Growing
What does always be growing mean? To grow you need to learn and to always be growing you need to always be learning. Never stop thinking.
Always Be Growing
Grupprojekt fΓΆr kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet fΓΆr kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide FΓΆr information om hur utv

Svante Jonsson IT-HΓΆgskolan 3 May 18, 2022
Hemsida fΓΆr personer i Sverige som kan och vill erbjuda boende till mΓ€nniskor pΓ₯ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo fΓΆr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Perpetual Protocol Curie (v2) core contracts

Perpetual Protocol Curie (v2) core contracts

Perpetual Protocol 38 Dec 15, 2022
A decentralized protocol for indexing and querying data from DecentraMix's on chain contracts across all supported blockchains.

A decentralized protocol for indexing and querying data from DeMix contracts across all supported blockchains.

DecentraWorld Ecosystem 92 May 3, 2022
A simple implementation example (framework) of Deso Protocol's Smart Services.

This project serves as a simple implementation example (framework) of Deso Protocol's Smart Services. This framework comes with out-of-the-box SSL, MongoDB, dev/stage/prod environments, and modularity.

Hunter Paulson 5 Sep 22, 2022
A collection of smart contracts for the Stackup platform πŸ€– πŸ“‘

Contracts A collection of smart contracts for the Stackup platform. Dev Blog Deployed Contracts See releases for deployed contracts of previous versio

Stackup 16 Nov 29, 2021
Ethereum Smart Contracts for locking your Ether and ERC20 tokens based on time and price conditions

SmartHold - a simple way to lock and hold your ETH or ERC20 in a smart contract This is a BETA software that has not been audited for security. USE AT

PaweΕ‚ Urbanek 22 May 5, 2022
♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS.

Crowdcoin ♦ Crowd funding project using Smart Contracts on the Ethereum. Created with Next.js and Tailwind CSS. Project from "Ethereum and Solidity: T

Luiz Fernando VerΓ­ssimo 2 Dec 14, 2022
Cooperative databases using smart contracts.

Vitra β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆ

Paul Frazee 177 Dec 30, 2022