S Price: $0.590262 (-0.34%)

Contract

0x9a4007F77a6374Ebf8b5DF249E0ab5D38c32eE9e

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

1 Internal Transaction found.

Latest 1 internal transaction

Parent Transaction Hash Block From To
116958202025-03-04 21:13:5530 hrs ago1741122835  Contract Creation0 S
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StructuredLinkedList

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion
File 1 of 1 : StructuredLinkedList.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.24;

/**
 * @title StructuredLinkedList
 * @author Vittorio Minacori (https://github.com/vittominacori)
 * @dev An utility library for using sorted linked list data structures in your Solidity project.
 * @notice Adapted from
 * https://github.com/Layr-Labs/eigenlayer-contracts/blob/master/src/contracts/libraries/StructuredLinkedList.sol
 */
library StructuredLinkedList {
    uint256 private constant _NULL = 0;
    uint256 private constant _HEAD = 0;

    bool private constant _PREV = false;
    bool private constant _NEXT = true;

    struct List {
        uint256 size;
        mapping(uint256 => mapping(bool => uint256)) list;
    }

    /**
     * @dev Checks if the list exists
     * @param self stored linked list from contract
     * @return bool true if list exists, false otherwise
     */
    function listExists(
        List storage self
    ) public view returns (bool) {
        // if the head nodes previous or next pointers both point to itself, then there are no items in the list
        if (self.list[_HEAD][_PREV] != _HEAD || self.list[_HEAD][_NEXT] != _HEAD) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Checks if the node exists
     * @param self stored linked list from contract
     * @param _node a node to search for
     * @return bool true if node exists, false otherwise
     */
    function nodeExists(List storage self, uint256 _node) public view returns (bool) {
        if (self.list[_node][_PREV] == _HEAD && self.list[_node][_NEXT] == _HEAD) {
            if (self.list[_HEAD][_NEXT] == _node) {
                return true;
            } else {
                return false;
            }
        } else {
            return true;
        }
    }

    /**
     * @dev Returns the number of elements in the list
     * @param self stored linked list from contract
     * @return uint256
     */
    // slither-disable-next-line dead-code
    function sizeOf(
        List storage self
    ) public view returns (uint256) {
        return self.size;
    }

    /**
     * @dev Gets the head of the list
     * @param self stored linked list from contract
     * @return uint256 the head of the list
     */
    function getHead(
        List storage self
    ) public view returns (uint256) {
        return self.list[_HEAD][_NEXT];
    }

    /**
     * @dev Gets the head of the list
     * @param self stored linked list from contract
     * @return uint256 the head of the list
     */
    function getTail(
        List storage self
    ) public view returns (uint256) {
        return self.list[_HEAD][_PREV];
    }

    /**
     * @dev Returns the links of a node as a tuple
     * @param self stored linked list from contract
     * @param _node id of the node to get
     * @return bool, uint256, uint256 true if node exists or false otherwise, previous node, next node
     */
    // slither-disable-next-line dead-code
    function getNode(List storage self, uint256 _node) public view returns (bool, uint256, uint256) {
        if (!nodeExists(self, _node)) {
            return (false, 0, 0);
        } else {
            return (true, self.list[_node][_PREV], self.list[_node][_NEXT]);
        }
    }

    /**
     * @dev Returns the link of a node `_node` in direction `_direction`.
     * @param self stored linked list from contract
     * @param _node id of the node to step from
     * @param _direction direction to step in
     * @return bool, uint256 true if node exists or false otherwise, node in _direction
     */
    // slither-disable-next-line dead-code
    function getAdjacent(List storage self, uint256 _node, bool _direction) public view returns (bool, uint256) {
        if (!nodeExists(self, _node)) {
            return (false, 0);
        } else {
            uint256 adjacent = self.list[_node][_direction];
            return (adjacent != _HEAD, adjacent);
        }
    }

    /**
     * @dev Returns the link of a node `_node` in direction `_NEXT`.
     * @param self stored linked list from contract
     * @param _node id of the node to step from
     * @return bool, uint256 true if node exists or false otherwise, next node
     */
    // slither-disable-next-line dead-code
    function getNextNode(List storage self, uint256 _node) public view returns (bool, uint256) {
        return getAdjacent(self, _node, _NEXT);
    }

    /**
     * @dev Returns the link of a node `_node` in direction `_PREV`.
     * @param self stored linked list from contract
     * @param _node id of the node to step from
     * @return bool, uint256 true if node exists or false otherwise, previous node
     */
    // slither-disable-next-line dead-code
    function getPreviousNode(List storage self, uint256 _node) public view returns (bool, uint256) {
        return getAdjacent(self, _node, _PREV);
    }

    /**
     * @dev Insert node `_new` beside existing node `_node` in direction `_NEXT`.
     * @param self stored linked list from contract
     * @param _node existing node
     * @param _new  new node to insert
     * @return bool true if success, false otherwise
     */
    // slither-disable-next-line dead-code
    function insertAfter(List storage self, uint256 _node, uint256 _new) public returns (bool) {
        return _insert(self, _node, _new, _NEXT);
    }

    /**
     * @dev Insert node `_new` beside existing node `_node` in direction `_PREV`.
     * @param self stored linked list from contract
     * @param _node existing node
     * @param _new  new node to insert
     * @return bool true if success, false otherwise
     */
    // slither-disable-next-line dead-code
    function insertBefore(List storage self, uint256 _node, uint256 _new) public returns (bool) {
        return _insert(self, _node, _new, _PREV);
    }

    /**
     * @dev Removes an entry from the linked list
     * @param self stored linked list from contract
     * @param _node node to remove from the list
     * @return uint256 the removed node
     */
    function remove(List storage self, uint256 _node) public returns (uint256) {
        if ((_node == _NULL) || (!nodeExists(self, _node))) {
            return 0;
        }
        _createLink(self, self.list[_node][_PREV], self.list[_node][_NEXT], _NEXT);
        delete self.list[_node][_PREV];
        delete self.list[_node][_NEXT];

        self.size -= 1;

        return _node;
    }

    /**
     * @dev Pushes an entry to the head of the linked list
     * @param self stored linked list from contract
     * @param _node new entry to push to the head
     * @return bool true if success, false otherwise
     */
    function pushFront(List storage self, uint256 _node) public returns (bool) {
        return _push(self, _node, _NEXT);
    }

    /**
     * @dev Pushes an entry to the tail of the linked list
     * @param self stored linked list from contract
     * @param _node new entry to push to the tail
     * @return bool true if success, false otherwise
     */
    function pushBack(List storage self, uint256 _node) public returns (bool) {
        return _push(self, _node, _PREV);
    }

    /**
     * @dev Pops the first entry from the head of the linked list
     * @param self stored linked list from contract
     * @return uint256 the removed node
     */
    // slither-disable-next-line dead-code
    function popFront(
        List storage self
    ) public returns (uint256) {
        return _pop(self, _NEXT);
    }

    /**
     * @dev Pops the first entry from the tail of the linked list
     * @param self stored linked list from contract
     * @return uint256 the removed node
     */
    // slither-disable-next-line dead-code
    function popBack(
        List storage self
    ) public returns (uint256) {
        return _pop(self, _PREV);
    }

    /**
     * @dev Pushes an entry to the head of the linked list
     * @param self stored linked list from contract
     * @param _node new entry to push to the head
     * @param _direction push to the head (_NEXT) or tail (_PREV)
     * @return bool true if success, false otherwise
     */
    function _push(List storage self, uint256 _node, bool _direction) private returns (bool) {
        return _insert(self, _HEAD, _node, _direction);
    }

    /**
     * @dev Pops the first entry from the linked list
     * @param self stored linked list from contract
     * @param _direction pop from the head (_NEXT) or the tail (_PREV)
     * @return uint256 the removed node
     */
    // slither-disable-next-line dead-code
    function _pop(List storage self, bool _direction) private returns (uint256) {
        uint256 adj;
        (, adj) = getAdjacent(self, _HEAD, _direction);
        return remove(self, adj);
    }

    /**
     * @dev Insert node `_new` beside existing node `_node` in direction `_direction`.
     * @param self stored linked list from contract
     * @param _node existing node
     * @param _new  new node to insert
     * @param _direction direction to insert node in
     * @return bool true if success, false otherwise
     */
    function _insert(List storage self, uint256 _node, uint256 _new, bool _direction) private returns (bool) {
        if (!nodeExists(self, _new) && nodeExists(self, _node)) {
            uint256 c = self.list[_node][_direction];
            _createLink(self, _node, _new, _direction);
            _createLink(self, _new, c, _direction);

            self.size += 1;

            return true;
        }

        return false;
    }

    /**
     * @dev Creates a bidirectional link between two nodes on direction `_direction`
     * @param self stored linked list from contract
     * @param _node existing node
     * @param _link node to link to in the _direction
     * @param _direction direction to insert node in
     */
    function _createLink(List storage self, uint256 _node, uint256 _link, bool _direction) private {
        self.list[_link][!_direction] = _node;
        self.list[_node][_direction] = _link;
    }
}

Settings
{
  "remappings": [
    "forge-std/=lib/forge-std/src/",
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "src/=src/",
    "test/=test/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/erc4626-tests/",
    "prb-math/=lib/prb-math/",
    "crytic/properties/=lib/properties/",
    "redstone-finance/=lib/redstone-evm-connector/packages/evm-connector/contracts/",
    "ERC4626/=lib/properties/lib/ERC4626/contracts/",
    "properties/=lib/properties/contracts/",
    "redstone-evm-connector/=lib/redstone-evm-connector/",
    "solmate/=lib/properties/lib/solmate/src/",
    "usingtellor/=lib/usingtellor/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false,
  "libraries": {
    "src/strategy/StructuredLinkedList.sol": {
      "StructuredLinkedList": "0x9a4007F77a6374Ebf8b5DF249E0ab5D38c32eE9e"
    },
    "src/strategy/WithdrawalQueue.sol": {
      "WithdrawalQueue": "0x4e8A14fCf4F13F0f95eE5c5706CD4dD2D75CcC50"
    },
    "src/vault/libs/Autopool4626.sol": {
      "Autopool4626": "0xdf4B7a41c68e238c22f3c85757616D5e54e89365"
    },
    "src/vault/libs/AutopoolDebt.sol": {
      "AutopoolDebt": "0xD1E2C5a00CE5953c3b58Cc3ef15d9cf53f01aF87"
    },
    "src/vault/libs/AutopoolDestinations.sol": {
      "AutopoolDestinations": "0xdd9E8A9A6946D6775EF1BB3156c98aA6F65C899F"
    },
    "src/vault/libs/AutopoolFees.sol": {
      "AutopoolFees": "0x70595538080D7763BB955cb795660922F938C83C"
    },
    "src/vault/libs/AutopoolStrategyHooks.sol": {
      "AutopoolStrategyHooks": "0x88e91D0A3133f586bAA38f5A972Ad43E0A276d0D"
    },
    "src/vault/libs/AutopoolToken.sol": {
      "AutopoolToken": "0x8233f06346d0752a46730A0adF39ad8c0eC1c323"
    }
  }
}

Contract Security Audit

Contract ABI

API
[]

610782610034600b8282823980515f1a607314602857634e487b7160e01b5f525f60045260245ffd5b305f52607381538281f3fe7300000000000000000000000000000000000000003014608060405260043610610106575f3560e01c80637692d1711161009e578063b72d65771161006e578063b72d6577146102b0578063d27b18d5146102cf578063e915a7b5146102e2578063f5779e6a14610301575f80fd5b80637692d1711461024c5780638d51bc781461026b578063a35e04f71461028a578063a4ff49571461029d575f80fd5b8063332306c0116100d9578063332306c0146101a25780633b39af86146101ce57806347bfc751146101fe5780636fb59d5e1461022d575f80fd5b8063189670bd1461010a578063203afb241461012f578063261b7ea0146101595780632b77a94b14610183575b5f80fd5b61011c610118366004610678565b5490565b6040519081526020015b60405180910390f35b61014261013d36600461068f565b610314565b604080519215158352602083019190915201610126565b61011c610167366004610678565b5f80805260019091016020908152604080832090915290205490565b81801561018e575f80fd5b5061011c61019d366004610678565b61035a565b61011c6101b0366004610678565b5f808052600191820160209081526040808320938352929052205490565b6101e16101dc3660046106c9565b61036c565b604080519315158452602084019290925290820152606001610126565b818015610209575f80fd5b5061021d6102183660046106e9565b6103bb565b6040519015158152602001610126565b818015610238575f80fd5b5061021d6102473660046106c9565b6103d1565b818015610257575f80fd5b5061011c6102663660046106c9565b6103e4565b818015610276575f80fd5b5061021d6102853660046106c9565b61047a565b61021d610298366004610678565b610487565b6101426102ab3660046106c9565b6104da565b8180156102bb575f80fd5b5061021d6102ca3660046106e9565b6104f3565b6101426102dd3660046106c9565b610500565b8180156102ed575f80fd5b5061011c6102fc366004610678565b61050d565b61021d61030f3660046106c9565b610518565b5f806103208585610518565b61032e57505f905080610352565b50505f82815260018401602090815260408083208415158452909152902054801515905b935093915050565b5f610366826001610598565b92915050565b5f805f6103798585610518565b61038a57505f9150819050806103b4565b5050505f818152600183810160209081526040808420848052909152808320548284529220549091905b9250925092565b5f6103c984848460016105b3565b949350505050565b5f6103dd83835f610637565b9392505050565b5f8115806103f957506103f78383610518565b155b1561040557505f610366565b5f82815260018481016020908152604080842084805290915280832054828452922054610436928692909190610644565b5f828152600184810160209081526040808420848052909152808320839055818352822082905584549091859161046e908490610726565b90915550919392505050565b5f6103dd83836001610637565b5f80805260018201602090815260408083209091528120541515806104c657505f80805260018084016020908152604080842092845291905290205415155b156104d357506001919050565b505f919050565b5f806104e884846001610314565b915091509250929050565b5f6103c98484845f6105b3565b5f806104e884845f610314565b5f610366825f610598565b5f818152600183016020908152604080832083805290915281205415801561055957505f828152600180850160209081526040808420928452919052902054155b15610590575f80805260018085016020908152604080842092845291905290205482900361058957506001610366565b505f610366565b506001610366565b5f806105a5845f85610314565b91506103c9905084826103e4565b5f6105be8584610518565b1580156105d057506105d08585610518565b1561062d575f848152600186016020908152604080832085151584529091529020546105fe86868686610644565b61060a86858386610644565b6001865f015f82825461061d9190610739565b90915550600192506103c9915050565b505f949350505050565b5f6103c9845f85856105b3565b5f82815260019094016020818152604080872093158088529382528087208690559486529081528385209115855252912055565b5f60208284031215610688575f80fd5b5035919050565b5f805f606084860312156106a1575f80fd5b8335925060208401359150604084013580151581146106be575f80fd5b809150509250925092565b5f80604083850312156106da575f80fd5b50508035926020909101359150565b5f805f606084860312156106fb575f80fd5b505081359360208301359350604090920135919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561036657610366610712565b808201808211156103665761036661071256fea2646970667358221220ba460090c926faa1eed3a3db733c693142ed147955b135dff8501578b309f98964736f6c634300081a0033

Deployed Bytecode

0x739a4007f77a6374ebf8b5df249e0ab5d38c32ee9e3014608060405260043610610106575f3560e01c80637692d1711161009e578063b72d65771161006e578063b72d6577146102b0578063d27b18d5146102cf578063e915a7b5146102e2578063f5779e6a14610301575f80fd5b80637692d1711461024c5780638d51bc781461026b578063a35e04f71461028a578063a4ff49571461029d575f80fd5b8063332306c0116100d9578063332306c0146101a25780633b39af86146101ce57806347bfc751146101fe5780636fb59d5e1461022d575f80fd5b8063189670bd1461010a578063203afb241461012f578063261b7ea0146101595780632b77a94b14610183575b5f80fd5b61011c610118366004610678565b5490565b6040519081526020015b60405180910390f35b61014261013d36600461068f565b610314565b604080519215158352602083019190915201610126565b61011c610167366004610678565b5f80805260019091016020908152604080832090915290205490565b81801561018e575f80fd5b5061011c61019d366004610678565b61035a565b61011c6101b0366004610678565b5f808052600191820160209081526040808320938352929052205490565b6101e16101dc3660046106c9565b61036c565b604080519315158452602084019290925290820152606001610126565b818015610209575f80fd5b5061021d6102183660046106e9565b6103bb565b6040519015158152602001610126565b818015610238575f80fd5b5061021d6102473660046106c9565b6103d1565b818015610257575f80fd5b5061011c6102663660046106c9565b6103e4565b818015610276575f80fd5b5061021d6102853660046106c9565b61047a565b61021d610298366004610678565b610487565b6101426102ab3660046106c9565b6104da565b8180156102bb575f80fd5b5061021d6102ca3660046106e9565b6104f3565b6101426102dd3660046106c9565b610500565b8180156102ed575f80fd5b5061011c6102fc366004610678565b61050d565b61021d61030f3660046106c9565b610518565b5f806103208585610518565b61032e57505f905080610352565b50505f82815260018401602090815260408083208415158452909152902054801515905b935093915050565b5f610366826001610598565b92915050565b5f805f6103798585610518565b61038a57505f9150819050806103b4565b5050505f818152600183810160209081526040808420848052909152808320548284529220549091905b9250925092565b5f6103c984848460016105b3565b949350505050565b5f6103dd83835f610637565b9392505050565b5f8115806103f957506103f78383610518565b155b1561040557505f610366565b5f82815260018481016020908152604080842084805290915280832054828452922054610436928692909190610644565b5f828152600184810160209081526040808420848052909152808320839055818352822082905584549091859161046e908490610726565b90915550919392505050565b5f6103dd83836001610637565b5f80805260018201602090815260408083209091528120541515806104c657505f80805260018084016020908152604080842092845291905290205415155b156104d357506001919050565b505f919050565b5f806104e884846001610314565b915091509250929050565b5f6103c98484845f6105b3565b5f806104e884845f610314565b5f610366825f610598565b5f818152600183016020908152604080832083805290915281205415801561055957505f828152600180850160209081526040808420928452919052902054155b15610590575f80805260018085016020908152604080842092845291905290205482900361058957506001610366565b505f610366565b506001610366565b5f806105a5845f85610314565b91506103c9905084826103e4565b5f6105be8584610518565b1580156105d057506105d08585610518565b1561062d575f848152600186016020908152604080832085151584529091529020546105fe86868686610644565b61060a86858386610644565b6001865f015f82825461061d9190610739565b90915550600192506103c9915050565b505f949350505050565b5f6103c9845f85856105b3565b5f82815260019094016020818152604080872093158088529382528087208690559486529081528385209115855252912055565b5f60208284031215610688575f80fd5b5035919050565b5f805f606084860312156106a1575f80fd5b8335925060208401359150604084013580151581146106be575f80fd5b809150509250925092565b5f80604083850312156106da575f80fd5b50508035926020909101359150565b5f805f606084860312156106fb575f80fd5b505081359360208301359350604090920135919050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561036657610366610712565b808201808211156103665761036661071256fea2646970667358221220ba460090c926faa1eed3a3db733c693142ed147955b135dff8501578b309f98964736f6c634300081a0033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.