# SCY Notes I've added some of those notes here as well: https://www.notion.so/pendle/EIP-XXXX-Super-Composable-Yield-Standard-62d170a68d6f40b286ca88982090b8b7 In summary: * Need to add the MUST, MAY, SHOULD definitions for each function. * Do we include 2612 as optional like 4626? * Do we include 165? Cannot find info why 4626 didn't include it, but it makes so much sense for us to add it. * Add underlyingToken() to support wrapped implementations mainly, and where it can return zero address if the SCY is a native implementation. * Should there be preview functions? * Rename scyIndex() to exchangeRate() to conform with 4626 terminology * How to explain NoPull effectively to other integrators. * Do we market the standard as a wrapped standard first? If so, the narrative pivots. * Need to have SCY implementation example of wrapping an existing 4626 vault. * Use which math scaling standard for scyIndex? 2^40/1e18/1e27/etc. Notes from Yaron and William: * Yaron suggests extending 4626 (since more buy in, but we can't so we need others to understand, might need to mention 4626 in Rationale portion) * Terminology should be similar to 4626 convention means higher chance of acceptance * Add veTokens as out of scope * View/Preview functions CAN BE non-view (in SC perspective to protect against MEV) * scyIndexCurrent() MAY be view, but we recommend it to be view * isInvalidBaseToken(), save dev effort to loop through arrays to check, so just implement it ```solidity= function mintNoPull( // @arun primitive finance is using the same pattern address receiver, address baseTokenIn, uint256 minAmountScyOut ) external returns (uint256 amountScyOut); function redeemNoPull( address receiver, address baseTokenOut, uint256 minAmountBaseOut ) external returns (uint256 amountBaseOut); function mint( address receiver, address baseTokenIn, uint256 amountBaseToPull, uint256 minAmountScyOut ) external returns (uint256 amountScyOut); function redeem( address receiver, address baseTokenOut, uint256 amountScyToPull, uint256 minAmountBaseOut // recommendation on how to set the min amount (per SCY contract) to avoid manipulation. Pain points: afraid of being frontrun. View function if convenient ) external returns (uint256 amountBaseOut); //previewMint and previewRedeem can be non-view ? function previewMint( // @arun could be in related periphery contracts ? address baseTokenIn, uint256 amountBaseToPull ) external returns (uint256 amountScyOut); function previewRedeem( address baseTokenOut, uint256 amountScyToPull ) external returns (uint256 amountBaseOut); function updateGlobalRewards() external; function updateUserRewards(address user) external; // option 1 function redeemReward(address user) external returns (uint256[] memory outAmounts); // @arun maybe dont separate the redeemRewards into a different function ? // option 2 function redeemReward(address to) external returns (uint256[] memory outAmounts); // scyIndex is always scaled by 1e18 function scyIndexCurrent() external returns (uint256); // could be view // @arun naming is not standard. Price Per share could be a different name ? Yearn is using it function scyIndexStored() external view returns (uint256); function getBaseTokens() external view returns (address[] memory); function isValidBaseToken(address token) external view returns (bool); // saves the efforts/annoyance for looping through the array and check function getRewardTokens() external view returns (address[] memory); // Metadata function assetDecimals() external view returns (uint8); function assetId() external view returns (bytes32); ``` ## New ```solidity interface ISuperComposableYield is IERC20Metadata { function mint( address receiver, address baseTokenIn, uint256 amountBaseToPull, uint256 minAmountScyOut ) external returns (uint256 amountScyOut); function redeem( address receiver, address baseTokenOut, uint256 amountScyToPull, uint256 minAmountBaseOut ) external returns (uint256 amountBaseOut); function redeemReward(address user) external returns (uint256[] memory outAmounts); /** * @notice pricePerAssetCurrent * scyBalance / 1e18 must return the asset balance of the account * @notice vice-versa, if a user uses some amount of tokens equivalent to X asset, the amount of scy he can mint must be X * pricePerAssetCurrent / 1e18 * @dev SCYUtils's assetToScy & scyToAsset should be used instead of raw multiplication & division */ function pricePerAssetCurrent() external returns (uint256); function pricePerAssetStored() external view returns (uint256); function getBaseTokens() external view returns (address[] memory); function isValidBaseToken(address token) external view returns (bool); function getRewardTokens() external view returns (address[] memory); function assetDecimals() external view returns (uint8); } ```