Baal Function Overview


Setup

setUp

function setUp(bytes _initializationParams) external nonpayable

Summon Baal with voting configuration & initial array of members accounts with shares & loot weights.

Parameters

NameTypeDescription
_initializationParamsbytesEncoded setup information.

Proposals

submitProposal

function submitProposal(bytes proposalData, uint32 expiration, uint256 baalGas, string details) external payable returns (uint256)

Submit proposal to Baal members for approval within given voting period.

Parameters

NameTypeDescription
proposalDatabytesMultisend encoded transactions or proposal data
expirationuint32undefined
baalGasuint256undefined
detailsstringContext for proposal.

Returns

NameTypeDescription
_0uint256proposal Count for submitted proposal.

sponsorProposal

function sponsorProposal(uint32 id) external nonpayable

Sponsor proposal to Baal members for approval within voting period.

Parameters

NameTypeDescription
iduint32Number of proposal in proposals mapping to sponsor.

processProposal

function processProposal(uint32 id, bytes proposalData) external nonpayable

Process proposal & execute internal functions.

Proposal must have succeeded, not been processed, not expired, retention threshold must be met

Parameters

NameTypeDescription
iduint32Number of proposal in proposals mapping to process for execution.
proposalDatabytesPacked multisend data to execute via Gnosis multisend library

cancelProposal

function cancelProposal(uint32 id) external nonpayable

Cancel proposal prior to execution

Cancellable if proposal is during voting, sender is sponsor, governor, or if sponsor has fallen below threshold

Parameters

NameTypeDescription
iduint32Number of proposal in proposals mapping to process for execution.

executeAsBaal

function executeAsBaal(address _to, uint256 _value, bytes _data) external nonpayable

Can only be called by the avatar which means this can only be called if passed by another proposal or by a delegated signer on the Safe

Function to Execute arbitrary code as baal - useful if funds are accidentally sent here

Parameters

NameTypeDescription
_toaddressaddress to call
_valueuint256value to include in wei
_databytesarbitrary transaction data

Members

ragequit

function ragequit(address to, uint256 sharesToBurn, uint256 lootToBurn, address[] tokens) external nonpayable

Process member burn of shares and/or loot to claim 'fair share' of specified tokens

Parameters

NameTypeDescription
toaddressAccount that receives 'fair share'.
sharesToBurnuint256Baal voting weight to burn.
lootToBurnuint256Baal pure economic weight to burn.
tokensaddress[]Array of tokens to include in rage quit calculation

submitVote

function submitVote(uint32 id, bool approved) external nonpayable

Submit vote - proposal must exist & voting period must not have ended.

Parameters

NameTypeDescription
iduint32Number of proposal in proposals mapping to cast vote on.
approvedboolIf 'true', member will cast yesVotes onto proposal - if 'false', noVotes will be counted.

submitVoteWithSig

function submitVoteWithSig(uint32 id, bool approved, bytes signature) external nonpayable

Submit vote with EIP-712 signature - proposal must exist & voting period must not have ended.

Parameters

NameTypeDescription
iduint32Number of proposal in proposals mapping to cast vote on.
approvedboolIf 'true', member will cast yesVotes onto proposal - if 'false', noVotes will be counted.
signaturebytesConcatenated signature

Guild Management

setShamans

function setShamans(address[] _shamans, uint256[] _permissions) external nonpayable

Baal-only function to set shaman status.

Parameters

NameTypeDescription
_shamansaddress[]Addresses of shaman contracts
_permissionsuint256[]Permission level of each shaman in _shamans

lockAdmin

function lockAdmin() external nonpayable

Lock admin so setShamans cannot be called with admin changes

lockGovernor

function lockGovernor() external nonpayable

Lock governor so setShamans cannot be called with governor changes

lockManager

function lockManager() external nonpayable

Lock manager so setShamans cannot be called with manager changes


Shaman Functions

setAdminConfig

function setAdminConfig(bool pauseShares, bool pauseLoot) external nonpayable

Baal-or-admin-only function to set admin config (pause/unpause shares/loot)

Parameters

NameTypeDescription
pauseSharesboolTurn share transfers on or off
pauseLootboolTurn loot transfers on or off

