Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"WebFetch(domain:docs.cap.app)"
]
}
}
}
5 changes: 4 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
url = https://github.com/yearn/tokenized-strategy
[submodule "lib/predicate-contracts"]
path = lib/predicate-contracts
url = https://github.com/predicatelabs/predicate-contracts
url = https://github.com/predicatelabs/predicate-contracts
[submodule "lib/continuous-clearing-auction"]
path = lib/continuous-clearing-auction
url = https://github.com/Uniswap/continuous-clearing-auction
27 changes: 27 additions & 0 deletions config/cap-token.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"address": "0x99991c6AAbba5a096f24f250b73580F5179b9999",
"implementation": "0x9c850771b321c6E7AA909413B5Cc98C86CcBa96f",
"name": "Cap",
"symbol": "CAP",
"decimals": 18,
"supply": "10B",
"owner": {
"address": "0x00000000c3da1F276183e66EBdb2B6dB7763b709",
"type": "timelock",
"delay": 86400,
"proposers": [
{
"address": "0x80A216738E4e49B262Deae6bEb6578Bdf164c2eA",
"type": "multisig",
"threshold": 3,
"signers": [
"0x62D0b3c0a77bE77EaB2060266a95FfaD9e6A3F51",
"0x7c29F6A93df60Bcd3B20f03B57a2F9e698FD4128",
"0xA62f87A9D4B5EE1F83cb644Ea076832A396101b8",
"0xC1F56b5Af6aFfe36BC9A4cd9bd6cAaCFdc18FD7a",
"0xdf466Fa3ddd0042d990FA9A023e040884CBaD439"
]
}
]
}
}
15 changes: 2 additions & 13 deletions contracts/ico/CCAToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ contract CCAToken is
}

/// @inheritdoc ICCAToken
function asset() public view returns (address assetAddress) {
function UNDERLYING_TOKEN_ADDRESS() public view returns (address assetAddress) {
assetAddress = getCCATokenStorage().asset;
}

Expand All @@ -128,24 +128,13 @@ contract CCAToken is
zapAddress = getCCATokenStorage().zap;
}

/// @inheritdoc ERC20Upgradeable
function name() public pure override returns (string memory) {
return "Cap Redeemable Token";
}

/// @inheritdoc EIP712Upgradeable
function _EIP712Name() internal pure override returns (string memory) {
return "Cap Redeemable Token";
}

/// @dev Exchange CCA tokens for the asset at a 1:1 value
/// @param _from Sender address
/// @param _to Receiver address
/// @param _amount Amount of tokens to exchange
function _exchange(address _from, address _to, uint256 _amount) internal {
address token = asset();
address token = UNDERLYING_TOKEN_ADDRESS();
if (token == address(0)) revert AssetNotSet();
if (IERC20(token).balanceOf(address(this)) < totalSupply()) revert InsufficientBalance();
if (_amount == 0) revert ZeroAmountNotValid();

_burn(_from, _amount);
Expand Down
8 changes: 5 additions & 3 deletions contracts/ico/ValidationHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { PredicateClient } from "@predicate/mixins/PredicateClient.sol";
import { Access } from "../access/Access.sol";
import { IContinuousClearingAuction } from "../interfaces/IContinuousClearingAuction.sol";
import {
IBaseERC1155ValidationHook,
IERC165,
IGatedERC1155ValidationHook,
IPredicateClient,
Expand Down Expand Up @@ -124,12 +125,12 @@ contract ValidationHook is IValidationHook, UUPSUpgradeable, PredicateClient, Ac
return getValidationHookStorage().auction;
}

/// @inheritdoc IGatedERC1155ValidationHook
/// @inheritdoc IBaseERC1155ValidationHook
function erc1155() external view returns (IERC1155) {
return IERC1155(getValidationHookStorage().erc1155);
}

/// @inheritdoc IGatedERC1155ValidationHook
/// @inheritdoc IBaseERC1155ValidationHook
function tokenId() external view returns (uint256) {
return getValidationHookStorage().tokenId;
}
Expand All @@ -142,7 +143,8 @@ contract ValidationHook is IValidationHook, UUPSUpgradeable, PredicateClient, Ac
/// @inheritdoc IERC165
function supportsInterface(bytes4 interfaceId) public pure returns (bool) {
return interfaceId == type(IValidationHook).interfaceId || interfaceId == type(IPredicateClient).interfaceId
|| interfaceId == type(IGatedERC1155ValidationHook).interfaceId || interfaceId == type(IERC165).interfaceId;
|| interfaceId == type(IGatedERC1155ValidationHook).interfaceId
|| interfaceId == type(IBaseERC1155ValidationHook).interfaceId || interfaceId == type(IERC165).interfaceId;
}

/// @inheritdoc UUPSUpgradeable
Expand Down
5 changes: 1 addition & 4 deletions contracts/interfaces/ICCAToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ interface ICCAToken {
/// @dev Asset not set yet
error AssetNotSet();

/// @dev Insufficient balance of the asset
error InsufficientBalance();

/// @dev Transfer not allowed
error TransferNotAllowed();

Expand Down Expand Up @@ -107,7 +104,7 @@ interface ICCAToken {

/// @notice Get the asset address
/// @return assetAddress Asset address
function asset() external view returns (address assetAddress);
function UNDERLYING_TOKEN_ADDRESS() external view returns (address assetAddress);

/// @notice Check if a user is whitelisted for sending CCA tokens
/// @param _user User address
Expand Down
3 changes: 3 additions & 0 deletions contracts/interfaces/ICapSymbioticVaultFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
pragma solidity ^0.8.28;

interface ICapSymbioticVaultFactory {
/// @notice CAP Symbiotic network middleware used for vaults created by this factory
function middleware() external view returns (address);

/// @notice Creates a new vault
/// @param _owner The owner of the vault, will manage delegations and set deposit limits
/// @param asset The asset of the vault
Expand Down
17 changes: 0 additions & 17 deletions contracts/interfaces/IGatedERC1155ValidationHook.sol

This file was deleted.

7 changes: 5 additions & 2 deletions contracts/interfaces/IValidationHook.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.28;

import { IGatedERC1155ValidationHook } from "./IGatedERC1155ValidationHook.sol";
import {
IBaseERC1155ValidationHook,
IGatedERC1155ValidationHook
} from "@continuous-clearing-auction/periphery/validationHooks/GatedERC1155ValidationHook.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import { IPredicateClient } from "@predicate/interfaces/IPredicateClient.sol";

/// @title IValidationHook
/// @notice Interface for the validation hook
/// @author kexley, Cap Labs
interface IValidationHook is IPredicateClient, IGatedERC1155ValidationHook, IERC165 {
interface IValidationHook is IPredicateClient, IGatedERC1155ValidationHook {
/// @custom:storage-location erc7201:cap.storage.ValidationHook
/// @dev Validation hook storage
/// @param auction Auction address
Expand Down
Loading