Union Protocol (v2)
  • Introduction
  • Important Links
  • 🌐Protocol Overview
    • How Union Works
    • Plain English (Detailed)
    • Use Cases
    • v1->v2 changelog
    • FAQ
  • ⚖️Governance
    • UNION DAO
      • Community Delegates
      • Gaurdians & Multisigs
    • UNION Token
    • Governance Process
      • Technical Implementations
    • Glossary of Terms
  • 🔨Developers
    • Union Contracts Overview
    • Contract ABIs & Addresses
    • Core Components
      • UserManager
        • UserManagerERC20
        • UserManagerDAI
      • uToken
        • UDai
        • UErc20
      • AssetManager
      • Comptroller
      • MarketRegistry
      • InterestRateModel
      • PureTokenAdapter
      • AaveV3Adapter
    • Governance
      • UnionToken
        • ArbUnionWrapper
        • ArbUnion
        • OpUnion
      • Governor
      • Timelock
    • Union SDK
    • Union Data
      • Documentation
    • Peripheral & Fun Contracts
    • GraphQL Endpoints
  • 🚴User Guides
    • Becoming a Member
    • How Bridging Tokens Works
      • Bridge UNION token from Arbitrum to Ethereum
    • Voting & Delegation
      • Delegation from Gnosis
    • Vouching & Lending
  • 👩‍💻Developer Guides
    • In Progress
  • ⚠️Risk
    • Types of Risk
Powered by GitBook
On this page
  • Core Components
  • Union Contracts V2
  • Deployments
  • Install
  • Compile
  • Foundry
  • Fork Tests
  • Format

Was this helpful?

Edit on GitHub
  1. Developers

Core Components

PreviousContract ABIs & AddressesNextUserManager

Last updated 1 year ago

Was this helpful?

Core Components

Union Contracts V2

Deployments

  • Goerli

Install

To install dependencies:

git clone git@github.com:unioncredit/union-v2-contracts.git && cd union-v2-contracts
yarn install

Compile

To compile with hardhat:

yarn hh:compile

Foundry

Union V1.5 Contracts also includes a suit of tests (fuzzing tests) writte in solidity with foundry

To install Foundry (assuming a Linux or macOS System):

curl -L https://foundry.paradigm.xyz | bash

This will download foundryup. To start Foundry, run:

foundryup

To install dependencies:

forge install

To run tests:

forge test

The following modifiers are also available:

  • Level 2 (-vv): Logs emitted during tests are also displayed.

  • Level 3 (-vvv): Stack traces for failing tests are also displayed.

  • Level 4 (-vvvv): Stack traces for all tests are displayed, and setup traces for failing tests are displayed.

  • Level 5 (-vvvvv): Stack traces and setup traces are always displayed.

forge -vv

To profile gas usage:

forge test --gas-report
forge snapshot

Fork Tests

Integration tests can be run using hardhat.

yarn hh:test

They can also be run in fork mode. (Some tests can be excluded from running in fork mode and other tests can only run in fork mode)

FORK_NODE_URL=<URL> FORK_BLOCK=<NUMBER> yarn hh:test

You can also define which config should be used for the fork mode.

CONFIG=arbitrum FORK_NODE_URL=<URL> FORK_BLOCK=<NUMBER> yarn hh:test

Format

yarn format

Built using and

🔨
foundry
hardhat
contract addersses
deployment config
https://github.com/unioncredit/union-v2-contractsgithub.com