Questions tagged [contract-development]
The contract-development tag has no usage guidance.
23 questions
0
votes
1
answer
164
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
42
views
confusion with contract names and account names in eosio testnet
When writing contracts, the contract class in file name_a.cpp is defined as follows:
class[[eosio::contract("name_a")]] name_b : public contract {..}
In my understanding the name of the ...
0
votes
1
answer
90
views
Using a smart contract table. How can I query a row using another field instead of the primary key id?
How can I query a smart contract table to return a row instead of using the primary key id?
I have the following: https://jungle.bloks.io/account/mybest111111?loadContract=true&tab=Tables&...
0
votes
2
answers
51
views
how to make sure the tx to be included in block
as subject, any way to make sure the tx to be included in block, what i think of is, if the tx meet the condition, then notify the contract to execute the specified action, otherwise notify an account ...
0
votes
1
answer
192
views
Strange checksum256->uint64_t casting
I'm trying to cast checksum256 to uint64_t
Here is conversion code:
uint64_t checksum_to_uint64(const eosio::checksum256 & digest) {
auto checksum_bytes = digest.extract_as_byte_array()....
0
votes
1
answer
124
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
2k
views
call to implicitly-deleted copy constructor
I'm unable to compile a small test contract and am hoping for guidance. I have a class called Account, in the following 2 files:
// --- account.hpp
#pragma once
#include <string>
#include &...
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?
0
votes
1
answer
147
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
0
answers
98
views
When deploying a contract what is important (overall contract/wasm size or amount of functions etc) to not get transaction took too long
when I try to deploy the system.contract I sometimes get transaction took too long with the new eosio version 1.8.1.
Now I would like to know on which part of a contract do I need to pay attention ...
0
votes
0
answers
85
views
env.is_feature_activated unresolvable while setting up eosio.system contract
I am following BIOS Boot Sequence. I want to set up my own private EOS network that's why I am setting up the EOSIO network. at step 1.12 I am not able to set the eosio.system contract it will give me ...
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
1
answer
66
views
template function in contract code with a lambda
This is more a C++ question than EOS contracts question but I am having trouble creating a template function for migrating tables to a different scope. I cannot get this to compile.
template <...
1
vote
1
answer
177
views
no member named 'check' in namespace 'eosio'
I am trying to build a contract and receiving this error:
In file included from /usr/opt/eosio.cdt/1.6.1/bin/../include/eosiolib/contracts/eosio/system.hpp:6:[0K
/usr/opt/eosio.cdt/1.6.1/bin/../...
1
vote
2
answers
51
views
How do I confirm that the person sending an action is the same as a user in the parameter?
Specific example from a contract:
...
void hi(name user){
// verification here, require_auth(user)?
print(user);
}
...
I've tried require_auth(user) but that seems to always fail unless the user ...
0
votes
0
answers
274
views
Regex validation on smart contracts
Is is possible to use regex validation in a smart contract?
2
votes
1
answer
142
views
fatal error: 'future' file not found
I want to write a contract by using CPR library. Unfortunately I have an error:
fatal error: 'future' file not found
#include <future>
I am using EOSIO cdt v1.5.0 on Ubuntu 18.04.
I had the ...
1
vote
1
answer
83
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 ...
2
votes
1
answer
138
views
How to send a data from on contract to other?
https://developers.eos.io/eosio-home/docs/sending-an-inline-transaction-to-external-contract
In above tutorial, I can see that 'addressbook' send notofication message to 'abcounter', but the data(...
0
votes
2
answers
109
views
EOS CDT: where are the *.h and the *.cpp files stored in the filesystem, I need reference to them to compile
I'm trying to use the EOS CDT (contract development toolkit).
I've downloaded and installed the repository from github, and used to following commands, as indicated from the eos.io development page.
...
1
vote
1
answer
146
views
In the eosio.token contract, why are the structs private?
In my contract, I'd like to be able to check how much EOS an account has.
For that, I'd write some C++ code like this:
token::accounts the_table("eosio.token"_n, "useraccount1"_n.value);
auto it = ...
3
votes
1
answer
505
views
Why smart contract function fails with "Error 3090004: Missing required authority"?
WHAT I WANT
From the contract mycontract I want to call a function function1.
The function function1 calls another function of mycontract called function2. The function function2 calls an action of ...
2
votes
1
answer
195
views
Are EOS smart contract self executing? Can a contract monitor an external API call from a weather site and send a transaction if it's sunny?
Ethereum contracts require someone to execute the contract and are not self aware. Are EOS contracts self executing if some external thing happens like the weather changing when detected from a ...