pinknetworkx / atomicassets-contract Goto Github PK
View Code? Open in Web Editor NEWSmart Contract of the AtomicAssets standard.
License: GNU Lesser General Public License v3.0
Smart Contract of the AtomicAssets standard.
License: GNU Lesser General Public License v3.0
I deployed the contract on a dev blockchain with the same code atomicassets
account currently has on the WAX blockchain, set permissions for @eosio.code
authorization and triggered the init
action. After that most actions work as expected, but when I trigger transfer
without the authorization from asset's collection's author, it fails with missing_auth_exception
and demands that authorization.
What can cause such behavior?
I want to request a new type of Point
in the specification that follows the rfc 7946 standard
Simply [43.356, 24.456]
see: https://geojson.org/
The use case is for geo-dapps (like cXc.world) This allows people to attach geographic information to NFTs, and opens up the possibility to filter by proximity (in Postgres its STDistance function) and also further geopolitical information (Nation, slosest city, etc) can be extrapolated from this information which may be useful to dapps in the future.
Personally, I don't think this should be an option on the site for everyone, but it could be. You could even allow people to pick this point on a map.
Perhaps it doesn't seem like this is a "sought-after" use case, but I believe we're moving towards more geo-aware dapps in the future, so could be a first-mover advantage.
assertion failure with message: datastream attempted to read past the end
{
"code": 500,
"message": "Internal Service Error",
"error": {
"code": 3050003,
"name": "eosio_assert_message_exception",
"what": "eosio_assert_message assertion failure",
"details": [
{
"message": "assertion failure with message: datastream attempted to read past the end",
"file": "wasm_interface.cpp",
"line_number": 1075,
"method": "eosio_assert"
}
]
}
}
I receive this error when trying to transfer the asset to another account using the transfer
function.
I am using EOS Studio with the default (docker) configuration used in the Wax Blockchain docs here.
Please help if anyone knows about this issue.
Is there documentation to show how to call an authenticated action (createcol, mintasset, etc)?
Could you provide clarification or documentation on how this is accomplished?
Thank you.
I have had the confirmation of transaction for the bitcoin elite nft 25 min ago but now it is not in my inventory.
Why?
This one works:
/*
This file is not used for the actual atomicassets contract.
It can be used as a header file for other contracts to access the atomicassets tables
and custom data types.
*/
#pragma once
#include <eosio/eosio.hpp>
#include <eosio/singleton.hpp>
#include <eosio/asset.hpp>
using namespace eosio;
using namespace std;
namespace atomicassets {
static constexpr double MAX_MARKET_FEE = 0.15;
static const name ATOMICASSETS_ACCOUNT = name("atomicassets");
//Custom vector types need to be defined because otherwise a bug in the ABI serialization
//would cause the ABI to be invalid
typedef std::vector <int8_t> INT8_VEC;
typedef std::vector <int16_t> INT16_VEC;
typedef std::vector <int32_t> INT32_VEC;
typedef std::vector <int64_t> INT64_VEC;
typedef std::vector <uint8_t> UINT8_VEC;
typedef std::vector <uint16_t> UINT16_VEC;
typedef std::vector <uint32_t> UINT32_VEC;
typedef std::vector <uint64_t> UINT64_VEC;
typedef std::vector <float> FLOAT_VEC;
typedef std::vector <double> DOUBLE_VEC;
typedef std::vector <std::string> STRING_VEC;
typedef std::variant <\
int8_t, int16_t, int32_t, int64_t, \
uint8_t, uint16_t, uint32_t, uint64_t, \
float, double, std::string, \
INT8_VEC, INT16_VEC, INT32_VEC, INT64_VEC, \
UINT8_VEC, UINT16_VEC, UINT32_VEC, UINT64_VEC, \
FLOAT_VEC, DOUBLE_VEC, STRING_VEC
> ATOMIC_ATTRIBUTE;
typedef std::map <std::string, ATOMIC_ATTRIBUTE> ATTRIBUTE_MAP;
struct FORMAT {
string name;
string type;
};
struct collections_s {
name collection_name;
name author;
bool allow_notify;
vector <name> authorized_accounts;
vector <name> notify_accounts;
double market_fee;
vector <uint8_t> serialized_data;
uint64_t primary_key() const { return collection_name.value; };
};
EOSIO_REFLECT(collections_s, collection_name, author, allow_notify, authorized_accounts, notify_accounts, market_fee, serialized_data);
typedef multi_index <name("collections"), collections_s> collections_t;
//Scope: collection_name
struct schemas_s {
name schema_name;
vector <FORMAT> format;
uint64_t primary_key() const { return schema_name.value; }
};
EOSIO_REFLECT(schemas_s, schema_name, format);
typedef multi_index <name("schemas"), schemas_s> schemas_t;
//Scope: collection_name
struct templates_s {
int32_t template_id;
name schema_name;
bool transferable;
bool burnable;
uint32_t max_supply;
uint32_t issued_supply;
vector <uint8_t> immutable_serialized_data;
uint64_t primary_key() const { return (uint64_t) template_id; }
};
EOSIO_REFLECT(templates_s, template_id, schema_name, transferable, burnable, max_supply, issued_supply, immutable_serialized_data);
typedef multi_index <name("templates"), templates_s> templates_t;
//Scope: owner
struct assets_s {
uint64_t asset_id;
name collection_name;
name schema_name;
int32_t template_id;
name ram_payer;
vector <asset> backed_tokens;
vector <uint8_t> immutable_serialized_data;
vector <uint8_t> mutable_serialized_data;
uint64_t primary_key() const { return asset_id; };
};
EOSIO_REFLECT(assets_s, collection_name, schema_name, template_id, ram_payer, backed_tokens, immutable_serialized_data, mutable_serialized_data);
typedef multi_index <name("assets"), assets_s> assets_t;
struct offers_s {
uint64_t offer_id;
name sender;
name recipient;
vector <uint64_t> sender_asset_ids;
vector <uint64_t> recipient_asset_ids;
string memo;
name ram_payer;
uint64_t primary_key() const { return offer_id; };
uint64_t by_sender() const { return sender.value; };
uint64_t by_recipient() const { return recipient.value; };
};
EOSIO_REFLECT(offers_s, sender, recipient, sender_asset_ids, recipient_asset_ids, memo, ram_payer);
typedef multi_index <name("offers"), offers_s,
indexed_by < name("sender"), const_mem_fun < offers_s, uint64_t, &offers_s::by_sender>>,
indexed_by <name("recipient"), const_mem_fun < offers_s, uint64_t, &offers_s::by_recipient>>>
offers_t;
struct balances_s {
name owner;
vector <asset> quantities;
uint64_t primary_key() const { return owner.value; };
};
EOSIO_REFLECT(balances_s, owner, quantities);
typedef multi_index <name("balances"), balances_s> balances_t;
struct config_s {
uint64_t asset_counter = 1099511627776; //2^40
int32_t template_counter = 1;
uint64_t offer_counter = 1;
vector <FORMAT> collection_format = {};
vector <extended_symbol> supported_tokens = {};
};
EOSIO_REFLECT(config_s, asset_counter, template_counter, offer_counter, collection_format, supported_tokens);
typedef singleton <name("config"), config_s> config_t;
struct tokenconfigs_s {
name standard = name("atomicassets");
std::string version = string("1.2.3");
};
EOSIO_REFLECT(tokenconfigs_s, standard, version);
typedef singleton <name("tokenconfigs"), tokenconfigs_s> tokenconfigs_t;
static collections_t collections = collections_t(ATOMICASSETS_ACCOUNT, ATOMICASSETS_ACCOUNT.value);
static offers_t offers = offers_t(ATOMICASSETS_ACCOUNT, ATOMICASSETS_ACCOUNT.value);
static balances_t balances = balances_t(ATOMICASSETS_ACCOUNT, ATOMICASSETS_ACCOUNT.value);
static config_t config = config_t(ATOMICASSETS_ACCOUNT, ATOMICASSETS_ACCOUNT.value);
static tokenconfigs_t tokenconfigs = tokenconfigs_t(ATOMICASSETS_ACCOUNT, ATOMICASSETS_ACCOUNT.value);
assets_t inline get_assets(name acc) {
return assets_t(ATOMICASSETS_ACCOUNT, acc.value);
}
schemas_t inline get_schemas(name collection_name) {
return schemas_t(ATOMICASSETS_ACCOUNT, collection_name.value);
}
templates_t inline get_templates(name collection_name) {
return templates_t(ATOMICASSETS_ACCOUNT, collection_name.value);
}
};
What is the intended/suggested way to create partial ownership asset?
I think some actions could benefits from extra information.
For example this one the transfer one.
You can get this kind of error
// Error: inline action too big for nonprivileged account atomicassets
And you don't know why easily.
Turns out it comes from this piece of code on EOS.
The value of the max_inline_action_size
can be found here
And you can find even more information about it here
I don't know which level of details you would like to provide as documentation here, but users definitely need to at least know about a max size somewhere in order to easily debug the applications they build on top of your systems.
I would like to request a type of link
that allows links in the following formats
https://www.link.com/
https://www.link.com
www.link.com
link.com
Then the frontend could either display them all like link.com
with the attr set href=https://www.link.com
i have set up my eos studio to work with the wax testnets and have tried to build the zip file from main page here
i am using
the error i get when it builds is this
error: else expression without matching if
0000bd7: error: OnElseExpr callback failed
however it still builds and then gives the same error when i come to deploy it to my testnet account.
i am trying to see if i can get the contract on my acc so i can mint a few on demand assets easier then how i have tried in the past.
thanks for the help. there is no other errors available for some reason
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.