Baal

Baal ';_;'.

Flexible guild contract inspired by Moloch DAO framework.

Methods

adminLock

function adminLock() external view returns (bool)

Returns

NameTypeDescription
_0boolundefined

allowance

function allowance(address, address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined

Returns

NameTypeDescription
_0uint256undefined

avatar

function avatar() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

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

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.

encodeMultisend

function encodeMultisend(bytes[] _calls, address _target) external pure returns (bytes encodedMultisend)

Parameters

NameTypeDescription
_callsbytes[]undefined
_targetaddressundefined

Returns

NameTypeDescription
encodedMultisendbytesundefined

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

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.

getGuard

function getGuard() external view returns (address _guard)

Returns

NameTypeDescription
_guardaddressundefined

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.

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]

governorLock

function governorLock() external view returns (bool)

Returns

NameTypeDescription
_0boolundefined

gracePeriod

function gracePeriod() external view returns (uint32)

Returns

NameTypeDescription
_0uint32undefined

guard

function guard() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

hashOperation

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

Returns the keccak256 hash of calldata

Parameters

NameTypeDescription
_transactionsbytesundefined

Returns

NameTypeDescription
hashbytes32undefined

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

latestSponsoredProposalId

function latestSponsoredProposalId() external view returns (uint32)

Returns

NameTypeDescription
_0uint32undefined

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

lootPaused

function lootPaused() external view returns (bool)

Returns

NameTypeDescription
_0boolundefined

lootToken

function lootToken() external view returns (contract IBaalToken)

Returns

NameTypeDescription
_0contract IBaalTokenundefined

managerLock

function managerLock() external view returns (bool)

Returns

NameTypeDescription
_0boolundefined

memberVoted

function memberVoted(address, uint32) external view returns (bool)

Parameters

NameTypeDescription
_0addressundefined
_1uint32undefined

Returns

NameTypeDescription
_0boolundefined

minRetentionPercent

function minRetentionPercent() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

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

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

nonces

