This file contains 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 <eosio/fixed_bytes.hpp> | |
#include <eosio/name.hpp> | |
#include <eosio/varint.hpp> | |
#include <array> | |
namespace eosio { | |
namespace internal_use_do_not_use { | |
extern "C" { |
This file contains 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
add_executable(eosio.token src/eosio.token.cpp) | |
#target_compile_options(eosio.token PUBLIC --contract=eosio.token) | |
target_compile_definitions(eosio.token PUBLIC -DEOSIO_CONTRACT=eosio.token) | |
#target_compile_options(eosio.token PUBLIC --abi-version=1.2) | |
target_compile_definitions(eosio.token PUBLIC -DEOSIO_ABI_VERSION=1.2) | |
#target_compile_options(eosio.token PUBLIC --no-abigen) | |
target_compile_definitions(eosio.token PUBLIC -DEOSIO_NO_ABIGEN) |
This file contains 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
cmake_minimum_required(VERSION 3.16) | |
project(eosio.token) | |
find_package(blanc) | |
include(EosioWasmToolchain) | |
add_contract(eosio.token eosio.token src/eosio.token.cpp) | |
target_include_directories(eosio.token PUBLIC include) |
This file contains 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
cmake_minimum_required(VERSION 3.16) | |
set(CMAKE_DEPENDS_USE_COMPILER FALSE) | |
project(eosio.token) | |
set(CMAKE_CXX_COMPILER_TARGET wasm32) # This option is important | |
set(CMAKE_EXECUTABLE_SUFFIX_CXX .wasm) # Set this or set the target name with .wasm suffix | |
add_executable(eosio.token src/eosio.token.cpp) | |
target_include_directories(eosio.token PUBLIC include) |
This file contains 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
import { Serialize } from 'eosjs'; | |
const types = Serialize.createInitialTypes(); | |
const nameToUint64 = (name: string): string => { | |
let ser = new Serialize.SerialBuffer(); | |
ser.pushName(name); | |
return types.get('uint64').deserialize(ser); | |
}; |
This file contains 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
#!/bin/bash | |
# | |
# This script merges all submodules into the main repository. | |
# You need to put this file in the parent directory or home directory, | |
# but run in the repository directory. | |
# Otherwise, this file will be included in your repository. (or, add merge.sh to .gitignore) | |
# | |
# $ ../merge.sh | |
if [[ ! -z $(git submodule status --recursive | grep "^[+\-]") ]]; then |
This file contains 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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.4.22 <0.7.0; | |
contract ERC20 { | |
string public name; | |
string public symbol; | |
uint8 public decimals; | |
uint public totalSupply; | |
mapping(address => uint) balances; |
This file contains 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
function timestampToDate(UNIX_timestamp) { | |
let a = new Date(UNIX_timestamp * 1000); | |
let months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; | |
let year = a.getFullYear(); | |
let month = months[a.getMonth()]; | |
let date = a.getDate(); | |
let hour = a.getHours(); | |
let min = a.getMinutes(); | |
let sec = a.getSeconds(); | |
let time = date + ' ' + month + ' ' + year + ' ' + hour + ':' + min + ':' + sec ; |
This file contains 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.22 <0.7.0; | |
import "remix_tests.sol"; | |
import "remix_accounts.sol"; | |
import "../ERC20.sol"; | |
contract ERC20Test is ERC20 { | |
string testName = "MyToken"; | |
string testSymbol = "MTN"; | |
uint8 testDecimals = 2; |
This file contains 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/eosio.hpp> | |
#include <eosio/asset.hpp> | |
using namespace eosio; | |
using namespace std; | |
class test: public contract { | |
public: | |
using contract::contract; |
NewerOlder