GEB Docs
  • Introduction to GEB
  • Community Resources
  • FLX Mechanics
  • FAQ
  • RAI
    • RAI Use-Cases
    • Multi-chain RAI
    • RAI Integrations
  • The Money God League
    • Intro to The League
  • Ungovernance
    • Governance Minimization Guide
  • Risk
    • GEB Risks
    • PID Failure Modes & Responses
  • Incentives
    • RAI Uniswap V2 Mint + LP Incentives Program
    • RAI Uniswap V3 Mint + LP Incentives Program (Inactive)
    • FLX Staking
    • RAI / ETH Uniswap V3 Oracle LP Incentives Program
  • Contract Variables Translation
    • Core Contracts Naming Transition
    • Governance Contracts Naming Transition
    • SAFE Management Contract Naming Transition
  • System Contracts
    • Core Module
      • SAFE Engine
      • Liquidation Engine
      • Accounting Engine
    • Auction Module
      • English Collateral Auction House
      • Fixed Discount Collateral Auction House
      • Increasing Discount Collateral Auction House
      • Debt Auction House
      • Surplus Auction House
    • Oracle Module
      • Oracle Relayer
      • Medianizer
        • DSValue
        • Governance Led Median
        • Chainlink Median
        • Uniswap V2 Median
      • FSM
        • Oracle Security Module
        • Dampened Security Module
        • FSM Governance Interface
    • Token Module
      • Token Adapters
      • System Coin
      • Protocol Token
      • Protocol Token Authority
      • Protocol Token Printing Permissions
    • Money Market Module
      • Tax Collector
    • Sustainability Module
      • Stability Fee Treasury
      • FSM Wrapper
      • Increasing Treasury Reimbursement
      • Mandatory Fixed Treasury Reimbursement
      • Increasing Reward Relayer
    • Automation Module
      • Collateral Auction Throttler
      • Single Spot Debt Ceiling Setter
      • ESM Threshold Setter
    • Governance Module
      • DSPause
    • Shutdown Module
      • Global Settlement
      • ESM
  • Proxy Infrastructure
    • DSProxy
    • Proxy Registry
  • Helper Contracts
    • SAFE Manager
  • GEB.js
    • Getting Started
    • Global Settlement Guide
    • API Reference
      • Geb
      • Safe
      • Proxy Actions
      • Geb Admin
  • APIs
    • API Endpoints
  • Pyflex
    • Getting Started
      • Configuration
      • GEB Basics
    • SAFE Management
      • Opening a SAFE
      • Closing a SAFE
    • Numerics
  • Keepers
    • Keeper Overview
    • Collateral Auction Keeper
      • Running in Docker
      • Running on a Host
      • Liquidations & Collateral Auctions
      • Collateral Auction Flash Swaps
    • Debt Auction Keeper
      • Running in Docker
      • Running on a Host
    • Staked Token Auction Keeper
      • Running in Docker
      • Running on a Host
    • Surplus Auction Keeper
      • Running in Docker
      • Running on a Host
    • Bidding Models
  • Liquidation Protection
    • SAFE Protection
    • Liquidation Protection Guide
    • Uni-V2 RAI/ETH Savior Details
    • Curve V1 Savior Details
Powered by GitBook
On this page
  • Constructors
  • Properties
  • contracts
  • contractsAdmin
  • Methods
  • deployProxy
  • getErc20Contract
  • getGebContract
  • getIncentiveCampaignContract
  • getProxyAction
  • getSafe
  • getSafeFromOwner
  • gnosisSafeThreshold1SubmitTransaction
  • multiCall
  • verifyWebScheduleCallcode
  • webExecuteProposal
  • webScheduleProposal
  • webTestScheduleProposal
  • Static getGebContract

Was this helpful?

  1. GEB.js
  2. API Reference

Geb Admin

PreviousProxy ActionsNextAPI Endpoints

Last updated 4 years ago

Was this helpful?