setGovernanceConfig

function setGovernanceConfig(bytes _governanceConfig) external nonpayable

Baal-or-governance-only function to change periods.

Parameters

NameTypeDescription
_governanceConfigbytesEncoded configuration parameters voting, grace period, tribute, quorum, sponsor threshold, retention bound

mintShares

function mintShares(address[] to, uint256[] amount) external nonpayable

Baal-or-manager-only function to mint shares.

Parameters

NameTypeDescription
toaddress[]Array of addresses to receive shares
amountuint256[]Array of amounts to mint

mintLoot

function mintLoot(address[] to, uint256[] amount) external nonpayable

Baal-or-manager-only function to mint loot.

Parameters

NameTypeDescription
toaddress[]Array of addresses to mint loot
amountuint256[]Array of amounts to mint

burnLoot

function burnLoot(address[] from, uint256[] amount) external nonpayable

Baal-or-manager-only function to burn loot.

Parameters

NameTypeDescription
fromaddress[]Array of addresses to lose loot
amountuint256[]Array of amounts to burn

burnShares

function burnShares(address[] from, uint256[] amount) external nonpayable

Baal-or-manager-only function to burn shares.

Parameters

NameTypeDescription
fromaddress[]Array of addresses to lose shares
amountuint256[]Array of amounts to burn

Getters

state

function state(uint32 id) external view returns (enum Baal.ProposalState)

State helper to determine proposal state

Parameters

NameTypeDescription
iduint32Number of proposal in proposals

Returns

NameTypeDescription
_0enum Baal.ProposalStateUnborn -> Submitted -> Voting -> Grace -> Ready -> Processed -> Cancelled -> Defeated

getProposalStatus

function getProposalStatus(uint32 id) external view returns (bool[4])

Helper to get recorded proposal flags

Parameters

NameTypeDescription
iduint32Number of proposal in proposals

Returns

NameTypeDescription
_0bool[4][cancelled, processed, passed, actionFailed]

getCurrentVotes

function getCurrentVotes(address account) external view returns (uint256 votes)

Returns the current delegated vote balance for account.

Parameters

NameTypeDescription
accountaddressThe user to check delegated votes for.

Returns

NameTypeDescription
votesuint256Current votes delegated to account.

getPriorVotes

function getPriorVotes(address account, uint256 timeStamp) external view returns (uint256 votes)

Returns the prior number of votes for account as of timeStamp.

Parameters

NameTypeDescription
accountaddressThe user to check votes for.
timeStampuint256The unix time to check votes for.

Returns

NameTypeDescription
votesuint256Prior votes delegated to account.

isAdmin

function isAdmin(address shaman) external view returns (bool)

Helper to check if shaman permission contains admin capabilities

Parameters

NameTypeDescription
shamanaddressAddress attempting to execute admin permissioned functions

Returns

NameTypeDescription
_0boolundefined

isGovernor

function isGovernor(address shaman) external view returns (bool)

Helper to check if shaman permission contains governor capabilities

Parameters

NameTypeDescription
shamanaddressAddress attempting to execute governor permissioned functions

Returns

NameTypeDescription
_0boolundefined

isManager

function isManager(address shaman) external view returns (bool)

Helper to check if shaman permission contains manager capabilities

Parameters

NameTypeDescription
shamanaddressAddress attempting to execute manager permissioned functions

Returns

NameTypeDescription
_0boolundefined

totalLoot

function totalLoot() external view returns (uint256)

Helper to check total supply of child loot contract

Returns

NameTypeDescription
_0uint256undefined

totalShares

function totalShares() external view returns (uint256)

Helper to check total supply of child shares contract

Returns

NameTypeDescription
_0uint256undefined

totalSupply

function totalSupply() external view returns (uint256)

Helper to check total supply of loot and shares

Returns

NameTypeDescription
_0uint256undefined

Helpers

hashOperation

function hashOperation(bytes _transactions) external pure returns (bytes32 hash)

Returns the keccak256 hash of calldata

Parameters

NameTypeDescription
_transactionsbytesundefined

Returns

NameTypeDescription
hashbytes32undefined