GithubHelp home page GithubHelp logo

game-x-coin / gxc-contracts-v1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eosio/eosio.contracts

5.0 5.0 0.0 2.13 MB

Deprecated - GXC blockchain platform contracts

License: MIT License

CMake 0.53% Shell 0.11% C++ 18.44% WebAssembly 72.60% Objective-C 0.06% C 7.67% Makefile 0.45% Roff 0.14%

gxc-contracts-v1's People

Contributors

0xgabii avatar abourget avatar arhag avatar b1bart avatar brianjohnson5972 avatar bytemaster avatar conr2d avatar deniscarriere avatar elmato avatar eun2ce avatar heifner avatar igorls avatar jgiszczak avatar kesar avatar larryk85 avatar moskvanaft avatar robertkowalski avatar spoonincode avatar taokayan avatar tbfleming avatar thomasbcox avatar zorba80 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

0xgabii

gxc-contracts-v1's Issues

Anonymous accounts

Background

Even though user doesn't have account on GXC, it should not hinder them from playing. In guest mode, anonymous account is created and user can claim tokens stored in the balance of anonymous account later.

Specification

  • Token issuer can create anonymous account with public key.
  • User can claim tokens in the balance of anonymous account by signing account_name with registered public key.

Notify whether withdrawal request is processed

Backgrounds

Withdrawal requests are processed in bundle by sole action clearreqs(name owner, extended_asset value), so dApp developer cannot catch the status of processing withdrawal requests.

Possible solutions (not tested)

  1. eosio::action::send_context_free()
    Currently most desirable way. context_free_action consumes smaller NET bandwidth and can be pruned in replay, so it seems a good way to just track whether withdrawal requests are processed. However, I didn't analyzed enough how inline_traces in transaction receipt are recorded or whether mongoDB has inline actions execution results. (draft: c5b443d)

  2. eosio::require_recipient(owner)
    Original way to notify specific action is pushed. eosio.token::transfer() calls require_recipient() on sender and recipient of token.

  3. eosio::action::send()
    Each withdrawal request can be processed by separated action. Not like much this idea (because of more resources consumption), but if the first or second solution not working, this way should be considered.

Use `transfer` instead of `issue`

Backgrounds

In GXC, actions related to token are handled by 2-step, proxy contract gxc.token and its implementation like token.sys or token.std. Currently, issue action triggers transfer internally, so the transaction for issuing token contains 4 actions at maximum. (if require_recipient is activated, the number of actions can increase) Let's consider transfer from null account instead of using explicit action issue.

Specification

  • transfer from null account (gxc.null) replaces issue

Upgrade contracts to be compatible with CDT 1.6.x

EOSIO/eosio.cdt has been upgraded to version 1.6.x, and it introduces several new ways of contract development. GXC contracts need to be upgraded to be compatible with CDT 1.6.x to suppress cumbersome build warnings.

Required modifications

  • Change include namespace from eosiolib to eosio
  • Use auto dispatcher instead of explicit EOSIO_DISPATCH macro
  • Bump minimum required version of CDT in CMakeLists.txt to 1.6
  • Modify CDT version in dependencies section in README.md

If there are missing items in above list, please leave a comment and update them too.

Subitems

  • eosio.bios
  • eosio.msig
  • eosio.wrap
  • gxc.game
  • gxc.reserve
  • gxc.system
  • gxc.token
  • gxc.user
  • gxclib

[testnet] withdrawal is not called automatically.

Moved from Game-X-Coin/gxc#33 by @realcom

Test team call many withdraw request but 9/10 withdrawal request(delayed transaction) is not called.

You can find this issues by checking testuserxxxx(1~5) of Q@catfight, W@catfight, E@catfight, R@catfight.

some examples are

testuser1341 (R@catfight, E@catfight)
testuser3251 (R@catfight, W@catfight)
testuser4135 (E@catfight, R@catfight)
testuser3415 (R@catfight, W@catfight)

Allow string contract name in HTLC contract

Current implementation of HTLC contract uses eosio::name as a type of contract name. It supports BASE32 encoded string, but it cannot provide enough information about that transaction (contract). For providing contractId in ETH-side counterpart HTLC, convert the type of contract name to std::string.

Use global scope instead of `owner` scope in HTLC

gxc.htlc.cpp: 13, 29, 50

The scope of HTLC is owner, but with the current structure, it's hard to look up contract when transferring GXC from mainnet to ETH. Please use global scope instead of owner.

   // htlcs idx(_self, owner.value);
   htlcs idx(_self, _self.value);

Implement Hashed Timelock contract

Hashed timelock contract is used in atomic swap which means transferring token between heterogeneous blockchain networks. (The ransaction on one network cannot be observed by the other directly) Hashlock (generated by sha256) will defer transfer and process it when required transaction is processed in counterpart network.

pushwithdraw throw error.

when pushwithdraw A@catfight for testuser3343

withdraw failed A testuser3343 push_transaction_fail (500) {"code":500,"message":"Internal Service Error","error":{"code":3160001,"name":"invalid_table_payer","what":"The payer of the table data is invalid","details":[{"message":"must specify a valid account to pay for new record","file":"apply_context.cpp","line_number":519,"method":"db_store_i64"},{"message":"pending console output: ","file":"apply_context.cpp","line_number":72,"method":"exec_one"}]}}

revwithdraw throws error

when revwithdraw B@catfight for testuser1353

rev_withdraw failed B testuser1353 json_to_bin_fail (500) {"code":500,"message":"Internal Service Error","error":{"code":3050000,"name":"action_validate_exception","what":"Action validate exception","details":[{"message":"Unknown action revwithdraw in contract gxc.token","file":"chain_plugin.cpp","line_number":1965,"method":"abi_json_to_bin"},{"message":"code: gxc.token, action: revwithdraw, args: {\"owner\":\"testuser1353\",\"value\":\"21.3 B@catfight\"}","file":"chain_plugin.cpp","line_number":1976,"method":"abi_json_to_bin"}]}}

Failure on pushwithdraw

Forwarded from #55 by @realcom

when pushwithdraw A@catfight for testuser3343

withdraw failed A testuser3343 push_transaction_fail (500) {"code":500,"message":"Internal Service Error","error":{"code":3160001,"name":"invalid_table_payer","what":"The payer of the table data is invalid","details":[{"message":"must specify a valid account to pay for new record","file":"apply_context.cpp","line_number":519,"method":"db_store_i64"},{"message":"pending console output: ","file":"apply_context.cpp","line_number":72,"method":"exec_one"}]}}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.