This class extends the core GEB class with additional tools and contracts that are not used as often as other SAFE management tools. Here you will find utils for contracts such as DSPause, ESM etc. These contracts are scattered across several repositories. Please refer to the smart contract documentation to learn more about them.

IMPORTANT: To avoid bloating the main package this class is only available in a . Please install it like this:

npm install @reflexer-finance/geb-admin

And after that you are ready to use the admin tools similar to the GEB class:

import { ethers } from 'ethers'
import { GebAdmin } from "@reflexer-finance/geb-admin"

 const provider = new ethers.providers.JsonRpcProvider('http://kovan.infura.io/<API KEY>')
 const gebAdmin = new GebAdmin('kovan', provider)

Constructors

+ new GebAdmin(network: GebDeployment, provider: GebProviderInterface | Provider):

Defined in

Parameters:

Name

Type

Description

network

GebDeployment

Either 'kovan', 'mainnet' or an actual list of contract addresses.

provider

GebProviderInterface | Provider

Either a Ethers.js provider or a GEB provider. Support for Web3.js will soon be added.

Returns:

Properties

contracts

• contracts: ContractApis

Defined in packages/geb/lib/geb.d.ts:70

Object containing all GEB core smart-contracts instances for direct level interactions. All of the following contracts object are one-to-one typed API to the underlying smart-contract. Read-only functions that do not change the blockchain state return a promise of the return data. State modifying function will return synchronously a pre-filled transaction request object:

{
  to: "0x123abc.."
  data: "0xabab234ab..."
}

Example:

 // Setup geb.js an ethers
 const provider = new ethers.providers.JsonRpcProvider('http://kovan.infura.io/<API KEY>')
 const wallet = new ethers.Wallet('<Private key>', provider)
 const geb = new Geb('kovan', provider)

 // Contract read function: Fetch the debt ceiling
 const debtCeiling = await geb.contracts.safeEngine.globalDebtCeiling()

 // State changing function: Manualy liquidate a SAFE
 const tx = geb.contracts.liquidationEngine.liquidateSAFE(ETH_A, '0x1234abc...')
 await wallet.sendTransaction(tx) // Send the Ethereum transaction

Currently the following contracts ae available in this property:

  • SAFEEngine

  • AccountingEngine

  • TaxCollector

  • LiquidationEngine

  • OracleRelayer

  • GlobalSettlement

  • DebtAuctionHouse

  • PreSettlementSurplusAuctionHouse

  • PostSettlementSurplusAuctionHouse

  • SettlementSurplusAuctioneer

  • GebSafeManager

  • GetSafes

  • BasicCollateralJoin

  • CoinJoin

  • Coin (System coin ERC20 contract)

  • GebProxyRegistry

  • FixedDiscountCollateralAuctionHouse

  • Weth (ERC20)

contractsAdmin

• contractsAdmin: AdminApis

Object containing all GEB admin contracts instances for low level interactions. It currently has the following contracts:

  • MultiSigWallet

  • DsProxy

  • DsToken

  • ProtocolTokenAuthority

  • GebPollingEmitter

  • GebPrintingPermissions

  • DsDelegateRoles

  • DsPause

  • DsPauseProxy

  • GovActions

  • ESM

  • TokenBurner

  • FsmGovernanceInterface

  • DsProxyFactory

  • GebDeployPauseProxyActions

  • DsProxy

  • TxManager

Methods

deployProxy

▸ deployProxy(): object

Defined in packages/geb/lib/geb.d.ts:88

Deploy a new proxy owned by the sender.

Returns: object

  • chainId? : number

  • data? : string

  • from? : string

  • gasLimit? : BigNumber

  • gasPrice? : BigNumber

  • nonce? : number

  • to? : string

  • value? : BigNumber

getErc20Contract

▸ getErc20Contract(tokenAddress: string): Erc20

Defined in packages/geb/lib/geb.d.ts:123

Returns an object that can be used to interact with a ERC20 token. Example:

const USDCAddress = "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
const USDC = geb.getErc20Contract(USDCAddress)

