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
2 votes
2 answers
322 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 ...
1 vote
1 answer
486 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*...
0 votes
1 answer
234 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
1 answer
416 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
2 answers
167 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
173 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
81 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
118 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
73 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
52 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
135 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
385 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
67 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
120 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
1 answer
75 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
46 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
23 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. ...
0 votes
1 answer
71 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
43 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
2 answers
87 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
60 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
40 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
187 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
81 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:...
0 votes
1 answer
21 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
75 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
2 answers
787 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
1 answer
90 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
881 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
104 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
207 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
204 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
267 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
2 answers
39 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
107 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
26 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.
0 votes
1 answer
107 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 "...
0 votes
1 answer
26 views

how can my on_notify trigger calls contract actions (permisson issue)

I need to write a contract that automaticaly mint nfts when tokens are being transferred. So i have my : [[eosio::on_notify("*::transfer")]] void logdeposit(name from,name destination, ...
1 vote
2 answers
405 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
0 answers
29 views

General Tips on Smart Contract Development? ( Business Logic + Token )

Currently developing an eosio based token with some semi intricate business logic that frequently modifies aspects of the token contract( staking, supply, etc ) based on a variety of factors including ...
0 votes
1 answer
83 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
1 answer
146 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
1 answer
121 views

How to deploy a smart contract on the mainnet?

I created and tested my smart contract on testnet. Now I want to deploy it on mainnet, I assume I have to purchase some EOS token and buy ram, cpu and net... I can't find anything in the docs about ...
1 vote
1 answer
107 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 <...
0 votes
2 answers
236 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
1 answer
109 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
1 answer
106 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
1 answer
123 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 = ...
0 votes
1 answer
49 views

Nested depth exceeded

kipping set abi because the new abi is the same as the existing abi Publishing contract... Error 3070002: Runtime Error Processing WASM Error Details: Nested depth exceeded pending console output: ...
1 vote
2 answers
51 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
2 3 4 5
13