All Questions
Tagged with contract or smart-contract
111 questions with no upvoted or accepted answers
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 ...
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 ...
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;
...
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 ...
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?
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 ...
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 ...
2
votes
2
answers
100
views
Is there a way to prevent me spending tokens until an action is called?
I am creating a smart contract but came to a halt when writing the code.
Is there a way, in a smart contract, to prevent me from spending tokens transferred to me by another user through the smart ...
2
votes
0
answers
118
views
Where are deferred transaction errors logged to?
I'm trying to learn about deferred transactions.
I'm creating a bogus deferred transaction that invokes a non-existent action "fakeaction":
transaction out{};
out.actions.emplace_back(...
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 ...
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?
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
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 ...
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
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
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 ...
1
vote
0
answers
38
views
Build existing autoconf C project to include in smart contract
I'd like to include GNU's GMP library in my smart contract project.
It's an autotools/autoconf project, how can I compile it as a standalone webassembly library and then include it in my smart ...
1
vote
1
answer
127
views
How to access data inside multi-index table when using 2D vector / 2D array?
What is going on? :D I write data, but cannot find it after I write it.
The following code successfully emplaces the row into the multi-index table:
See specifically the vector<vector <...
1
vote
0
answers
27
views
getting error when i try to add permission to a user who is signing a smart contract action
here is what i am trying to do :
users will sign a specific action which will take their username, permission_name, smart_contract_name, action_name, public_key
i am trying to assign the user ...
1
vote
0
answers
33
views
How can i update a table by TransactionID? And can transactionId be the same when we update the data?
I am running my nodeos on my local machine, I can retrieve all the data via api and do some CRUD also. I have succeeded update the table by tableId,
But can someone suggest to me how do I update the ...
1
vote
0
answers
47
views
Where are accounts and smart contracts stored?
I'm a bit confused by answers to the following questions:
Where are new accounts stored?
Where is the smart contract is stored
How can everything be stored on RAM at all time? 3KB for each user means ...
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,...
1
vote
0
answers
77
views
Multiple transaction hash collisions on mainnet
There are currently multiple transaction hash collisions in consecutive blocks in EOS as noted below:
7dcdcdb558028c7703faddee96e1aa48e9bbe7cd3a07cd0a74513a3599185b40 at block 10712420 and 10712421
...
1
vote
0
answers
9
views
is there a service that creates EOS or TRX div tokens?
is there a service that creates EOS or TRX div tokens? Or can someone point me in the right direction?
Thank you
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
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
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
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 ...
1
vote
0
answers
28
views
How to retrieve tx object within contract
I'm trying to retrieve tx within contract, but I only can find tx_hash using read_transaction. Anybody can help me?
1
vote
0
answers
27
views
How to view Macro extended code?
I use this command is ok:
eosio-cpp hello.cpp -o hello.wasm
But I want to view Macro extended code by option -E - Only run the preprocessor,
I use this command:
eosio-cpp hello.cpp -E
And get ...
1
vote
0
answers
21
views
How does smart contract development differ between each of the EOS.IO side/sister chains?
Most tutorials that exist for smart contract development are directed at the EOS Mainnet chain. But there are several sister and side chains available, and the number is growing all the time. How does ...
1
vote
2
answers
55
views
How to tell a certain contract in indeed used in a dApp?
The dapp review sites often list the contract names a dapp is using. I see that this is added by whoever has added that dApp into the review site.
But is there a verifiable way (through an explorer ...
1
vote
0
answers
28
views
Hide information in the blockchain
Lets say I want to create a player vs player game with a battlefield and moving armies, the movement and data about the armies and where is it going is put on the blockchain.
My question is how to ...
1
vote
2
answers
207
views
How to get a contract to accept tokens as payment
I keep getting the following error:
transaction declares authority '{"actor":"test2","permission":"active"}', but does not have signatures for it under a provided delay of 0 ms, provided permissions [...
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 ...
1
vote
0
answers
74
views
Get symbol & contract from asset
I currently have an asset property that stores a value, i.e. 100 EOS which could also be another token like 100 TLOS. Is there a way to extract the symbol and possibly the token contract from that ...
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....
1
vote
0
answers
39
views
No tables in abi file
I am trying to write a smart contract but for some reason my tables aren't being added to the abi file and therefore aren't being added to the blockchain.
My code is as follows. Am I possibly ...
1
vote
0
answers
55
views
cannot get latest state of table after modifying table in inline action
As shown with code below, I modify table in an inline action, and then want to get the latest data. But the data I get is not the latest. Why?
void mycontract::myfunc()
{
action (
...
1
vote
0
answers
41
views
Payment to dapp with text comments best practice
I am new in eos, so maybe i say something strange.
I want to create a dapp that can receive payments from mobile wallets with text comments.
I imagine this like front end where user type text and ...
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>
#...
1
vote
0
answers
106
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>
#...
1
vote
0
answers
66
views
Signing a users account contract deployment remotely with a users arbitrary signature
What I am trying to do is deploy a contract on the behalf of the user, by getting them to sign the deployment remotely.
I have been informed that if I get a arbitrary signature on the setcode, I can ...
1
vote
2
answers
422
views
What is the difference between transaction.send and action.send?
I found that there are two types of transfer I can use in an EOS contract, but I don't know what is the difference between them.
1st type
2nd type
1
vote
0
answers
41
views
How to make real time my contract transition history
I want to make real time my contract transition history,Do I have to learn what components of EOS blockchain?
1
vote
0
answers
66
views
How can i prevent another contract call my contract's method?
how can i prevent another contract call my deployed contract? Or how can i know that the caller is an eos account with contract or not.
Thanks.
1
vote
0
answers
46
views
EOS smart contract upgrading/recompiling, variables and symbol mappings
EOS allows to reset the contract code payload, unlike some other blockchains:
https://www.reddit.com/r/eos/comments/91aqjx/how_many_contracts_can_an_account_have_on_the_eos/e2ww4la/
How the code ...
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 = ...
1
vote
0
answers
15
views
Publish a contract using hardware wallet
Is there a way to publish a contract using hardware wallet (ledger preferably) without ever exposing private keys?
1
vote
0
answers
325
views
How to correctly use Docker to run eosio (including eosiocpp)?
I can get the basic quickstart working very easily but when I try to add smart contract I get a lot of conflicts.
I have read an article here claiming - https://medium.com/@ekkis/eos-development-on-...