// Get 0xdefiisawesome's balance
const balance = USDC.balanceOf("0xdefiisawesome..")

// Send 1 USDC to 0xdefiisawesome (USDC is 6 decimals)
const tx = USDC.transfer("0xdefiisawesome..", "1000000")
await wallet.sendTransaction(tx)

Parameters:

Name

Type

Description

tokenAddress

string

Token contract address

Returns: Erc20

Erc20

getGebContract

▸ getGebContract‹T›(gebContractClass: GebContractAPIConstructorInterface‹T›, address: string): T

Defined in packages/geb/lib/geb.d.ts:165

Returns an instance of a specific geb contract given a Geb contract API class at a specified address

import { contracts } from "geb.js"
const safeEngine = geb.getGebContract(contracts.SafeEngine, "0xabcd123..")
const globalDebt = safeEngine.globalDebt()

Type parameters:

▪ T: BaseContractAPI

Parameters:

Name

Type

Description

gebContractClass

GebContractAPIConstructorInterface‹T›

Class from contracts or adminContracts

address

string

Contract address of the instance

Returns: T

getIncentiveCampaignContract

▸ getIncentiveCampaignContract(campaignNumber: number): Promise‹StakingRewards›

Defined in packages/geb/lib/geb.d.ts:131

Help function to get the contract object of an incentive campaign given its number ID

Parameters:

Name

Type

Description

campaignNumber

number

incremental ID of the campaign

Returns: Promise‹StakingRewards›

StakingRewards

getProxyAction

▸ getProxyAction(ownerAddress: string): Promise‹GebProxyActions›

Defined in packages/geb/lib/geb.d.ts:84

Parameters:

Name

Type

Description

ownerAddress

string

Externally owned user account, Ethereum address that owns a GEB proxy.

Returns: Promise‹GebProxyActions›

getSafe

▸ getSafe(idOrHandler: string | number, collateralType?: string): Promise‹Safe›

Defined in packages/geb/lib/geb.d.ts:93

Get the SAFE object given a safeManager id or a safeEngine handler address.

Parameters:

Name

Type

Description

idOrHandler

string | number

Safe Id or SAFE handler

collateralType?

string

-

Returns: Promise‹Safe›

getSafeFromOwner

▸ getSafeFromOwner(address: string): Promise‹Safe[]›

Defined in packages/geb/lib/geb.d.ts:104

Fetch the list of safes owned by an address. This function will fetch safes owned directly through the safeManager and safes owned through the safe manager through a proxy. Safes owned directly by the address at the safeEngine level won't appear here.

Note that this function will make a lot of network calls and is therefore very slow. For front-ends we recommend using pre-indexed data such as the geb-subgraph.

Parameters:

Name

Type

Description

address

string

Returns: Promise‹Safe[]›

gnosisSafeThreshold1SubmitTransaction

▸ gnosisSafeThreshold1SubmitTransaction(sender: string, to: string, data: string): TransactionRequest

Submit a transaction to a gnosis safe directly executed. Works only if the threshold on the safe is 1.

Parameters:

Name

Type

Description

sender

string

Proposal submitter

to

string

Proposal target (Usually ds-pause)

data

string

transaction data of the proposal

Returns: TransactionRequest

multiCall

▸ multiCall‹O1, O2, O3›(calls: [MulticallRequest‹O1›, MulticallRequest‹O2›, MulticallRequest‹O3›]): Promise‹[O1, O2, O3]›

Defined in packages/geb/lib/geb.d.ts:136

Type parameters:

▪ O1

▪ O2

▪ O3

Parameters:

Name

Type

calls

[MulticallRequest‹O1›, MulticallRequest‹O2›, MulticallRequest‹O3›]

Returns: Promise‹[O1, O2, O3]›

verifyWebScheduleCallcode

▸ verifyWebScheduleCallcode(govFunctionAbi: string, params: any[], earliestExecutionTime: number, calldata: string, description?: string): Promise‹boolean›

