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
2answers
42 views

Error about billed CPU time when set Hello World Smart Contract

My VM Spec (VMWare ESXI) CPU : Xeon CPU E5-2620 v2 @ 2.10GHz Memory : 8GB HDD : 70GB EOS 1.5.3 , EOS.CDT 1.4.1 Compile from Source Code with AutoBuild Scripts. I try to create first smart contract ...
1
vote
1answer
89 views

Can a deferred transaction make the initial transaction fail

Imagine a user sending me some eosio.token to my contract and when I receive the notification, I start a new deferred transaction that fails later. Can the deferred transaction make the initial ...
1
vote
1answer
52 views

How to get number of users, transactions and volume for a given EOS contract on given day?

I am trying to figure out how to get the number of users, transactions, and volume for any given EOS contract for any given date. Does anyone know how to do this?
1
vote
1answer
69 views

Makefile Compiler Error

I have been using this tutorial from Medium to build my first smart contract. I've come far, finally got a nodeos local node up and running and producing blocks on my Ubuntu VM. I've hit a snag though ...
1
vote
1answer
47 views

Why don't need ram_payer for erase method in mulit_index class?

mulit_index class has three methods (emplace, modify, erase) to update a table. emplace and modify methods need to select ram_payer. But erase method doesn't need to select it. I think these methods ...
1
vote
2answers
148 views

Divide funds by % to send to different wallets

I need a contract that can send funds at 1 time to multiple addresses by percentage. Ex: n disbursements 1@ 20% Another - 14% Another - x% Another - x% and so on. Ethereum does NOT have this ...
1
vote
1answer
67 views

How to check number of std::hash locally?

I can not reproduce hash number of these code at local neither at ubuntu or mac environment. Can anyone tell me how to write a local code that can reproduce the hash result. Below is the code hash ...
1
vote
1answer
162 views

If I issue an EOS token, how do I afford the running fee?

