koinos / koinos-chain

The chain microservice is responsible for the application of blocks, running of smart contracts, and applying transactions.
Other
15 stars 3 forks source link

Syscalls Table #28

Closed sgerbino closed 4 years ago

sgerbino commented 4 years ago

As a blockchain developer, I want an extensive syscall interface.

Note: An implementation that would satisfy this story could look like this:

map< syscall_slot, std::optional< vm_code_ptr > >

Example contract:

#include <koinos/koinos.hpp>
using namespace koinos;
class [[koinos::contract]] hello : public contract {
  public:
      using contract::contract;
      void hi( name user ) {
         print( "Hello, ", user);
      }
}

Example call: client push action hello hi '["bob"]' -p alice@active

Order of operations:

koinos.system.call_contract (overridable)
koinos.system._call_contract (non-overridable)
alice.hello.hi (user contract)
koinos.system.print (overridable)
koinos.system._print (non-overridable)
sgerbino commented 4 years ago

Closed via #44 and #45.