EOS Smart Contract ABI support type _eos

Source: Internet
Author: User

In the contract, the account name, function name, structural body name length is less than or equal to 13.

Common sense: The function name does not support the decimal point, but the structure name can support underlining

The contract accounts account only supports the following characters: ". 12345abcdefghijklmnopqrstuvwxyz", which means something.


First, the type of support

unsigned __int128 uint128_t
unsigned long long uint64_t
unsigned long uint32_t
unsigned short  uint16_t
unsigned char uint8_t
long long int64_t
long int32_t short
int16_t
char int8_t
std::vector <type>
std::string

Unsupported type, array can be substituted with vector, BOOL can be used as char instead

__int128 int128_t
size_t
signed char 
double
float

bool
array

Here is the test hello.cpp

#include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace Eosio;  
  
      Class Hello:public Eosio::contract {public:using contract::contract;  
      @abi action void Hi (account_name user) {print ("Hello,", name{user});
      	}//@abi table test i64 struct Test {unsigned __int128 uint128_1;
      	
      	uint128_t uint128_2;
      	unsigned long long uint64_1;

		uint64_t Uint64_2;
		unsigned long uint32_1;

		uint32_t uint32_2;
		unsigned short uint16_1;
		
		uint16_t Uint16_2;
		unsigned char uint8_1;

		uint8_t uint8_2;
		Long Long int64_1;
      	
      	int64_t Int64_2;
      	Long int32_1;
      	
      	int32_t int32_2;
      	Short Int16_1;
      	
      	int16_t Int16_2;
      	Char int8_1;

      	int8_t int8_2;
      	Std::vector<char> VEC;

      	std::string str; __int128 int128;
      	int128_t int128_2;
      	Char s[10];
      	Signed Char S_char;
      	BOOL BL;
      	Double DL;
      	float ft;
      Size_t St;
};  
  
};   Eosio_abi (Hello, (HI))

Hello.abi for testing

{"____comment": "This file is generated by Eosio-abigen. Do not edit-2018-04-12t05:34:32 "," Types ": []," structs ": [{" Name ":" Test_ "," Base ":" "," Fields " : [{' Name ': ' Uint128_1 ', ' type ': ' uint128 '},{' name ': ' uint128_2 ', ' type ': ' uint128 '},{' name ': ' Uint64_1 ', ' type ': ' UInt64 '},{' name ': ' Uint64_2 ' , ' type ': ' UInt64 '},{' name ': ' Uint32_1 ', ' type ': ' UInt32 '},{' n
        Ame ": Uint32_2", "type": "UInt32"},{"name": "Uint16_1", "type": "UInt16" },{"name": "Uint16_2", "type": "UInt16"},{"name": "Uint8_1", "type": "U
          int8 "},{" Name: "Uint8_2", "type": "Uint8"},{"name": "Int64_1",
' Type ': ' Int64 '},{' name ': ' Int64_2 ', ' type ': ' Int64 '        },{' name ': ' Int32_1 ', ' Type ': ' Int32 '},{' name ': ' int32_2 ', ' Typ
          E ":" Int32 "},{" name ":" Int16_1 "," type ":" Int16 "},{" name ":" Int16_2 ", ' type ': ' Int16 '},{' name ': ' Int8_1 ', ' type ': ' int8 '},{' name ': ' In T8_2 ", type": "int8"},{"name": "Vec", "type": "int8[" "},{" nam
          E ': ' str ', ' type ': ' String '}]},{' name ': ' Hi ', ' base ': ', ' Fields ': [{ 
      ' Name ': ' User ', ' type ': ' Account_name '} '}], ' actions ': [{' name ': ' Hi ', ' type ': ' Hi ', ' ricardian_contract ': ' '} ', ' Tables ': [{' Name ': ' Test ', ' index_type ': ' I "," Key_names ": [" Uint128_1 "]," key_types ": [" uint128 "]," type ":" Test _ "}]," clauses": []
} 



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.