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
0
votes
0answers
3 views

cdt1.8.1 compile issue

error encountered when compile the contracts with cdt 1.8.1, any idea? /usr/local/Cellar/eosio.cdt/1.8.1/opt/eosio.cdt/bin/../include/boost/pfr/detail/core17_generated.hpp:38:9: error: type 'swaps_row'...
1
vote
1answer
513 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
2answers
287 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 ...
0
votes
1answer
179 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","...
1
vote
1answer
435 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
1answer
253 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 ...
2
votes
2answers
144 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
1answer
163 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
1answer
74 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
1answer
107 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 ...
0
votes
1answer
23 views

Is it allowed to look up tables of another contract?

Imagine if I have an account with contract. Is it allowed for me to look up tables of some another contract from my contract action?
1
vote
1answer
45 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
1answer
17 views

Passing struct as a parameter to smart contract action

I want to save data in the blockchain table whose format is as below: { "docsample": { "id": 1, "creationDate": "2012-05-16T18:25:43.511Z", "...
0
votes
1answer
57 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
1answer
260 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
1answer
73 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 ...
1
vote
1answer
37 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
1answer
67 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 ...
0
votes
1answer
126 views

What is the difference between std::string and eosio::string?

Why should I use eosio::string over std::string? What are the use cases where it would make a difference?
0
votes
1answer
70 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
1answer
24 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 ...
0
votes
2answers
72 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
1answer
31 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
1answer
86 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
1answer
25 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:...
1
vote
2answers
517 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?
1
vote
1answer
57 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
1answer
457 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
1answer
81 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
1answer
169 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
1answer
112 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 ...
0
votes
0answers
11 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, ...
1
vote
1answer
37 views

Amount deposited not being recorded in contract

I'm learning to make my own contract and I'm having a hard time getting LNX that is transferred to the contract to be recorded ad a balance. #include <eosio/eosio.hpp> #include <eosio/asset....
0
votes
2answers
43 views

How to call Wax action in PHP

All of the tutorials on building dApps, they use Javascript and then they tell you how NOT to do it by using your PK to create a signature. So I'd like to use PHP on the backend and grab my key from a ...
3
votes
1answer
249 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
2answers
26 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
1answer
32 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
1answer
64 views

Is there way to retrieve auto incremented primary key after submission of transaction?

I'm working on sample dApp application to understand the working of multi_index table in EOS smart contract. I have defined two multi_index table. The primary key of table1 is auto incremented using "...
1
vote
2answers
343 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
0
votes
1answer
58 views

How to check in my contract the incomming amount?

I would like to check in my contract the incomming amount. I tried these: void mycontract(name from, name to, eosio::asset quantity, std::string memo){ check( quantity.amount > 50, "must ...
0
votes
1answer
44 views

How to Define and use Array of Strings in Struct?

My Sample Struct and its method // Department Table struct [[eosio::table]] department_info { uint32_t ID; std::string deptname; std::string deptcode; std::...
0
votes
2answers
135 views

Use UUID as primary key in multi_index

How can I use a uuid as the primary. struct [[eosio::table]] blackboxdata { name user; std::string uuid; std::string hash; std::string sqlrequest; uint64_t ...
0
votes
1answer
29 views

Traverse multi-index table through non-primary value and delete the record

Below is my smart contract: #include <eosio/eosio.hpp> #include <eosio/print.hpp> #include <eosio/system.hpp> #include <string> using namespace eosio; using std::string; ...
1
vote
0answers
53 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 ...
0
votes
1answer
58 views

Is it possible to see the RAM delta of a multi_index table operation, or see who is currently paying for a row in a table

My question is in the context of smart contract development, so I'm looking for solutions that work within smart contracts: 1st: Is is possible to see the RAM delta of either an individual ...
0
votes
1answer
93 views

read datastream of length 29 over by -4

enum house_status: uint64_t { NEW = 10, FULL = 20, ONGOING = 30, OVER = 40 }; struct [[eosio::table, eosio::contract("game")]] house{ uint64_t id; uint64_t owner_player_id; ...
0
votes
1answer
70 views

multi_index table get const_iterator at a specific position

is there a better way than a loop to get the value/const_iterator at a specific position in multi_index table? current: auto idx = _table.get_index<"name"_n>(); const_iterator b; int count = ...
1
vote
2answers
129 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 [...
0
votes
2answers
60 views

Is there a way to issue tokens infinitely?

I want to design a system where token supply can grow infinitely. Is it possible not to fix total supply at the token creation moment?
0
votes
1answer
35 views

make inline transfer contract and using it on jungle testnet

hello everyone i am faceing a problem on jungle testnet i am trying to make a inline transfer but i got this error after i work with the api_endpoint the code is #include <eosio/eosio.hpp> #...

1
2 3 4 5
12