All Questions
Tagged with contract or smart-contract
618 questions
0
votes
1
answer
283
views
How to parse json string in contract?
My contract want to receive transfer with memo in json format, is there any libraries supporting the json parse?
0
votes
1
answer
145
views
What is the ledger in EOS?
When I create a smart contract, e.g: game. what does the ledger store? (EOS tokens, or heathy points, level of user).
If the ledger stores heathy points, level, so how I can push it into block (...
0
votes
1
answer
93
views
I would like to make listener contract
I would like to make a contract, wich listens to the incoming transfers.
How do I make a listener contract, wich listens to incoming transfers on the account?
1
vote
1
answer
144
views
Authorization flow in dapps
How authorization works in EOS dapps? I mean in application layer. For example in a trello like application how we manage to just the participants in the project are able to see the tasks?
0
votes
1
answer
75
views
Adding Ricardian Clause
I am new to eosio and so far I have been learning using EOS Studio. I have come to the point where I would like to be able to write some Ricardian Clauses in the abi file but EOS Studio does not seem ...
1
vote
1
answer
154
views
Smart contract error while calling recover_key
Specs
I am using the function recover_key from the library crypto.h at the following link: https://github.com/EOSIO/eos/blob/master/contracts/eosiolib/crypto.h
Code
int compressed_size = ...
0
votes
1
answer
45
views
What is the eosio private key when running on local?
I was trying to test the smart contract I created in my local but I am currently blocked as I can't create a new account. As per EOS documentation, I used the command below to create a new account:
...
0
votes
1
answer
101
views
Generate random numbers in the smart contract
I am writing smart contract and stucked on this line :
int p = 0;
p = (rand() % 997);
This is giving error
error: use of undeclared identifier 'rand'
I do search and got some reference links but ...
2
votes
1
answer
191
views
Is it possible to deploy contract via curl?
Using command line i am deploying smart contract "eosio.token".
cleos -u http://127.0.0.1:8888 set contract eosio.token ./eosio.token -p eosio.token
Is it possible to deploy smart contract using ...
0
votes
1
answer
22
views
Alternative to std::ifstream for eosio contract
I'm watching for an alternative to "std::ifstream" because "#include " can't include as header in a contract.
My code is:
std::istream& operator>>(std::istream& str, ...
3
votes
1
answer
320
views
Deploy Contract from browser using eosjs
so I would like to deploy an EOS contract using eosjs. I encountered several problems (especially with converting the .abi and .wasm files).
All the examples either use node (so fs is available) or an ...
1
vote
1
answer
625
views
How to solve !action_type.empty(): Unknown action hi in contract hello?
I am following this doc: https://developers.eos.io/eosio-home/docs/your-first-contract.
This is the hello.cpp contract code which is successfully deployed:
#include <eosiolib/eosio.hpp>
#...
2
votes
2
answers
334
views
A possible alternative sign in/login process instead of firebase auth / amazon cognito using an eos contract?
I had the the idea of a secure alternative login process using an EOS smart contract instead of firebase or Amazon cognito. I would like to know if something like this feasible?
My idea is somewhat ...
3
votes
1
answer
453
views
How can I generate an ABI out of a wasm?
Currently I've written a Rust program to print "5" and converted the same into wasm using the rust tool (target add wasm32-unknown-unknown). I want this wasm to be executed on the local ...
1
vote
1
answer
504
views
How to use recover function in crypto.hpp to verify signature and public key
I want to sign some data in client using eosjs-ecc.sign() and result is a string like "SIG_K1_KcTmv..." I want to use the
recover_key(const checksum256* digest, const char* sig, size_t siglen, char*...
1
vote
1
answer
484
views
Transfer tokens inside a smart contract from an account to another account
I need to write a simple function that would send tokens using a different account action. Exactly the same situation as in these questions: one and two
But I have to use not eosio.token contract but ...
0
votes
1
answer
244
views
Token transfer missing_auth_exception
{
"code":500,"message":"Internal Service Error",
"error":{"code":3090004,"name":"missing_auth_exception",
"what":"Missing required authority",
"details":[{"message":"missing authority of thomsoimj21","...
2
votes
2
answers
179
views
How do tokens that pay dividends work?
If a token is created as a standard eosio.token, what are some approaches for paying out dividends to token holders?
3
votes
1
answer
184
views
Execute get_supply function within contract
I want to execute get_supply from currency.hpp.
Here is the definition:
asset get_supply( symbol_name symbol )const {
accounts t( _contract, symbol );
return t.get(symbol).balance;
...
0
votes
1
answer
89
views
Is there a way to mark accounts like give an account a property value?
Let's say I'm making a game character and each eos account is a unique character. Is there a way to mark an account with different properties like strength, speed, durability, etc....
2
votes
1
answer
124
views
How to setup action access control?
Let's say contract-A has a couple of actions defined. If access to one of the contract-A's action, say action1(), needs to be controlled on account basis, how to do it?
For example, only few ...
1
vote
1
answer
82
views
Smart contract compiling loop
When I try to compile the contract the process creates an infinite loop. Here is my code, please help!
kjnjrwsyxszg.cpp
#include "kjnjrwsyxszg.hpp"
void kjnjrwsyxszg::create(const name owner,...
0
votes
1
answer
57
views
Immutable smart contract
In EOS, smart contracts can be updated by the account owner.
This could be a problem for certain applications in finance. For instance, if I want to deploy a token, the transfer function should be non-...
0
votes
1
answer
162
views
What should I do to specify an optional action parameter for cleos?
I wrote an action that has an optional parameter, as something like:
[[eosio::action]] void foo(..., const std::optional<name>& recipient);
Then in the generated .abi, it is represented as:...
2
votes
1
answer
405
views
Why does using available_primary_key() as scope for a table result in this behaviour?
Scenario:
Two tables, each using uint64_t as a primary key
Table A rows need to reference rows in Table B
Why? Relational database data duplication reasoning etc etc
Both table's primary keys are ...
0
votes
1
answer
77
views
EOSIO failed when using Smart Contract Action with updated Parameters
I deploy a Smart Contract first time and the action becomes usable as it's supposed to be, but when Action's parameters is updated with a new one between existing p1 and p2 old parameters (result: p1, ...
2
votes
1
answer
160
views
Execution order of actions
I want to implement "continious minting" which means first I should call issue, and only then transfer.
My contract has a functionality of eosio.token . I call create to create my token with ...
0
votes
1
answer
49
views
How to get name of account which is processing action recent in contract?
I need to authorize with admin table of contract. but I could not account name which is processing action of contract. Let me know about any eos function to get account name, if anyone know well.
...
1
vote
1
answer
81
views
I have doubts about intercontract communication
I have read that:
In order to call an inline action, that is to call an action of contract A from contract B, there is a need to set some special permission. In this case, the Ram payer for the ...
1
vote
1
answer
51
views
Profiling EOS.IO smart contract code
What's the best way for profiling the code of an EOS.IO smart contract?
I'd like to know what percentage of the CPU time is spent on executing each function\line (including multi index table function ...
0
votes
1
answer
74
views
Does EOSIO Have Native Contracts Built-Into Protocol Layer?
On the Bitshares site I read https://bitshares.org/technology/industrial-performance-scalability
Based upon the lessons we learn from LMAX, we know that a virtual machine for a blockchain should be ...
1
vote
1
answer
48
views
Eos-sharp jungle Error 3090003 when trying to call external smart contract
I’m trying to achieve something quite simple.
I try to call eosio.token transfer from one of my smartContract (lomtaxjungle dopurchase), but after severals days i still don’t manage to do it.
From ...
1
vote
2
answers
242
views
How to pass a map into an action
I'm trying to pass a map into action, but there is serialization error:
Error: expected object containing data: undefined
There is a function signature:
void init(uint64_t id, const map<uint8_t, ...
0
votes
2
answers
92
views
Ico smart contract update
I would like to update this code, because it is CDT 1.2.
I would like to update for CDT 1.5 or CDT 1.6.
What do I need to change?
#include <eosiolib/eosio.hpp>
#include <eosiolib/currency....
0
votes
1
answer
69
views
Declare custom structs
I am trying to create a custom struct called Student in a contract. Where do I declare or define the struct? I tried to define it in the abi file, but the file was over written when I compile the ...
0
votes
1
answer
100
views
Get table row count or property from the last row
As I said I need to get the count of rows in a table. Preferly via rpc with http plugin or from a new action inside the Smart Contract.
This is my Smart Contract:
#include <eosio/eosio.hpp>
...
0
votes
1
answer
257
views
EOS Blockchain How to free up RAM or optimize Smartcontract
We have developed a small program that uses the EOS blockchain and we are storing some of our data in an EOS smart contract. Together with a UUID we are storing the object status. Our goal is to have ...
0
votes
1
answer
94
views
Cleos set contract, Internal Service error timeout_exception
I am running EOS on my laptop.
If I execute the "cleos set contract" command and the contract size is more than 200kb, I get an error:
error 2021-06-01T17:44:30.084 http-1 http_plugin.cpp:...
2
votes
2
answers
879
views
How to free up used memory
I have this picture for my account
memory:
quota: 220.4 KiB used: 207.5 KiB
I want to free the memory and sellram. Is it possible, and if yes, how to do that?
0
votes
1
answer
73
views
What is the maximum size of smart contract?
I'm developing a smart contract and yesterday I couldn't deploy it into testnet with error:
root@698a02be20d9:/# cleos --verbose set contract myaccount /work/mycontract -p myaccount@active
Reading ...
1
vote
1
answer
101
views
Contract transaction cannot be found after i get result of pushSignedTransaction
I've send a contract trans on mainnet use eosjs@20, and i've tried for 4 times, every time i get a trans result, but all of them seemed been drop, i cannot find them on explorer or on chain, can any ...
1
vote
1
answer
1k
views
Duplicate symbol WASM compilation error when using header/hpp for contract
I'm looking to use a hpp file as an interface for multiple contracts. I've created a test contract and receiving a WASM compilation error. I based the test contract on the format used by eosio.token....
2
votes
1
answer
127
views
Reclaim RAM for dApp that creates an account and transfers funds
A dApp that creates a new account and transfers EOS to that account will have to 'pay' for 240 bytes of RAM for the new balance object on the new account. When the new account transfers some funds, ...
2
votes
1
answer
212
views
Send same action as `cleos push action hello hi ...` in smart contract tutorial
I finished smart contract tutorial, and it worked well.
Now I'm trying to send same action as cleos push action hello hi '["bob"]' -p user@active in tutorial by using RPC API, cause need to implement ...
2
votes
1
answer
227
views
ABI File To Communicate With Unity Game Engine
So I'm building an HTML5 Unity game that will run in an internet browser attached to the Interplanetary File System. Unity allows for JSON files to be used to send and receive binary data between ...
3
votes
1
answer
287
views
What is the reason for appearance of "misaligned reference"?
I have written a big contract with a lot of template functions and can find a place, which causes
2018-11-19T08:14:11.454 thread-0 binaryen.hpp:608 translate_one ] misaligned ...
0
votes
1
answer
40
views
Error when setting eosio.bios contract
I am instantiating a new EOS network for a private blockchain. When the bios node executes cleos set contract eosio /contracts/eosio.bios -p eosio -x 1000 I get the following error. How can I fix ...
0
votes
2
answers
58
views
How check deferred transaction logs on EOS jungle testnet?
As I working on jungle testnet and perform a 1 deferred transaction with some scheduled automatic time. But I failed to see transaction logs on the jungle testnet.
Can any please guide me here with ...
1
vote
1
answer
126
views
Can a smart contract perform actions on a scheduled delay indefinitely?
I am pretty new to working with EOS, so please excuse my ignorance and improper terminology.
I am trying to repeatedly excecute a given action on a set time delay. For example, trying to submit a ...
0
votes
1
answer
42
views
Caller of action detail in code
I need to check Account of caller action ,as in ethereum we have a concept of msg.sender to get the caller eth_address, similar is there a way to get caller of action details in EOS.