TWABDelegator

Delegate chances to win to multiple accounts. This contract allows accounts to easily delegate a portion of their tickets to multiple delegatees. The delegatees chance of winning prizes is increased by the delegated amount.

Write methods description

initialize()

Allows to initialize the contract during the deployment. Creates a new TWAB Delegator that is bound to the given ticket contract.

Parameters:

createDelegation()

This will create a new Delegation contract for the given slot and have it delegate its tickets to the given delegatee. If a non-zero lock duration is passed, then the delegatee cannot be changed, nor funding withdrawn, until the lock has expired. The _delegator and _slot params are used to compute the salt of the delegation.

Parameters:

Return:

fundDelegation()

Fund a delegation by transferring tickets from the caller to the delegation. Callable by anyone. Will revert if delegation does not exist.

Parameters:

Return:

transferDelegationTo()

Withdraw an _amount of tickets from a delegation. The delegator is assumed to be the caller. Tickets are sent directly to the passed _to address. Will revert if delegation is still locked.

Parameters:

Return:

multicall()

Allows a user to call multiple functions on the same contract. Useful for EOA who wants to batch transactions.

Parameters:

Return:

permitAndMulticall()

Allow a user to approve a ticket and run various calls in one transaction.

Parameters:

setMaxLockDuration()

Sets a new maximum lock duration. Only callable by the owner.

Parameters:

setMinLockDuration()

Sets a new minimum lock duration. Only callable by the owner.

Parameters:

updateDelegatee()

Updates the delegatee and lock duration for a delegation slot. Only callable by the _delegator. Will revert if delegation is still locked.

Parameters:

Return:

withdrawDelegation()

Withdraw tickets from a delegation. Only callable by the _delegator. Will send the tickets to this contract and increase the _delegator staked amount. Will revert if delegation is still locked.

Parameters:

Return:

renounceOwnership()

Leaves the contract without owner. It will not be possible to call the owner's functions anymore. Can only be called by the current owner. The method does not take any parameters. Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership()

Transfers ownership of the contract to a _pendingOwner. Can only be called by the current owner.

Parameters:

Read methods description

computeDelegationAddress()

Computes the address of the delegation for the delegator + slot combination.

Parameters:

Return:

delegationInstance()

Address of the delegation instance to which all proxies will point.

getDelegation()

Allows the caller to easily get the details for a delegation.

Parameters:

Return:

maxLockDuration()

Max lock time during which a delegation cannot be updated.

minLockDuration()

Min lock time during which a delegation cannot be updated.

owner()

Address of the owner role, it is granted with exclusive access to specific functions that use the modifier onlyOwner.

ticket()

Address of the prize pool ticket to which this contract is tied to.

Last updated