ZivoeDAO.sol

DAO -> Decentralized Autonomous Organization

Introduction

This contract escrows assets for the Zivoe protocol and is governed by TimelockController (effectively $ZVE Governance).

This contract has the following responsibilities:

  • Push assets (ERC20, ERC721, ERC1155) to a locker.

  • Pull assets (ERC20, ERC721, ERC1155) from a locker.

  • Enforce a whitelist of "lockers" (ZivoeLockers).

State Variables

Type
Name
Description

address

GBL

The ZivoeGlobals contract.

Sections

#Write Functions

#Events

Write Functions

push()

Pushes an ERC20 token from ZivoeDAO to locker.

function push(
    address locker, 
    address asset, 
    uint256 amount, 
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to push an ERC20 token to.

address

asset

The ERC20 token to push.

uint256

amount

The amount of "asset" to push.

bytes

data

Accompanying transaction data.

Emits the #Pushed() event

pull()

Pulls ERC20 from locker to ZivoeDAO.

function pull(
    address locker, 
    address asset, 
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address

asset

The asset to pull.

bytes

data

Accompanying transaction data.

Emits the #Pulled() event

pullPartial()

Pulls specific amount of ERC20 from locker to ZivoeDAO.

function pullPartial(
    address locker, 
    address asset, 
    uint256 amount, 
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address

asset

The asset to pull.

uint256

amount

The amount to pull (may not refer to "asset", but rather a different asset within the locker).

bytes

data

Accompanying transaction data.

Emits the #PulledPartial() event

pushMulti()

Pushes ERC20(s) from locker to ZivoeDAO.

function pushMulti(
    address locker, 
    address[] calldata assets, 
    uint256[] calldata amounts, 
    bytes[] calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to push capital to.

address[]

assets

The assets to push to locker.

uint256[]

amounts

The amount of "asset" to push.

bytes[]

data

Accompanying transaction data.

Emits the #Pushed() event (multiple times)

pullMulti()

Pulls ERC20(s) from locker to ZivoeDAO.

function pullMulti(
    address locker, 
    address[] calldata assets, 
    bytes[] calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address[]

assets

The assets to pull.

bytes[]

data

Accompanying transaction data.

Emits the #Pulled() event (multiple times)

pullMultiPartial()

Pulls specific amount(s) of ERC20(s) from locker to ZivoeDAO.

function pullMultiPartial(
    address locker, 
    address[] calldata assets, 
    uint256[] calldata amounts, 
    bytes[] calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address[]

assets

The asset(s) to pull.

uint256[]

amounts

The amount(s) to pull (may not refer to "asset", rather a different asset within the locker).

bytes[]

data

Accompanying transaction data.

Emits the #PulledPartial() event (multiple times)

pushERC721()

Pushes an NFT from ZivoeDAO to locker.

function pushERC721(
    address locker, 
    address asset, 
    uint256 tokenId, 
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to push an NFT to.

address

asset

The NFT contract.

uint256

tokenId

The NFT tokenId to push.

bytes

data

Accompanying data for the transaction.

Emits the #PushedERC721()

pushMultiERC721()

Pushes NFT(s) from ZivoeDAO to locker.

function pushMultiERC721(
    address locker, 
    address[] calldata assets, 
    uint[] calldata tokenIds, 
    bytes[] calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to push NFTs to.

address[]

assets

The NFT contract(s).

uint256[]

tokenIds

The NFT tokenId(s) to push.

bytes[]

data

Accompanying data for the transaction(s).

Emits the #PushedERC721() event (multiple times)

pullERC721()

Pulls an NFT from locker to ZivoeDAO.

function pullERC721(
    address locker, 
    address asset, 
    uint tokenId, 
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address

asset

The NFT contract.

uint256

amount

The NFT tokenId to pull.

bytes

data

Accompanying data for the transaction.

Emits the #PulledERC721()

pullMultiERC721()

Pulls NFT(s) from locker to ZivoeDAO.

function pullMultiERC721(
    address locker,
    address[] calldata assets,
    uint[] calldata tokenIds,
    bytes[] calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address[]

assets

The NFT contract(s).

uint256[]

tokenIds

The NFT tokenId(s) to pull.

bytes[]

data

Accompanying data for the transaction(s).

Emits the #PulledERC721() event (multiple times)

pushERC1155()

Pushes ERC1155 assets from ZivoeDAO to locker.

function pushERC1155Batch(
    address locker,
    address asset,
    uint256[] calldata ids, 
    uint256[] calldata amounts,
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to push ERC1155 assets to.

address

asset

The ERC1155 asset to push to locker.

uint256[]

ids

The ids of "assets" to push.

uint256[]

amounts

The amounts of "assets" to push.

bytes

data

Accompanying data for the transaction.

Emits the #PushedERC1155() event

pullERC1155()

Pulls ERC1155 assets from locker to ZivoeDAO.

function pullERC1155Batch(
    address locker,
    address asset,
    uint256[] calldata ids, 
    uint256[] calldata amounts,
    bytes calldata data
) external onlyOwner nonReentrant;
Type
Name
Description

address

locker

The locker to pull from.

address

asset

The ERC1155 asset to pull.

uint256[]

ids

The ids of "assets" to pull.

uint256[]

amounts

The amounts of "assets" to pull.

bytes

data

Accompanying data for the transaction.

Emits the #PulledERC1155() event

Events

Pushed()

Emitted during #push() and #pushMulti()

event Pushed(
    address indexed locker, 
    address indexed asset, 
    uint256 amount, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker receiving "asset".

address

True

asset

The asset being pushed.

uint256

False

amount

The amount of "asset" being pushed.

bytes

False

data

Accompanying transaction data.

Pulled()

Emitted during #pull() and #pullMulti()

event Pulled(
    address indexed locker, 
    address indexed asset, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker "asset" is pulled from.

address

True

asset

The asset being pulled.

bytes

False

data

Accompanying transaction data.

PulledPartial()

Emitted during #pullPartial() and #pullMultiPartial()

event PulledPartial(
    address indexed locker, 
    address indexed asset, 
    uint256 amount, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker "asset" is pulled from.

address

True

asset

The asset being pulled.

uint256

False

amount

The amount of "asset" being pulled (or could represent a percentage, in basis points).

bytes

False

data

Accompanying transaction data.

PushedERC721()

Emitted during #pushERC721() and #pushMultiERC721()

event PushedERC721(
    address indexed locker, 
    address indexed asset, 
    uint256 indexed tokenId, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker receiving "asset".

address

True

asset

The ERC721 contract.

tokenId

The ID for a given "asset" / NFT.

bytes

False

data

Accompanying data for the transaction.

PulledERC721()

Emitted during #pullERC721() and #pullMultiERC721()

event PulledERC721(
    address indexed locker, 
    address indexed asset, 
    uint256 indexed tokenId, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker "assets" are pulled from.

address

True

asset

The ERC721 contract.

uint256

True

tokenId

The ID for a given "asset" / NFT.

bytes

False

data

Accompanying data for the transaction.

PushedERC1155()

Emitted during #pushERC1155()

event PushedERC1155(
    address indexed locker, 
    address indexed asset, 
    uint256[] ids, 
    uint256[] amounts, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker receiving "asset".

address

True

asset

The ERC1155 contract.

uint256[]

False

ids

The IDs for a given "asset" (ERC1155), corresponds to "amounts".

uint256[]

False

amounts

The amount of "id" to transfer.

bytes

False

data

Accompanying data for the transaction.

PulledERC1155()

Emitted during #pullERC1155()

event PulledERC1155(
    address indexed locker, 
    address indexed asset, 
    uint256[] ids, 
    uint256[] amounts, 
    bytes data
);
Type
Indexed
Name
Description

address

True

locker

The locker "asset" is pulled from.

address

True

asset

The ERC1155 contract.

uint256[]

False

ids

The IDs for a given "asset" (ERC1155), corresponds to "amounts".

uint256[]

False

amounts

The amount of "id" to transfer.

bytes

False

data

Accompanying data for the transaction.

Last updated