Core Architecture
Contract Structure
The system consists of two main contracts:
RepoTokenLinkedListStorageV1
: Defines the storage layoutRepoTokenLinkedList
: Implements the core trading logic and access control
Key Dependencies
OpenZeppelin Upgradeable contracts for:
Access Control
Pausable functionality
Reentrancy protection
UUPS upgradeability pattern
Integration with Term Protocol contracts:
Storage Structure
Listing Management
struct Listing {
address seller;
address token;
uint256 amount;
uint256 next;
uint256 prev;
}
struct Queue {
uint256 head;
uint256 tail;
}
The contract uses a linked list implementation for efficient listing management, with separate queues for each RepoToken.
Last updated