zoukankan      html  css  js  c++  java
  • Solididy Global Variables

    Global Variables

      ● block.blockhash(uint blockNumber) returns (bytes32): hash of the given block - only works for 256 most recent blocks

      ● block.coinbase (address): current block miner’s address

      ● block.difficulty (uint): current block difficulty

      ● block.gaslimit (uint): current block gaslimit

      ● block.number (uint): current block number

      ● block.timestamp (uint): current block timestamp

      ● msg.data (bytes): complete calldata

      ● msg.gas (uint): remaining gas

      ● msg.sender (address): sender of the message (current call)

      ● msg.value (uint): number of wei sent with the message

      ● now (uint): current block timestamp (alias for block.timestamp)

      ● tx.gasprice (uint): gas price of the transaction

      ● tx.origin (address): sender of the transaction (full call chain)

      ● assert(bool condition): abort execution and revert state changes if condition is false (use for internal error)

      ● require(bool condition): abort execution and revert state changes if condition is false (use for malformed input or error in external component)

      ● revert(): abort execution and revert state changes

      ● keccak256(...) returns (bytes32): compute the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments

      ● sha3(...) returns (bytes32): an alias to keccak256

      ● sha256(...) returns (bytes32): compute the SHA-256 hash of the (tightly packed) arguments

      ● ripemd160(...) returns (bytes20): compute the RIPEMD-160 hash of the (tightly packed) arguments

      ● ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address): recover address associated with the public key from elliptic curve signature, return zero on error

      ● addmod(uint x, uint y, uint k) returns (uint): compute (x + y) % k where the addition is performed with arbitrary precision and does not wrap around at 2**256

      ● mulmod(uint x, uint y, uint k) returns (uint): compute (x * y) % k where the multiplication is performed with arbitrary precision and does not wrap around at 2**256

      ● this (current contract’s type): the current contract, explicitly convertible to address

      ● super: the contract one level higher in the inheritance hierarchy

      ● selfdestruct(address recipient): destroy the current contract, sending its funds to the given address

      ● suicide(address recipient): an alias to selfdestruct

      ● <address>.balance (uint256): balance of the Address in Wei

      ● <address>.send(uint256 amount) returns (bool): send given amount of Wei to Address, returns false on failure

      ● <address>.transfer(uint256 amount): send given amount of Wei to Address, throws on failure

    Global Variables ● block.blockhash(uint blockNumber) returns (bytes32): hash of the given block - only works for 256 most recent blocks ● block.coinbase (address): current block miner’s address ● block.difficulty (uint): current block difficulty ● block.gaslimit (uint): current block gaslimit ● block.number (uint): current block number ● block.timestamp (uint): current block timestamp ● msg.data (bytes): complete calldata ● msg.gas (uint): remaining gas ● msg.sender (address): sender of the message (current call) ● msg.value (uint): number of wei sent with the message ● now (uint): current block timestamp (alias for block.timestamp) ● tx.gasprice (uint): gas price of the transaction ● tx.origin (address): sender of the transaction (full call chain) ● assert(bool condition): abort execution and revert state changes if condition is false (use for internal error) ● require(bool condition): abort execution and revert state changes if condition is false (use for malformed input or error in external component) ● revert(): abort execution and revert state changes ● keccak256(...) returns (bytes32): compute the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments ● sha3(...) returns (bytes32): an alias to keccak256 ● sha256(...) returns (bytes32): compute the SHA-256 hash of the (tightly packed) arguments ● ripemd160(...) returns (bytes20): compute the RIPEMD-160 hash of the (tightly packed) arguments ● ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address): recover address associated with the public key from elliptic curve signature, return zero on error ● addmod(uint x, uint y, uint k) returns (uint): compute (x + y) % k where the addition is performed with arbitrary precision and does not wrap around at 2**256 ● mulmod(uint x, uint y, uint k) returns (uint): compute (x * y) % k where the multiplication is performed with arbitrary precision and does not wrap around at 2**256 ● this (current contract’s type): the current contract, explicitly convertible to address ● super: the contract one level higher in the inheritance hierarchy ● selfdestruct(address recipient): destroy the current contract, sending its funds to the given address ● suicide(address recipient): an alias to selfdestruct ● <address>.balance (uint256): balance of the Address in Wei ● <address>.send(uint256 amount) returns (bool): send given amount of Wei to Address, returns false on failure ● <address>.transfer(uint256 amount): send given amount of Wei to Address, throws on failure

  • 相关阅读:
    检索 COM 类工厂中 CLSID 为 {0002450000000000C000000000000046} 的组件时失败,原因是出现以下错误: 80070005。
    行列转换(sqlserver2005 的新方法)
    今天开始要详细的记录学习sharepoint 的进度和相关的一些资料
    SQL SERVER 2005 数据库状态为“可疑”的解决方法
    弹出窗口window.open()的参数列表
    C#术语&&C#关键字
    把一个 ASP.NET 程序转换为了 Web Services
    修饰符(C# 参考)
    C# 中的常用正则表达式
    1、String.format()与String.valueOf()区别 && 2、string.split()
  • 原文地址:https://www.cnblogs.com/siyuan-wang/p/8110710.html
Copyright © 2011-2022 走看看