Understanding ABI Files

  ABI files can be generated using the eosio-cpp utility provided by eosio.cdt. The Application Binary Interface (ABI) is a JSON-based description.

1、ABI的基本结构

{
"version": "eosio::abi/1.0",
"types": [],
"structs": [],
"actions": [],
"tables": [],
"ricardian_clauses": [],
"abi_extensions": [],
"___comment" : ""
}

2、types describe the custom types that are used as a parameter in any public action or struct that needs to be described in the ABI.

  EOSIO implements a number of custom built-ins. Built-in types don't need to be described in an ABI file. If you would like to familiarize yourself with EOSIO's built-ins, they are defined here

  

3、structs

  action的数据会存在于 structs中。如create action。

{
"name": "create",
"base": "",
"fields": [
{
"name":"issuer",
"type":"name"
},
{
"name":"maximum_supply",
"type":"asset"
}
]
}

  

  struct会被写入 structs中。

{
"name": "currency_stats",
"base": "",
"fields": [
{
"name":"supply",
"type":"asset"
},
{
"name":"max_supply",
"type":"asset"
},
{
"name":"issuer",
"type":"account_name"
}
]
}

  

4、actions

{
"name": "transfer", //The name of the action as defined in the contract
"type": "transfer", //The name of the implicit struct as described in the ABI
"ricardian_contract": "" //An optional ricardian clause to associate to this action describing its intended functionality.
}

  每一个action会隐含(implicit)创建一个struct,通过type来指向。action'name struct'name are not required to be equal.

5、tables

6、Every time you 1)change a struct, 2)add a table, 3)add an action or 4)add parameters to an action, 5)use a new type, you will need to remember to update your ABI file. In many cases failure to update your ABI file will not produce any error.

7、

参考:

1、https://developers.eos.io/eosio-home/docs/the-abi

Understanding ABI Files的更多相关文章

  1. RASPBERRY PI 外设学习资源

    参考: http://www.siongboon.com/projects/2013-07-08_raspberry_pi/index.html Raspberry Pi         Get st ...

  2. 理解CSV文件以及ABAP中的相关操作

    在很多ABAP开发中,我们使用CSV文件,有时候,关于CSV文件本身的一些问题使人迷惑.它仅仅是一种被逗号分割的文本文档吗? 让我们先来看看接下来可能要处理的几个相关组件的词汇的语义. Separat ...

  3. npm5 packag-lock.json

    前几天升级了 Node.js v8.0 后,自带的 npm 也升级到了5.0,第一次使用的时候确实惊艳到了:原本重新安装一次模块要十几秒到事情,现在一秒多就搞定了.先不要激动,现在我来大概讲一下 np ...

  4. visualstu studio的 pdb调试文件

    1. 该博客介绍了pdb文件的概念,作用. 将该博文复制到最后了. https://devblogs.microsoft.com/devops/understanding-symbol-files-a ...

  5. What you should know about .so files

    In its early days, the Android OS was pretty much supporting only one CPU architecture: ARMv5.Do you ...

  6. Linking code for an enhanced application binary interface (ABI) with decode time instruction optimization

    A code sequence made up multiple instructions and specifying an offset from a base address is identi ...

  7. Understanding C++ Modules In C++20 (1)

    Compiling evironment: linux (ubuntu 16.04)+ gcc-10.2. The Post will clarify and discuss what modules ...

  8. Clang与libc++abi库安装

    系统ubuntu64位 Clang4.0 参考: 1 https://github.com/yangyangwithgnu/use_vim_as_ide#0.1 其中 第7章 工具链集成 2. htt ...

  9. ural 2073. Log Files

    2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...

随机推荐

  1. XXS level7

    (1)输入与第六关相同的Payload:"><A HREF="javascript:alert()"> 查看页面源代码,发现“herf"被过滤 ...

  2. PHP 框架

    LARAVEL/LUMEN,  CI  ,THINKPHP, YII ,SYMFONY YAF, PHALCON ,ICE FRAMEWORK

  3. 《DSP using MATLAB》Problem 7.4

  4. ex_BSGS

    //author Eterna #define Hello the_cruel_world! #pragma GCC optimize(2) #include<iostream> #inc ...

  5. python pytz时区设置模块

    如果你的程序要考虑时区,可以使用pytz.pytz官方文档:http://pytz.sourceforge.net/我使用的python版本:3.7.1 datetime模块中有tzinfo相关的东西 ...

  6. Linux之find

    命令功能: find命令是用来在给定的目录下查找符合给定条件的文件.它需要从磁盘中查找,效率低,whereis和locate是基于缓存中数据库查找,效率很高,但是一些新建的文件可能未加入到数据库中,使 ...

  7. Red-Gate.NET.Reflector.v8.0.1.308(内含注册机Keygen与注册图解)

    Red-Gate.NET.Reflector.v8.0.1.308(内含注册机Keygen与注册图解)   反编译神器 内含软件安装包.注册机及插件集合. 这里说下注册方法,注意不要在联网的情况下注册 ...

  8. LINUX 查看当前系统的内存使用情况 vmstat

    Linux vmstat 命令 Vmstat命令是最常见的Linux/Unix监控工具,可以展现给定时间间隔的服务器的状态值,包括服务器的CPU使用率,内存使用,虚拟内存交换情况,IO读写情况. 相比 ...

  9. 分享一个生成反遗忘复习计划的java程序

    想必这个曲线大家都认识,这是遗忘曲线,展示人的记忆会随着时间的延长慢慢遗忘的规律,同时还展示了如果我们过一段时间复习一次对遗忘的有利影响. 道理大家都懂,关键怎么做到? 靠在本子上记下今天我该复习哪一 ...

  10. python内置函数整理

    1. abs() 函数返回数字的绝对值 2 divmod() 函数把除数和余数运算结果结合起来,返回一个包含商和余数的元组(a // b, a % b). 3, input() 相等于 eval(ra ...