function nonces(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

owner

function owner() external view returns (address)

Returns the address of the current owner.

Returns

NameTypeDescription
_0addressundefined

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

proposalCount

function proposalCount() external view returns (uint32)

Returns

NameTypeDescription
_0uint32undefined

proposalOffering

function proposalOffering() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

proposals

function proposals(uint256) external view returns (uint32 id, uint32 prevProposalId, uint32 votingStarts, uint32 votingEnds, uint32 graceEnds, uint32 expiration, uint256 baalGas, uint256 yesVotes, uint256 noVotes, uint256 maxTotalSharesAndLootAtYesVote, address sponsor, bytes32 proposalDataHash, string details)

Parameters

NameTypeDescription
_0uint256undefined

Returns

NameTypeDescription
iduint32undefined
prevProposalIduint32undefined
votingStartsuint32undefined
votingEndsuint32undefined
graceEndsuint32undefined
expirationuint32undefined
baalGasuint256undefined
yesVotesuint256undefined
noVotesuint256undefined
maxTotalSharesAndLootAtYesVoteuint256undefined
sponsoraddressundefined
proposalDataHashbytes32undefined
detailsstringundefined

quorumPercent

function quorumPercent() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

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

renounceOwnership

function renounceOwnership() external nonpayable

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

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

setAvatar

function setAvatar(address _avatar) external nonpayable

Can only be called by the current owner.

Sets the avatar to a new avatar (newAvatar).

Parameters

NameTypeDescription
_avataraddressundefined

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

setGuard

function setGuard(address _guard) external nonpayable

Set a guard that checks transactions before execution.

Parameters

NameTypeDescription
_guardaddressThe address of the guard to be used or the 0 address to disable the guard.

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

setTarget

function setTarget(address _target) external nonpayable

Can only be called by the current owner.

Sets the target to a new target (newTarget).

Parameters

NameTypeDescription
_targetaddressundefined

shamans

function shamans(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

sharesPaused

function sharesPaused() external view returns (bool)

Returns

NameTypeDescription
_0boolundefined

sharesToken

function sharesToken() external view returns (contract IBaalToken)

Returns

NameTypeDescription
_0contract IBaalTokenundefined

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.

sponsorThreshold

function sponsorThreshold() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

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

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.

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

target

function target() external view returns (address)

Returns

NameTypeDescription
_0addressundefined

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

transferOwnership

function transferOwnership(address newOwner) external nonpayable

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressundefined

votingPeriod

function votingPeriod() external view returns (uint32)

Returns

NameTypeDescription
_0uint32undefined

Events

Approval

event Approval(address indexed owner, address indexed spender, uint256 amount)

Parameters

NameTypeDescription
owner indexedaddressundefined
spender indexedaddressundefined
amountuint256undefined

AvatarSet

event AvatarSet(address indexed previousAvatar, address indexed newAvatar)

Parameters

NameTypeDescription
previousAvatar indexedaddressundefined
newAvatar indexedaddressundefined

CancelProposal

event CancelProposal(uint256 indexed proposal)

Parameters

NameTypeDescription
proposal indexeduint256undefined

ChangedGuard

event ChangedGuard(address guard)

Parameters

NameTypeDescription
guardaddressundefined

GovernanceConfigSet

event GovernanceConfigSet(uint32 voting, uint32 grace, uint256 newOffering, uint256 quorum, uint256 sponsor, uint256 minRetention)

Parameters

NameTypeDescription
votinguint32undefined
graceuint32undefined
newOfferinguint256undefined
quorumuint256undefined
sponsoruint256undefined
minRetentionuint256undefined

Initialized

event Initialized(uint8 version)

Parameters

NameTypeDescription
versionuint8undefined

LootPaused

event LootPaused(bool paused)

Parameters

NameTypeDescription
pausedboolundefined

OwnershipTransferred

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

ProcessProposal

event ProcessProposal(uint256 indexed proposal, bool passed, bool actionFailed)

Parameters

NameTypeDescription
proposal indexeduint256undefined
passedboolundefined
actionFailedboolundefined

Ragequit

event Ragequit(address indexed member, address to, uint256 indexed lootToBurn, uint256 indexed sharesToBurn, address[] tokens)

Parameters

NameTypeDescription
member indexedaddressundefined
toaddressundefined
lootToBurn indexeduint256undefined
sharesToBurn indexeduint256undefined
tokensaddress[]undefined

SetupComplete

event SetupComplete(bool lootPaused, bool sharesPaused, uint32 gracePeriod, uint32 votingPeriod, uint256 proposalOffering, uint256 quorumPercent, uint256 sponsorThreshold, uint256 minRetentionPercent, string name, string symbol, uint256 totalShares, uint256 totalLoot)

Parameters

NameTypeDescription
lootPausedboolundefined
sharesPausedboolundefined
gracePerioduint32undefined
votingPerioduint32undefined
proposalOfferinguint256undefined
quorumPercentuint256undefined
sponsorThresholduint256undefined
minRetentionPercentuint256undefined
namestringundefined
symbolstringundefined
totalSharesuint256undefined
totalLootuint256undefined

ShamanSet

event ShamanSet(address indexed shaman, uint256 permission)

Parameters

NameTypeDescription
shaman indexedaddressundefined
permissionuint256undefined

SharesPaused

event SharesPaused(bool paused)

Parameters

NameTypeDescription
pausedboolundefined

SponsorProposal

event SponsorProposal(address indexed member, uint256 indexed proposal, uint256 indexed votingStarts)

Parameters

NameTypeDescription
member indexedaddressundefined
proposal indexeduint256undefined
votingStarts indexeduint256undefined

SubmitProposal

event SubmitProposal(uint256 indexed proposal, bytes32 indexed proposalDataHash, uint256 votingPeriod, bytes proposalData, uint256 expiration, uint256 baalGas, bool selfSponsor, uint256 timestamp, string details)

Parameters

NameTypeDescription
proposal indexeduint256undefined
proposalDataHash indexedbytes32undefined
votingPerioduint256undefined
proposalDatabytesundefined
expirationuint256undefined
baalGasuint256undefined
selfSponsorboolundefined
timestampuint256undefined
detailsstringundefined

SubmitVote

event SubmitVote(address indexed member, uint256 balance, uint256 indexed proposal, bool indexed approved)

Parameters

NameTypeDescription
member indexedaddressundefined
balanceuint256undefined
proposal indexeduint256undefined
approved indexedboolundefined

TargetSet

event TargetSet(address indexed previousTarget, address indexed newTarget)

Parameters

NameTypeDescription
previousTarget indexedaddressundefined
newTarget indexedaddressundefined

Errors

NotIERC165Compliant

error NotIERC165Compliant(address guard_)

guard_ does not implement IERC165.

Parameters

NameTypeDescription
guard_addressundefined