Phillip Hamnett - EOS42
Moderator
  • Member for 3 years, 8 months
  • Last seen more than a month ago
How to get current time in different versions of EOSIO
Accepted answer
9 votes

Until eosio.cdt v1.6 You could use: eosio::current_time() now() From eosio.cdt v1.6 onwards You have to #include <eosio/system.hpp> and then you can use: eosio::current_time_point eosio::...

View answer
scope in the get table command
Accepted answer
8 votes

Meaning of scope You can just make up a scope as you go along. As a general rule there are 3 ways to use the scope: Globally - all table entries are kept in one scope (usually with the name of the ...

View answer
How to set up a private blockchain using EOS?
Accepted answer
8 votes

Whenever you set up a local testnet node or run nodeos on your home computer, you are creating a new EOS chain. What matters is how you choose to connect it to other nodes to decentralise the system. ...

View answer
How can I see where I'm using my EOS RAM?
7 votes

There is currently no method to know which tables your RAM is sitting in. The only way you could figure this out is to look at everything you ever did, check the code for the smart contracts where you ...

View answer
How to debug eosio::on_notify("eosio.token::transfer") actions?
6 votes

Using the EOSIO_DISPATCH macros disables the automatic inclusion of actions and on_notifys, and assumes that you will deal with them manually. To fix this, you have to remove the EOSIO_DISPATCH macro ...

View answer
What happens when we run out of names
Accepted answer
6 votes

There are 26 letters and 5 numbers available for making standard EOS names, meaning there are = 787662783788549761 possible names available. And that excludes all the non-standard names that are ...

View answer
Is it possible to choose who pays for CPU time?
6 votes

Officially, there is no way to decide. The initial transaction is paid for by the user, all subsequent actions performed by the smart contract are paid for by the smart contract itself. As stated in ...

View answer
Multiple EOS transfers in a single transaction
5 votes

In a smart contract, you could do this by emplacing multiple actions into a single transaction, as follows: transaction transfer; transfer.actions.emplace_back(eosio::permission_level {_self, N(active)...

View answer
Error 3160003: Invalid table iterator
Accepted answer
5 votes

If your table doesn't have any elements, then it will throw this error. Whenever you use the find command, always check afterwards that an element was found: auto element = candidates.find( id ); if(...

View answer
What is eosio.code permission?
Accepted answer
4 votes

The permission eosio.code, gives permission for the contract to use inline actions. You don't need to add anything specific to the source code in order for the permissions on the contract to be valid, ...

View answer
What could be the reason for 'Error 3050008: Abort Called'
Accepted answer
4 votes

Abort Called is usually an indicating of a segmentation violation. So look for things like: accessing elements of a vector or pointer calling new or delete on objects that have already been created ...

View answer
How can I get the balance of my account with smart contracts in cdt 1.6
Accepted answer
4 votes

You need to access the accounts table of the appropriate token contract, in the scope of the token that you want to check the balance for: struct accounts { eosio::asset balance; uint64_t ...

View answer
How Does Round Robin BP Selection Work In EOSIO?
4 votes

Every chain can choose to implement this however they like. On the EOS Mainnet The round robin is deterministic, and cycles alphabetically through each of the block producers. This actually causes ...

View answer
Error message: Exceeded call depth maximum
Accepted answer
4 votes

Reason 1 I guess you forgot to set the "table" to be included in the ABI file. If you are using the old compiler eosiocpp, then add this before your definition of the table struct/class: ///@...

View answer
difference between history plugin and state history plugin
4 votes

I asked my friend Andrew Coutts this question on your behalf, and he said: So the state history plugin is just a piece of the equation. The history plugin exposes the RPC API that we're ...

View answer
Is it possible to see a list of deferred transactions
4 votes

So I found a way to access deferred transactions using the following command: curl NODE_HERE/v1/chain/get_scheduled_transactions --data '{"json":"true","limit":-1}' after this, you would have to ...

View answer
How to register an account on the testnet/mainnet?
4 votes

Before you start You need to generate 2 sets of private and public keys, 1 for the active permission and 1 for the owner permission. If you have access to cleos, you can do this with the following ...

View answer
Meaning of N() function in multi_index
4 votes

The primary key for a multi_index table can not be a string. In general it should be an int. The N() macro converts the contents within the brackets into a uint64_t.

View answer
List of EOSIO related telegram channels
3 votes

General Note: please keep transparent who added which link. General EOS https://t.me/EOSproject Worbli https://t.me/worblicommunity Telos https://t.me/HelloTelos WAX https://t.me/wax_io BOS https://...

View answer
Is it possible to set up a smart contract with multiple .cpp and .hpp files?
3 votes

It is possible: Set up a new smart contract environment using eosio-init: eosio-init -project=mycontract -path=. Create all of your .cpp and .hpp files as appropriate In the ./src folder, edit the ...

View answer
what does the same_payer mean in eosio contract?
Accepted answer
3 votes

It means whomever paid for the RAM originally is still going to be paying for the RAM in the table after this modification. If modification of data consumes more RAM compared to original usage, ...

View answer
assertion failure with message: no balance object found
3 votes

This error message is caused because you are trying to transfer a token that you do not own and have never owned. You have no balance, which is not the same as having a balance of zero. Usually you ...

View answer
Make a transfer inline
Accepted answer
3 votes

The problem is you are trying to transfer tokens, which requires mycontract@active permission. But when you send tokens from within a contract, the permission is mycontract@eosio.code - even if you ...

View answer
How do I set my smart-contract / account to "immutable"?
Accepted answer
3 votes

cleos set account permission MYACCOUNT active '{"threshold": 1, "keys":[], "accounts":[{"permission":{"actor":"eosio.null","permission":"active"},"permission":{"actor":"MYACCOUNT","permission":"eosio....

View answer
Cannot pass arguments to push action in bash script
3 votes

You have to use single quotes to allow these arguments that are within json. Like this: cleos -u https://api-kylin.eoslaomao.com:443 push action user1account create '["'$2'","'$3'"]' -p user1account@...

View answer
Setting a key to NULL
Accepted answer
3 votes

The permission that you would set your account to would not be a key, but would instead be the account eosio.null@active. This is a special permission that can not be used by anybody ever (it has no ...

View answer
Order transactions get mined in
Accepted answer
3 votes

You are right, this is the case in EOS as well. The transactions are ordered First In First Out (FIFO) and this is how the block producers order the transactions by the ID's and the hashes. One ...

View answer
In Eosbetdice contract, in the transfer action, why it is able to emplace a new row in this table?
3 votes

Because it is being paid for by _self, which is always allowed. In general, you can not charge other people RAM when doing transfers, only yourself. You can charge other people RAM when performing ...

View answer
When to use or not use the Contract Scope?
3 votes

The scope can be used to narrow down a table list to contain only some fraction of the total entries available. However, you can also have the best of both worlds if you are willing to pay for the ...

View answer
How is EOS WASM virtual machine hardened?
3 votes

The Web Assembly Website has information on the potential security issues for both users and developers when coding in WASM. With regards to arbitrary code execution in EOS, @confused00 points out ...

View answer
1
2 3 4 5
7