RepoTokenLinkedList.sol#RepoTokenLinkedList
Last updated
Last updated
Inherits: Initializable, UUPSUpgradeable, AccessControlUpgradeable, ReentrancyGuardUpgradeable, PausableUpgradeable,
A marketplace for trading repo tokens
Implements upgradeable patterns and various security features
Contract constructor
Parameters
termController
address
Address of the term controller contract
repoTokenLinkedListEventEmitter
address
Address of the event emitter contract
Initializes the contract with admin and devops roles
Sets up roles and initializes the contract using OpenZeppelin's upgradeable pattern
See: https://docs.openzeppelin.com/contracts/4.x/upgradeable
Parameters
discountRateAdapter_
address
The address of the discount rate oracle
adminWallet_
address
The address to be granted the admin role
devopsWallet_
address
The address to be granted the devops role
Modifier to check if a repo token is valid
Sets the blacklist status for a repo token
Parameters
repoToken
address
The address of the repo token
blacklisted
bool
The blacklist status to set
Sets a new discount rate adapter
Parameters
newAdapter
address
The address of the new discount rate adapter
Sets a new value for the discount rate markup
Only callable by accounts with the ADMIN_ROLE
Parameters
newMarkup
uint256
The new markup value to set
Pauses the contract
Unpauses the contract
Creates a new listing for a repo token
Parameters
repoToken
address
The address of the repo token to list
amount
uint256
The amount of tokens to list
Allows a user to purchase repo tokens
Parameters
desiredAmount
uint256
The amount of tokens to purchase
repoToken
address
The address of the repo token to purchase
Allows a user to purchase repo tokens
Parameters
purchaseTokenAmount
uint256
The amount of purchase tokens to spend in purchase
repoToken
address
The address of the repo token to purchase
Internal function to handle the purchase logic
Parameters
repoToken
address
The address of the repo token to purchase
purchaseToken
address
The address of the token used for purchase
desiredAmount
uint256
The amount of tokens to purchase
pricePerToken
uint256
The price per token
Allows a seller to cancel their listing
Parameters
listingId
uint256
The ID of the listing to cancel
skipRedeem
bool
Whether to skip the redeem process
Repotokens can be redeemed by anyone on behalf of any third-party
Internal function to remove a listing
Parameters
repoToken
address
The address of the repo token
listingId
uint256
The ID of the listing to remove
Retrieves the details of a listing
Parameters
listingId
uint256
The ID of the listing to retrieve
Returns
seller
address
The address of the seller
token
address
The address of the token being sold
amount
uint256
The amount of tokens being sold
Gets the total number of active listings
Parameters
repoToken
address
The address of the repo token
Returns
<none>
uint256
The total number of listings
Checks if a repo token is valid
Parameters
repoToken
address
The address of the repo token to check
Returns
<none>
bool
bool indicating if the repo token is valid
Ensures only authorized addresses can upgrade the contract
Overrides the UUPSUpgradeable _authorizeUpgrade function to include role checks.
required override by the OpenZeppelin UUPS module
Parameters
<none>
address