Spigot.sol
Core functions and methods of Spigot.sol
Takes control of an onchain smart contract to escrow revenue earned by it
Allows the Spigot Owner to claim escrowed funds at anytime
Allows revenue splits between Spigot Owner and Operator
Allows updating stakeholder addresses
External calls to arbitrary contract with arbitrary calls
Libraries - SpigotLib.sol, LineLib.sol
Spigot Methods
Many of the Spigot's functions are called by SpigotedLine.sol so read this in conjunction with methods for that contract, the Glossary and further product information herein.
addSpigot()
Attach a new Revenue Contract to a Spigot
The Spigot is deployed automatically when a Line is first deployed. addSpigot() is later used to add additional Revenue Contracts.
updateWhitelistedFunction()
Allows the Owner to tell the Spigot to whitelist functions that the Operator is allowed to perform on its Revenue Contracts so that the Operator can still use those contracts whilst they are providing Revenue Tokens to repay credit.
Called by updateWhitelist() in SpigotedLine which is only callable by the Arbiter (acting on behalf of Line/Lenders). It updates what functions a Borrower (Operator) is allowed to perform on the Revenue Contract.
claimRevenue()
Claims Revenue Tokens into the Spigot escrow.
Claims Revenue Tokens and makes them available for later withdrawal to repay debt.
claimOwnerTokens()
Owner withdraws its split of the Revenue Tokens that have already been claimed via claimRevenue().
Allows a Lender to withdraw escrowed Revenue Tokens for the purposes of repaying debt.
claimOperatorTokens()
Operator withdraws its split of the Revenue Tokens that have already been claimed via claimRevenue().
Allows a Borrower to withdraw any Revenue Tokens which weren't escrowed for Lenders.
getOwnerTokens()
Returns the amount of Revenue Tokens in escrow for the Owner ready to be withdrawn.
getOperatorTokens()
Returns the amount of Revenue Tokens held for the Operator ready to be withdrawn.
isWhitelisted()
Returns the list of whitelisted functions that an Operator is allowed to perform on a Revenue Contract whilst the Spigot is attached.
Returns what the Borrower can do with a Revenue Contract whilst the Spigot is attached.
getSetting()
Returns the Spigot's settings for a Revenue Contract related to ownerSplit, claimFunction and transferOwnerFunction.
Returns important settings related to the setup of a Spigot to support a Secured Line. Particularly important for security.
operate()
Allows an Operator to call the whitelisted functions on its Revenue Contracts attached to the Spigot and carry on its business as usual activities.
Allows the Borrower to operate as usual but with some constraints in order to protect the rights of Lenders.
updateOwnerSplit()
Changes the revenue split between the Operator and the Owner based upon programmed conditions or otherwise if the Owner and Operator wish to change the split.
Changes the revenue split between a Borrower and Lenders based upon the status of the Line or other conditions.
updateOwner()
Puts a new Owner in control the Spigot.
In practice this would either change the Owner to the Borrower (Line fully repaid) or to the Arbiter (Line impaired)
updateOperator()
Puts a new Operator address in place to interact with the Revenue Contracts if ever this were needed.
This function exists for convenience/maintenance purposes only right now.
A Borrower may want to change an address for managing its protocol. Allowing key rotation is good opsec.
removeSpigot()
Removes control over a single Revenue Contract.
Used for example by a Borrower (acting as Spigot Owner) to fully remove the Spigot from a single Revenue Contract after some debt that was secured by that Revenue Contract has been repaid.
owner()
Returns the address of the current Spigot Owner.
operator()
Returns the address of the current Spigot Operator.
Last updated
Was this helpful?