Introduction of AOS Smart Contract Development

I. AOS core is modified from eos, and contract writing and compilation are compatible with each other

Please refer to the below for contract complication tools:

https://github.com/EOSIO/eosio.cdt

Basic syntax examples of contract development

https://github.com/EOSIO/eosio.cdt/tree/master/examples

https://developers.eos.io/welcome/latest/getting-started/index

https://github.com/EOSIO/eosio.contracts

II. Example of contract helloworldgo

1. Write the smart contract

#include <eosiolib/eosio.hpp>

#include <eosiolib/print.hpp>

using namespace eosio;

class helloworldgo : public eosio::contract {

public:

using contract::contract;

/// @abi action

void test(account_name user) {

print(“Hello ,”, name{user});

}

};

EOSIO_ABI(helloworldgo, (test))

2. Compile the contract

eosiocpp -o helloworldgo.wast helloworldgo.cpp

3. Generate abi file

eosiocpp -g helloworldgo.abi helloworldgo.cpp

4. Create a new account for the smart contract

./claos create key — to-console

Private key: 5KfpBUMqo5hLtD1d3cQZwyTVCq556PgEHHWMr4wAzdEzPbHyy1W

Public key: AOS6sMH2zJxoztWyo7viz71TFszCaerGpDmZpmi3nX1q6gkL6J383

5. Import the private key into the wallet

claos wallet import 5KfpBUMqo5hLtD1d3cQZwyTVCq556PgEHHWMr4wAzdEzPbHyy1W

6. Create the contract account

claos create account eosio helloworldgo AOS6sMH2zJxoztWyo7viz71TFszCaerGpDmZpmi3nX1q6gkL6J383 AOS6sMH2zJxoztWyo7viz71TFszCaerGpDmZpmi3nX1q6gkL6J383

7. Deploy the smart contract

claos set contract helloworldgo ./helloworldgo -p helloworldgo

8. Call the smart contract

claos push action helloworldgo test ‘{“user”:”helloworldgo”}’ -p helloworldgo

Makes Encryption Assets Safer