๐Ÿ“–
Yupana Document Portal
  • Introduction
    • What is Yupana.Finance?
    • Participants
    • FAQ
  • Lending
    • Supplying assets
      • General
    • Borrowing assets
      • General
  • Liquidation
  • Liquidity Risk
    • Yupana Interest Rate
  • โš™๏ธDeveloper space
    • yToken contract methods
      • ๐Ÿ“„Storage overview
      • accrueInterest
      • priceCallback
      • updateInterest
      • ๐Ÿ”ตLending methods
        • borrow
        • enterMarket
        • exitMarket
        • liquidate
        • mint
        • redeem
        • repay
      • ๐Ÿ”ตFA2 Token entrypoints
        • balance_of
        • get_total_supply
        • transfer
        • update_operators
      • ๐Ÿ›‘Admin methods
        • ๐Ÿ“ฅSetup entrypionts
          • setTokenAction
          • setUseAction
        • ๐ŸคนManage entrypoints
          • addMarket
          • setAdmin
          • setBorrowPause
          • setGlobalFactors
          • setTokenFactors
          • updateMetadata
          • withdrawReserve
    • InterestRate contract
      • ๐Ÿ”ตOn-chain views
        • getBorrowRate
        • getSupplyRate
        • getUtilizationRate
      • ๐Ÿ›‘Admin methods
        • setCoefficients
        • updateAdmin
    • PriceFeed contract
      • getPrice
      • receivePrice
      • ๐Ÿ›‘Admin methods
        • setProxyAdmin
        • updateOracle
        • updatePair
        • updateYToken
  • Agreements
    • Terms of Service
    • Privacy Policy
    • Cookie Policy
Powered by GitBook
On this page
  • Types
  • Usage
  • Errors
  1. Developer space
  2. yToken contract methods
  3. Admin methods
  4. Manage entrypoints

updateMetadata

parrams of updateMetadataParams -> storage with metadata, token_metadata upd

Entrypoint to update yToken token metadata info.

Types

type newMetadataParams is map(string, bytes)

type updateMetadataParams is [@layout:comb] record [
  tokenId               : nat;
  token_metadata        : newMetadataParams;
]

Usage

const tokenId = 0; // or new BigNumber(0) or "0"
const tokenMetadata = MichelsonMap.fromLiteral({
  symbol: Buffer.from("TST2").toString("hex"),
  name: Buffer.from("TEST2").toString("hex"),
  decimals: Buffer.from("6").toString("hex"),
  icon: Buffer.from("").toString("hex"),
});
const yupana = await tezos.contract.at(yTokenAddress);
const operation = await yupana.methods.updateMetadata(
    tokenId, 
    tokenMetadata
).send();
await operation.confirmation();
token_id = 0
yupana = ContractInterface.from_michelson(code) # or client.contract(contract_address)...
call = yupana.updateMetadata(token_id, metadata_bytes)
opg = call.inject()

Errors

  • yToken/not-admin - sender is not contract admin.

PrevioussetTokenFactorsNextwithdrawReserve

Last updated 3 years ago

โš™๏ธ
๐Ÿ›‘
๐Ÿคน