Welcome to CosVM
  • 🕧What is CosVM?
  • 🚧Technical structure
  • ⛓️User Guide
    • CVM Wallet Configuration
    • CVM Wallet App
    • MetaMask Configuration
    • Keplr Wallet Configuration
    • Trust Wallet
  • 🔯Developer Docs
    • 🉑Concepts
      • Accounts
      • Chain ID
      • Overview of Gas and Fees on CosVM Blockchain
      • Tokenomics of CosVM Blockchain
      • Token
      • Transactions
      • Tokens Transfer
      • Gas and Fees
    • Getting Started
    • Smart Contracts
      • Evm Extension
        • Authorization
        • Types
        • Staking
        • Distribution
        • IBC Transfer
    • 🔍CosVM Block Explorer
    • Mainnet
    • Wallet Integration
    • Other Tools
      • Contract Verification
      • Smart Contract Development Tools:
    • API
      • Network
      • Ethereum JSON-RPC
        • API Method
      • Cosmos gRPC & REST
      • Tendermint RPC
    • Cosvm using Docker
    • DAPPS
      • Getting Started
      • 🫂CVM dApps
  • 🈳Validator Docs
    • Validator Overview
    • Installation Reqirement
    • Run a Validator
    • Launch a CVM Node
    • Launch Multi CVM Node
    • Disk Optimization
    • State Sync
    • Mempool
    • ❄️IBC
      • IBC
      • IBC Relaying Guide
  • ❓Why Use CosVM
  • 🔐Safety & Security
  • ⁉️FAQs
Powered by GitBook
On this page
  • 1. Dec:
  • 2. Coin
  • 3. DecCoin
  • 4. PageResponse
  • 5.Page Request
  • 6. Height
  1. Developer Docs
  2. Smart Contracts
  3. Evm Extension

Types

The provided Solidity code defines several struct types, each serving a specific purpose within a smart contract or a system

1. Dec:

struct Dec {
    uint256 value;
    uint8 precision;
}
  • Description: Represents a fixed point decimal value, stored as an integer multiplied by 10^precision to obtain the actual value.

  • Properties:

    • value: Unsigned integer storing the value.

    • precision: Unsigned integer of 8 bits (uint8) representing the precision.

    • Unsigned integer of 8 bits (uint8) representing the precision.

2. Coin

struct Coin {
    string denom;
    uint256 amount;
}
  • Description: Represents a token with a denomination and an amount.

  • Properties:

    • denom: String representing the denomination of the token.

    • amount: Unsigned integer storing the token's amount.

3. DecCoin

struct DecCoin {
    string denom;
    uint256 amount;
    uint8 precision;
}
  • Description: Represents a token with a denomination, an amount, and a precision.

  • Properties:

    • denom: String representing the denomination of the token.

    • amount: Unsigned integer storing the token's amount.

    • precision: Unsigned integer of 8 bits (uint8) representing the precision of the token amount.

4. PageResponse

struct PageResponse {
    bytes nextKey;
    uint64 total;
}
  • Description: Represents a page response.

  • Properties:

    • nextKey: Bytes representing the next key for pagination.

    • total: Unsigned integer (uint64) representing the total count.

5.Page Request

struct PageRequest {
    bytes key;
    uint64 offset;
    uint64 limit;
    bool countTotal;
    bool reverse;
}
  • Description: Represents a page request for pagination purposes.

  • Properties:

    • key: Bytes representing the key for pagination.

    • offset: Unsigned integer (uint64) specifying the offset for pagination.

    • limit: Unsigned integer (uint64) specifying the limit for pagination.

    • countTotal: Boolean indicating whether total count should be calculated.

    • reverse: Boolean indicating whether the pagination should be in reverse order.

6. Height

struct Height {
    // the revision that the client is currently on
    uint64 revisionNumber;
    // the height within the given revision
    uint64 revisionHeight;
}
  • Description: Represents a monotonically increasing data type used for comparison and updating/freezing clients.

  • Properties:

    • revisionNumber: Unsigned integer (uint64) representing the revision the client is currently on.

    • revisionHeight: Unsigned integer (uint64) representing the height within the given revision.

PreviousAuthorizationNextStaking

Last updated 1 year ago

🔯