Verifies a transaction for scheduling proposals

Parameters:

Name

Type

Description

govFunctionAbi

string

Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)"

params

any[]

Array containing all for the above function

earliestExecutionTime

number

-

calldata

string

to verify

description?

string

-

Returns: Promise‹boolean›

Promise

webExecuteProposal

▸ webExecuteProposal(govFunctionAbi: string, params: any[], earliestExecutionTime: number): Promise‹TransactionRequest›

Encodes executing a proposal in dspause for web GUI

Parameters:

Name

Type

Description

govFunctionAbi

string

Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)"

params

any[]

Array containing all for the above function

earliestExecutionTime

number

-

Returns: Promise‹TransactionRequest›

Promise

webScheduleProposal

▸ webScheduleProposal(govFunctionAbi: string, params: any[], earliestExecutionTime: number, description?: string): Promise‹object›

Encodes scheduling a proposal in dspause for web GUI

Parameters:

Name

Type

Description

govFunctionAbi

string

Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)"

params

any[]

Array containing all for the above function

earliestExecutionTime

number

-

description?

string

-

Returns: Promise‹object›

Promise

webTestScheduleProposal

▸ webTestScheduleProposal(govFunctionAbi: string, params: any[], earliestExecutionTime: number, description?: string): Promise‹void›

Test the execution of a proposal about to be schedule in dspause with web GUI

Parameters:

Name

Type

Description

govFunctionAbi

string

Human readable abi from gov actions or proxy of choice -> "setDelay(address,uint256)"

params

any[]

Array containing all for the above function

earliestExecutionTime

number

-

description?

string

-

Returns: Promise‹void›

Promise

Static getGebContract

▸ getGebContract‹T›(gebContractClass: GebContractAPIConstructorInterface‹T›, address: string, provider: GebProviderInterface | Provider): T

Defined in packages/geb/lib/geb.d.ts:152

Returns an instance of a specific geb contract given Geb contract API class constructor at a specified address

Type parameters:

▪ T: BaseContractAPI

Parameters:

Name

Type

Description

gebContractClass

GebContractAPIConstructorInterface‹T›

Class from contracts or adminContracts

address

string

Contract address of the instance

provider

GebProviderInterface | Provider

Either a Ethers.js provider or a Geb provider

Returns: T

Inherited from .

This object follow the (Also similar to the ). The object can be completed with properties such as from, gasPrice, gas (gas limit, web3.js ony) or gasLimit (gas limit, ethers.js only). The object can then be passed to the sendTransaction of or

For detailed information about the functions of each contract we recommend referring directly to the smart-contract and

Defined in

Inherited from .

Inherited from .

Inherited from .

Inherited from .

Inherited from .

Given an address returns a GebProxyActions object to execute bundled operations. Important: This requires the address to have deployed a GEB proxy through the proxy registry contract. It will throw a DOES_NOT_OWN_HAVE_PROXY error if the address specified does not have a proxy. Use the function to get a new proxy.

Inherited from .

Inherited from .

Defined in

Inherited from .

Defined in

Defined in

Defined in

Defined in

Inherited from .

geb.js
separate package
GebAdmin
packages/geb-admin/src/geb-admin.ts:52
GebAdmin
TransactionRequest model of ethers.js
model used by web.js
ehters.js
web3.js
code
documentation
packages/geb-admin/src/geb-admin.ts:52
packages/geb-admin/src/geb-admin.ts:203
packages/geb-admin/src/geb-admin.ts:75
packages/geb-admin/src/geb-admin.ts:99
packages/geb-admin/src/geb-admin.ts:124
packages/geb-admin/src/geb-admin.ts:173
GebAdmin
contracts
GebAdmin
deployProxy
GebAdmin
getErc20Contract
GebAdmin
getGebContract
GebAdmin
getIncentiveCampaignContract
GebAdmin
getProxyAction
deployProxy
GebAdmin
getSafe
GebAdmin
getSafeFromOwner
GebAdmin
multiCall
GebAdmin
getGebContract