Phillip Hamnett - EOS42
Moderator
  • Member for 3 years, 8 months
  • Last seen more than a month ago
CPU-Usage Optimization
1 votes

Is this CPU-billing-scheme still in use? To the best of my knowledge, yes Points 2. and 3. My understanding of CPU billing works is as follows: A BP receives your transaction, starts a timer, ...

View answer
Ricardian Contract
Accepted answer
1 votes

Everytime you update the ABI file, a record is stored on chain. The action is eosio::setabi. Therefore it would be possible to say which version of the ABI file was current on the blockchain at the ...

View answer
Creating a base contract with (virtual?) base methods that can be overriden
1 votes

I did a fair bit of experimenting and I found a way where inhering within the contract class (sort of) works. Although it doesn't allow for the actions from one contract to be used in another, it does ...

View answer
Should a contracts class be labelled `public contract` or `public eosio::contract`
Accepted answer
1 votes

If you specify the optional string arguments (as in addressbook), then you are saying that the contract name on chain should be called "addressbook", regardless of the class names being used. It ...

View answer
Difference between EOS transaction "traces" and "trx"
1 votes

A trx contains a list of actions that were submitted to the blockchain along with the execution status. A trace shows each inline action called by the actions from the trx. There are other differences ...

View answer
BUG when two accounts send action at the same time to modify multiindex table
1 votes

If I understand correctly, and your code is implemented correctly, this can only happen in the case of a fork in the chain. Correctly implemented code would look something like this: auto itr = ...

View answer
What is the role of a claimer key in eosio account?
1 votes

So this is presumably in reference to the various tutorials that show how to set up a claim permission on a block producer account. The owner key is the main key which determines who owns an account. ...

View answer
require_auth() not working as expected
1 votes

If several users need to be able to use this function, but they have to authorize themselves to use it, then you would write your function as follows: ACTION doctest1::hashin(eosio::name user, std::...

View answer
Search multi_index by nonprimary key
Accepted answer
1 votes

So you have to do two things: Set up name as a secondary index Get that index, which can then be used with the find command. Unfortunately, the string type can not be used for secondary indices, ...

View answer
How to convert a public key string to a eosio::publickey object inside a smart contract?
1 votes

You would do it as follows: eosio::public_key string_to_public_key(unsigned int const key_type, std::string const & public_key_str) { eosio::public_key public_key; public_key.type = key_type; ...

View answer
fatal error: 'future' file not found
1 votes

It isn't possible to use future in smart contracts, because the whole thing is single-thread C++. Multithreading isn't supported and wouldn't work within the contract because it would potentially make ...

View answer
centos 7 mainnet fullnode disk read overload
1 votes

I'm not an expert in nodeos, but in the config file I see: # mainnet filter-on = eosio:: filter-on = kofoatomicsw:: filter-on = eosio.token:: To me, this indicates that you should record all actions ...

View answer
Example of resource staking from contract
Accepted answer
1 votes

You would fill this part of the code in with the relevant action for delegatebw: eosio::asset quantity(1,eosio::symbol("EOS",4)); action( eosio::permission_level(eosio::name(get_self()),...

View answer
How to stop receiving EOS token from another account?
1 votes

Yes. You can freeze your contract by creating a multi_index table that indicates whether the account is frozen or not. When a token is received, you can assert on whether the account is frozen or not....

View answer
How to list all balances of tokens managed by an eosio.token contract?
Accepted answer
1 votes

The only way to do it with a standard eosio.token contract would be to use something like the state_history_plugin to see which accounts had the open command used on them, and then write a script to ...

View answer
Is it possible to use multi_index on property of a struct in a struct?
1 votes

Yes this is possible, the devil is in the details though. You have to make sure that you correctly serialize both structs, and that you set up the secondary index for the 2nd struct ID correctly in ...

View answer
How to detect an account is a contract account or not
1 votes

Unfortunately, this isn't possible at the moment. The best you can do is have an oracle that keeps track of this information and query a table from the oracle, however this isn't guaranteed to work as ...

View answer
How to publish an auditable EOS Smart Contract in a trustless way?
Accepted answer
1 votes

If the developer makes the code public, then you can compile it using eosio.cdt, and then compare the SHA256 hash to the one stored on chain. The one on chain can be accessed using: cleos get code ...

View answer
About Updation of contract
Accepted answer
1 votes

You can update your contract to change who will pay for RAM in tables, but it will only affect the RAM-payer going forwards from this point in time. Whoever paid for RAM until now will continue paying ...

View answer
Is it possible to call "updateauth" to change account keys from within a smart contract?
1 votes

Yes, it is possible. The action is in native.hpp in the eosio.system contract from eosio.cdt repository: [[eosio::action]] void updateauth( ignore<name> account, ...

View answer
Is is possible to defer a non abi action using a abi action?
Accepted answer
1 votes

It isn't possible to call a non-ABI action in the way you want. Only something in the ABI can be called in a transaction, whether it is deferred or not.

View answer
How can you make sure you know what the contract does when you send an action?
1 votes

You can do an SHA256 of the .wasm code to see its hash, and you can verify that on chain by doing cleos get code ACCOUNT_NAME. So it wouldn't be very difficult to write a script to check that the hash ...

View answer
How do I use C++11 on Mac?
1 votes

To use this syntax, you need to be compiling with the latest version of eosio.cdt. When you build and compile eosio.cdt, it will install the appropriate clang compiler for you, and eosio-cpp will be ...

View answer
Does permission_level (_self) means that only contract can use this method?
1 votes

Correct, it means only the account on which the contract resides can call this action. In general, _self refers to the instance of eosio::name that contains the account name where the contract resides

View answer
Asset instantiation woes
Accepted answer
1 votes

An asset must be expressed in terms of an integer, even if the asset itself will have decimal points. Therefore asset a(1, symbol("EOS", 4)); refers to the smallest possible positive amount of EOS ...

View answer
CPU for transaction on my own node
1 votes

No, it wouldn't help you. Only the block producer who processes your transaction will determine how much you are billed for your CPU, and this is always done on your account. it is one of the reasons ...

View answer
Waiting for staking
1 votes

The wait time for CPU and BET bandwidth to reset is 24 hours, not 72 hours. You have to stake EOS to your account in order to use it. CPU allows you to perform actions and NET is for transferring of ...

View answer
Is it secure to use keosd in an aws to let dapp/app server sign transaction?
1 votes

This method would work, but it would only be as secure as your server, as you would need to keep the private key in plain text format, so anyone who could access the machine could sign transactions. ...

View answer
What's the key_names and key_types mean?
1 votes

The key_names is a list of the primary key and all the secondary keys. The key_types is the type of each of the respective keys. In a simple table (only a primary key), the type is always uint64 or ...

View answer
Is there a EOS pegged token for Bitcoin or Ethereum or Monero?
Accepted answer
1 votes

Dice announced in December that they would create pegged EOS tokens for Bitcoin, Ethereum, and USDT. In their announcement, they said: The user deposits the corresponding currency into a specific ...

View answer
1 2 3
4
5
7