I got a question about how to afford the cost of emplace action... code in eosio.token like : statstable.emplace( _self, [&]( auto& s ) { s.supply.symbol = maximum_supply.symbol; ...
1
vote
1answer
74 views

Private Transactions inside Smart Contract

Is there a way to make some transactions private inside a smart contract? It's needed for a game theoretic model. Like imagine poker on blockchain: you'd like not to reveal cards until some point in ...
1
vote
1answer
110 views

Is there a way to have a 2 dimensional vector in my table?

I can have a string vector by manually changing the type in my abi file to string[] but if I try string[][] I get an ABI error in my node: Error 3015004: The type defined in the ABI is invalid Any ...
1
vote
1answer
60 views

What are the main pros / cons for smart contract development on EOS vs Ethereum smart contracts? [closed]

What are the pros and cons when doing smart contract development when coming from Ethereum? How does one differ in strength and weakness?
1
vote
1answer
57 views

Tutorial on how to load up your own ERC20 EOS token using a template contract.

I have the following template contract: https://github.com/EOSIO/eos/tree/master/contracts/eosio.token Is there a step by step tutorial on what I need to do to load up my own token? What are the ...
1
vote
1answer
166 views

mutable globals cannot be imported: globalImport.type.isMutable

I compile hello.cpp in the examples folder in eosio.cdt version1.3.1, which has a lot of updates compares to version 1.2.X. then completely follow the smart contracts tutorials in https://developers....
1
vote
1answer
209 views

multi_index in eos with AddressBook example

I building AddressBook by link https://developers.eos.io/eosio-home/docs/data-persistence, Dependencies: EOSIO.CDT (Contract Development Toolkit) Version : 1.3.1 Here is my code: #include &...
1
vote
1answer
30 views

About authorities

On eosio.token.cpp, there are transfer function with require_auth(from). So executing this contact needa "from" active permission. For some reason, I change require_auth parameter from "from" to "...
1
vote
1answer
228 views

Cleos cannot find contract directory

I am trying the get started guide but I get stuck in the hello world smart contract. Here is the console log. root@d75d5dde1190:/home/savvas/EOS/contracts/hello# ls hello.abi hello.cpp hello.wasm ...
1
vote
1answer
493 views

Verify user's signature in contract

User A has signed a message msg with signature sig.How can the third party verify this message in a contract? The verify method contract is like this: void verify_user_sig(account_name user,string ...
1
vote
2answers
95 views

contract deployment ubuntu 16.04

I am having issues deploying contracts on a single node test environment. I used the setup scripts and played around with the config.ini file. Everything runs and all the commands at least regarding ...
1
vote
1answer
179 views

Hello contract: How do i execute “hi” action when notified by eosio.token contract of an EOS transfer?

I want to extend the Hello contract (as an exercise) How do i execute "hi" action when notified by eosio.token contract of an EOS transfer ? I understood i have to extend EOSIO_ABI macro to handle ...
1
vote
1answer
184 views

What would happen when a transaction fails because “took too long”?

When call an action of a contract, sometimes meet "Transaction took too long" error. If a transaction fails because of "took too long" error, the transaction will be discarded in chain? Or next BP ...
1
vote
1answer
108 views

Why wouldn't it be good to store lots of data in eos logs instead of smart contract?

'm curious where to save big data. I don't want to save it in my private db and not in ipfs. I want it to be visible on blockchain. So It's visible on blockchain etherscan If I'd go to store data in ...
1
vote
1answer
143 views

Tables and storage issues

Am I right to say that the data stored in a contract are stored as tables and that for every row, we would have to emplace that row to a user, who would then pay for the storage? Or is one particular ...
1
vote
1answer
191 views

Error 30700002: Smart contract's apply function not exported; non-existent; or wrong type

I have written a smart contract and I want to start testing it, it contains an apply function, which currently checks for a transfer, and then calls the appropriate function: void mycontract::apply(...
1
vote
1answer
572 views

Error 3010008: No ABI found

I was able to push the contract to the jungle test net but i am unable to run the contract. i get this error: Error 3010008: No ABI found what am i doing wrong? thanks.
1
vote
1answer
615 views

How to access multi-index from other contract?

Contract A created a multi-index table pets like pets(_self, _self); ... pets.emplace(user1,...); Now in contract B, I would like to update a row like pets(N(A), N(A)); ... pets.modify(pet, user1, ....
1
vote
1answer
140 views

How to get current RAM price inside a contract in C++?

How can I programatically get the current(last) RAM price inside an EOS smart contract in C++? I need to handle the data inside the smart contract for an experiment.
1
vote
1answer
192 views

Working with memory (malloc, etc.) in smart contracts

I'm trying to compile smart contracts written in Rust. So far so good, but when I tried to add memory management contract deployment choked. (type (;0;) (func (param i32) (result i32))) (import "env" ...
1
vote
1answer
319 views

Migrate ERC20 token from Ethereum blockchain to EOS blockchain

How do migrate ERC20 token from the Ethereum blockchain to the EOS blockchain? Or how can I operate (transfer) ERC20 tokens from smart-contract in Ethereum network when using EOS smart-contracts?
1
vote
1answer
573 views

cleos set contract error Unexpected char '60' in “”

Two weeks ago I tried to use cleos subcommands and everything worked fine. I could set contract to the accounts I created using my own smart contract code. Now whenever I tried set contract or create ...
1
vote
1answer
220 views

Allocating CPU and Bandwidth to users of a smart contract

Say if 20 accounts want to run actions against a smart contract however do not possess the CPU and Bandwidth required to complete them, therefore run into errors saying so. How can the dApp ...
1
vote
1answer
425 views

How to create a token using eosio.token contract?

I am trying to follow the tutorial, deployed eosio.token contratc to eosio.token account. I have no problem to do the following: eos.transaction({ actions: [ { account: 'eosio.token', ...
1
vote
1answer
528 views

Where is 'INLINE_ACTION_SENDER' macro defined?

I am trying to use INLINE_ACTION_SENDER to use an action from another contract but get the following error. error: use of undeclared identifier 'INLINE_ACTION_SENDER' How do I include this macro in ...
1
vote
1answer
39 views

Validation for contract which has data which varies

How does the EOS contract system handle data which varies? This could be from using a true random number, or receiving real-world data like a token price. Every time the contract executes, different ...
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 ...
1
vote
0answers
19 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
0answers
12 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
0answers
25 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
0answers
19 views

How to set a eos contract on jungle network [duplicate]

As I trying to deploy a contract on Eos Jungle test network using cmd. But I failed to run. Command : cleos --url https://jungle3.cryptolions.io:443 set contract tulsipadalia addressbook -p ...
1
vote
0answers
23 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
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,...
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 ...
1
vote
0answers
6 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
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 ...
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 ...
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
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
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....
1
vote
0answers
16 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
0answers
21 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
2answers
515 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
6 7
8
9 10
12