Prudentia
Computers
ERC20 Mutation Computer

ERC20 Mutation Computer

Purpose

ERC20 Mutation Computers are abstract smart contracts that extend the Mutated Value Computer to provide the functionality to configure and compute mutated values for ERC20 tokens, with decimal trimming and scaling.

Implementation

Implementation requires implementing the following functions:

    /**
     * @notice Abstract function to extract a uint256 value from the token.
     * @dev Extend this contract and implement this function to extract the desired value (e.g., totalSupply,
     *   totalBorrows, etc.) from the token. This function will be called by the getValue function.
     * @param token The token to extract the value from.
     * @return The extracted value.
     */
    function extractValueFromToken(address token) internal view virtual returns (uint256);
    /// @notice Checks if the caller is authorized to set the configuration.
    /// @dev This function should contain the access control logic for the setConfig function.
    function checkSetConfig() internal view virtual;