This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| asset token::get_balance( account_name owner, symbol_name sym )const | |
| { | |
| accounts accountstable( _self, owner ); | |
| const auto& ac = accountstable.get( sym ); | |
| return ac.balance; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| asset token::get_supply( symbol_name sym )const | |
| { | |
| stats statstable( _self, sym ); | |
| const auto& st = statstable.get( sym ); | |
| return st.supply; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public: | |
| using contract::contract; | |
| [[eosio::action]] | |
| void create( name issuer, | |
| asset maximum_supply); | |
| [[eosio::action]] | |
| void issue( name to, asset quantity, string memo ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private: | |
| struct [[eosio::table]] account { | |
| asset balance; | |
| uint64_t primary_key()const { return balance.symbol.code().raw(); } | |
| }; | |
| struct [[eosio::table]] currency_stats { | |
| asset supply; | |
| asset max_supply; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <eosiolib/eosio.hpp> | |
| #include <eosiolib/print.hpp> | |
| using namespace eosio; | |
| class hello : public eosio::contract { | |
| public: | |
| using contract::contract; | |
| void hi() { | |
| print( "Hello, World"); | |
| } | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "expiration": "...", | |
| "region": 0, | |
| "ref_block_num": ..., | |
| "ref_block_prefix": ..., | |
| "net_usage_words": .., | |
| "kcpu_usage": .., | |
| "delay_sec": 0, | |
| "context_free_actions": [], | |
| "actions": [{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #pragma once | |
| #include <eosiolib/asset.hpp> | |
| #include <eosiolib/eosio.hpp> | |
| #include <string> | |
| namespace eosiosystem { | |
| class system_contract; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "eosio.token.hpp" | |
| namespace eosio { | |
| void token::create( name issuer, | |
| asset maximum_supply ) | |
| { | |
| require_auth( _self ); | |
| auto sym = maximum_supply.symbol; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.20; | |
| contract poe { | |
| mapping(string => uint) proof; | |
| event Exists(string data, uint blockNumber); | |
| function prove(string data) constant public returns (uint) { | |
| return proof[data]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <eosiolib/eosio.hpp> | |
| #include <eosiolib/transaction.h> | |
| #include <string> | |
| #include <eosiolib/crypto.h> | |
| using std::string; | |
| using eosio::key256; | |
| using namespace eosio; | |