Questions tagged [smart-contract]

Anything related to decentralized application (dApp) development, concepts, and possibilities with smart contracts, or technical questions for the development of smart contracts.

Filter by
Sorted by
Tagged with
1 vote
1 answer
106 views

Is there any fallback function in smart contract similar to Ethereum?

In example dice at contracts directory, alice/bob should set permission to dice account for transferring EOS token from alice/bob to dice. alice dice contract eosio....
ofo's user avatar
  • 320
2 votes
1 answer
1k views

How to get block info (e.g. block hash code) in smart contract?

I want to use action context information, such as block hash code, to generate number as "random" numbers in smart contract. But I can't find any interface to get block hash code.
ofo's user avatar
  • 320
4 votes
1 answer
665 views

How to set "deep structures" for Smart Contracts Tables?

I have a table that I'm playing with that I want to have a map that links the id with a specific structure. I tried to use map and the code compiles fine, but when generating the abi file it takes ...
Leo Ribeiro's user avatar
  • 3,023
9 votes
2 answers
951 views

Is there any method to remove a useless contract from the blockchain just like "selfdestruct" in ETH?

As I know, in ETH, when a contract would be useless, it could be destroyed by using the "selfdestruct" action. So, is there any same method to remove a useless contract from the eos blockchain?
Harry Ma's user avatar
  • 555
3 votes
5 answers
770 views

Cryptographic Operations in Smart Contracts?

Is it possible to perform cryptographic operations inside a smart contract? I'm specifically thinking about simple hashing (SHA-1/256/3) and symmetric encryption (AES). Obviously, handling key ...
John Haager's user avatar
  • 1,844
9 votes
2 answers
640 views

Which version of C++ can I use in smart contracts?

Which version of C++ can I use to implement smart contracts? For example: C++11, C++14 or C++17? Do we have any constant or doc where it is defined? Also, in my understanding the code is sandboxed, ...
Danail's user avatar
  • 536
12 votes
1 answer
2k views

What is the purpose of `require_recipient`?

I saw the description of the function require_recipient and it says: Add the specified account to set of accounts to be notified I would like to understand what's the purpose of receive this ...
Leo Ribeiro's user avatar
  • 3,023
3 votes
1 answer
55 views

When would the branch "native-contract-debugging" be merged to the master?

I've gotten a message that there would be a better method to debug a custom contract from Telegram. This would be implemented in the branch "native-contract-debugging" which would be merged to the ...
Harry Ma's user avatar
  • 555
6 votes
2 answers
328 views

How is the total available capacity (ram/cpu/bandwidth) communicated among block producers

The token model section of the eos.io white paper states: Block producers publish their available capacity for bandwidth, computation, and state. This is a bit vague and I am trying to answer a ...
Vlad's user avatar
  • 885
8 votes
1 answer
925 views

How to use two secondary keys as a filter? (WHERE f1 AND f2)

In the contract multi index tables we can filter by the primary key or we can just create an indexed_by as an additional index. Then we have basically two options: filter by the primary key or ...
Leo Ribeiro's user avatar
  • 3,023
5 votes
1 answer
54 views

What's the difference between register() and claimAll()?

I'm using MyEtherWallet to register/map the EOS key. The steps suggests to use register() function, however in another tutorial I've seen it's using claimAll() function. So, I'd like to know the ...
kenorb's user avatar
  • 889
16 votes
2 answers
3k views

How to read tables from other smart contracts?

I tried to look for inside the EOS repository and contracts examples but I could not find anything like this. I want to know how can I read another contract table. So, as an example: my contract ...
Leo Ribeiro's user avatar
  • 3,023
9 votes
2 answers
2k views

How to validate if an Account exists?

I know that we have require_auth to check for permission, but I'm looking for something like is_valid_account to check if the account exists and is active in the chain. Do we have anything like that?...
Leo Ribeiro's user avatar
  • 3,023
3 votes
1 answer
136 views

Error 3030002 when trying to set contract steps

I'm following steps from exchange-tutorial-python's README file inside the Docker container: $ docker run -it eosio/eos # nodeosd.sh 2>/dev/null & # cleos wallet create Creating wallet: ...
kenorb's user avatar
  • 889
11 votes
1 answer
975 views

What are naming rules for actions, tables and contracts?

Since strings internally are converted to uint64 for space efficiency on the eos.io blockchain what are the restrictions that need to be followed for: actions tables index identifiers (within ...
Dallas Johnson's user avatar
7 votes
1 answer
371 views

Developing Smart Contracts with Docker

If I have the eos chain running in a Docker container, how can I interact with it from my local file system? I would love to be able to create my contracts, compile them, and deploy to my docker ...
cipherz's user avatar
  • 201
9 votes
1 answer
115 views

Issue a transaction on a foreign blockchain

What is the correct way to send a transaction to the bitcoin blockchain from an EOS smart contract. Can anyone provide a code example ?
Evandro Lorenzoni's user avatar
28 votes
3 answers
576 views

Is there a standard for naming and formatting that EOS projects should follow / EOS C++ coding style?

Coming from other C++ projects like Unreal Engine I was surprised to see coding standards in the EOS codebase is all lowercase, not only for variables but even for class names. Is there any resource ...
Soleone's user avatar
  • 674

1
9 10 11 12
13