Nucleus
  • Overview
    • Welcome to Nucleus
    • Official Links
    • FAQ
  • Nucleus Architecture
    • Overview
    • Vault Framework
    • Cross-chain Infrastructure
    • Withdrawals
    • Revenue Strategies
      • Market-agnostic Lending
      • Cross-chain Intents
      • Ownership by Default
    • Reward Distribution
    • Nucleus Points
    • Deployed Assets
    • Smart Contracts
      • README
      • CONTRACTS
        • contents
        • atomic-queue
          • Contents
          • AtomicQueue
          • AtomicSolver
          • AtomicSolverV2
          • AtomicSolverV3
          • IAtomicSolver
        • base
          • Boring Vault
            • BoringVault
          • Decoders and Sanitizers
            • Contents
            • IonPoolDecoderAndSanitizer
          • Roles
            • Contents
            • Cross Chain
              • Cross Chain OP Teller With Multi Asset Support
                • CrossChainOPTellerWithMultiAssetSupport
                • ICrossDomainMessenger
              • Cross Chain Teller Base
                • BridgeData
                • CrossChainTellerBase
              • MultiChainLayerZeroTellerWithMultiAssetSupport
              • Multi Chain Teller Base
                • Chain
                • MultiChainTellerBase
                • MultiChainTellerBase_GasLimitExceeded
                • MultiChainTellerBase_GasTooLow
                • MultiChainTellerBase_MessagesNotAllowedFrom
                • MultiChainTellerBase_MessagesNotAllowedFromSender
                • MultiChainTellerBase_MessagesNotAllowedTo
                • MultiChainTellerBase_ZeroMessageGasLimit
              • OAppAuth
                • Contents
                • OAppAuth
                • OAppAuthCore
                • OAppAuthReceiver
                • OAppAuthSender
            • AccountantWithRateProviders
            • ManagerWithMerkleVerification
            • TellerWithMultiAssetSupport
        • helper
          • Contents
          • Constants
          • ArcticArchitectureLens
          • Deployer
          • GenericRateProvider
        • interfaces
          • BalancerVault
          • AggregationRouterV5
          • BeforeTransferHook
          • DecoderCustomTypes
          • ICreateX
          • IPriceFeed
          • PriceRouter
          • IRateProvider
          • INonFungiblePositionManager
          • Contents
          • IStaking
            • ILiquidityPool
            • ILRTDepositPool
            • IRestakeManager
            • IStaderConfig
            • IStakePoolManager
            • ISTETH
            • ISWETH
            • IUNSTETH
            • IUserWithdrawManager
            • IWEETH
            • IWithdrawRequestNft
            • IWSTETH
          • IUniswap v3 Router
            • IUniswapV3Router
            • IUniswapV3SwapCallback
        • micro-managers
          • Contents
          • DexSwapperUManager
          • DexAggregatorUManager
          • UManager
        • migration
          • Contents
          • CellarMigrationAdaptor
        • oracles
          • EthPerTokenRateProvider
          • Contents
          • EthPerWstEthRateProvider
  • Security
    • Audits
Powered by GitBook
On this page
  • State Variables
  • hook
  • Functions
  • constructor
  • manage
  • manage
  • enter
  • exit
  • setBeforeTransferHook
  • _callBeforeTransfer
  • transfer
  • transferFrom
  • receive
  • Events
  • Enter
  • Exit

Was this helpful?

  1. Nucleus Architecture
  2. Smart Contracts
  3. CONTRACTS
  4. base
  5. Boring Vault

BoringVault

PreviousBoring VaultNextDecoders and Sanitizers

Was this helpful?

Inherits: ERC20, Auth, ERC721Holder, ERC1155Holder

State Variables

hook

Contract responsible for implementing beforeTransfer.

BeforeTransferHook public hook;

Functions

constructor

constructor(
    address _owner,
    string memory _name,
    string memory _symbol,
    uint8 _decimals
)
    ERC20(_name, _symbol, _decimals)
    Auth(_owner, Authority(address(0)));

manage

Allows manager to make an arbitrary function call from this contract.

Callable by MANAGER_ROLE.

function manage(
    address target,
    bytes calldata data,
    uint256 value
)
    external
    requiresAuth
    returns (bytes memory result);

manage

Allows manager to make arbitrary function calls from this contract.

Callable by MANAGER_ROLE.

function manage(
    address[] calldata targets,
    bytes[] calldata data,
    uint256[] calldata values
)
    external
    requiresAuth
    returns (bytes[] memory results);

enter

Allows minter to mint shares, in exchange for assets.

If assetAmount is zero, no assets are transferred in.

Callable by MINTER_ROLE.

function enter(address from, ERC20 asset, uint256 assetAmount, address to, uint256 shareAmount) external requiresAuth;

exit

Allows burner to burn shares, in exchange for assets.

If assetAmount is zero, no assets are transferred out.

Callable by BURNER_ROLE.

function exit(address to, ERC20 asset, uint256 assetAmount, address from, uint256 shareAmount) external requiresAuth;

setBeforeTransferHook

Sets the share locker.

If set to zero address, the share locker logic is disabled.

Callable by OWNER_ROLE.

function setBeforeTransferHook(address _hook) external requiresAuth;

_callBeforeTransfer

Check if from addresses shares are locked, reverting if so.

function _callBeforeTransfer(address from) internal view;

transfer

function transfer(address to, uint256 amount) public override returns (bool);

transferFrom

function transferFrom(address from, address to, uint256 amount) public override returns (bool);

receive

receive() external payable;

Events

Enter

event Enter(address indexed from, address indexed asset, uint256 amount, address indexed to, uint256 shares);

Exit

event Exit(address indexed to, address indexed asset, uint256 amount, address indexed from, uint256 shares);
Git Source