All Projects → EOSEssentials → EOS-Proxy-Token

EOSEssentials / EOS-Proxy-Token

Licence: MIT license
Proxy token to allow mitigating EOSIO Ram exploit

Programming Languages

WebAssembly
147 projects
C++
36643 projects - #6 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to EOS-Proxy-Token

every-eos
Decentralized exchange based on eos.io
Stars: ✭ 20 (-9.09%)
Mutual labels:  token, eos, eosio
Monstereos
A Tamagotchi and Battle Game for EOS Blockchain :)
Stars: ✭ 174 (+690.91%)
Mutual labels:  eos, eosio
Eos Bios
DEPRECATED: use `eosc boot` now. Historically: Orchestrator for a decentralized EOS.IO blockchain network boot
Stars: ✭ 173 (+686.36%)
Mutual labels:  eos, eosio
namevault
Account creator & name generator for users on EOS and EOSIO compatible blockchains.
Stars: ✭ 17 (-22.73%)
Mutual labels:  eos, eosio
Advanced Eos Examples
EOS Smart Contract Development Examples
Stars: ✭ 146 (+563.64%)
Mutual labels:  eos, eosio
Awesome Eos
A curated list of EOS Ecosystem by SuperONE.
Stars: ✭ 160 (+627.27%)
Mutual labels:  eos, eosio
Awesome Eos
A curated list of awesome EOS frameworks, libraries, software and resources.
Stars: ✭ 181 (+722.73%)
Mutual labels:  eos, eosio
Eos Awesome Contracts
List of open source contracts for EOSIO blockchains
Stars: ✭ 66 (+200%)
Mutual labels:  eos, eosio
eosgo-client
A simple Go wrapper of EOS (eosio) RPC API, and more!
Stars: ✭ 29 (+31.82%)
Mutual labels:  eos, eosio
eosdart ecc
Elliptic curve cryptography functions in Dart. Private Key, Public Key, Signature, AES, Encryption, Decryption
Stars: ✭ 25 (+13.64%)
Mutual labels:  eos, eosio
eosdart
EOS API Client in Dart Language
Stars: ✭ 33 (+50%)
Mutual labels:  eos, eosio
Cryptokylin Testnet
EOS.io Kylin Testnet by cryptokylin.io
Stars: ✭ 140 (+536.36%)
Mutual labels:  eos, eosio
Everipedia
🔗 The Everipedia Network protocol
Stars: ✭ 138 (+527.27%)
Mutual labels:  eos, eosio
Eostracker
🗄EOS Tracker: Real time block explorer for EOS Blockchain
Stars: ✭ 166 (+654.55%)
Mutual labels:  eos, eosio
Eosc
Cross-platform EOSIO command-line swiss-army-knife (EOS, BOS, Telos, Worbli, etc.)
Stars: ✭ 128 (+481.82%)
Mutual labels:  eos, eosio
ping-eos
Implementing ping between EOS / React.js
Stars: ✭ 86 (+290.91%)
Mutual labels:  eos, eosio
Tiny.scatter
Scatter compatible eos injection library
Stars: ✭ 31 (+40.91%)
Mutual labels:  eos, eosio
Scatter
Scatter is an in-browser ( extension ) wallet for EOS which facilitates interaction between users and dapps.
Stars: ✭ 59 (+168.18%)
Mutual labels:  eos, eosio
luckydog
luckydog(锦鲤) 一个幸运小游戏
Stars: ✭ 14 (-36.36%)
Mutual labels:  eos, eosio
alcor-ui
Alcor Exchange | First self-listing onchain DEX for eosio tokens;
Stars: ✭ 103 (+368.18%)
Mutual labels:  eos, eosio

Proxy Token

You can use this on mainnet!

  • safetransfer

If you want to be sure the person you're sending tokens to can't lock up your RAM send it through the safetransfer account and add the user you want to send tokens to as the memo.

Once we are sure this contract is stable the keys to the account will be set to dummy keys. ( making no one able to change it )

IMPORTANT: Do not interact with dapps through this. If you do they will act as if they are interacting with this contract, and not with you.


What this is

Put this contract onto an account with no available RAM and then use it to proxy token transfers from your dapp to users that might have code installed.

The problem

A malicious user can install code on their account which will allow them to insert rows in the name of another account sending them tokens. This lets them lock up RAM by inserting large amounts of garbage into rows when dapps/users send them tokens.

The solution

By sending tokens to a proxy account with no available RAM, and with a memo where the first word of the memo is the account you eventually want to send the tokens to, the only account they can assume database row permissions for is the proxy, which has no RAM.


Token types

This contract accepts all token types that conform to the basic eosio.token contract. The only method that has to have an identical argument signature is the transfer method.

Permissions (eosio.code)

You will need to set permissions onto your proxy contract to allow it to send tokens inline. You can do this using the perms.sh bash script with the following syntax from a cleos enabled machine Do not include the <>

./perms.sh <YOUR_ACCOUNT_NAME> <YOUR_ACCOUNT_PUBLIC_KEY>

Using the proxy from your contract

In the same way you are sending transfer to your users you simply change the memo to include the account name as the first word in the memo. This contract also carries along the rest of the memo after a space.

Example Memo: eosio this is a memo

This will send tokens from the proxy to the account eosio with the memo this is a memo.

You can easily test this on the mainnet by sending tokens to the tknproxytest account.

cleos transfer YOURACCOUNT tknproxytest "1.0000 EOS" "YOURACCOUNT this is a memo"

Alternative options

You can do this from a smart contract without using this intermediate proxy.

Solution relayed from Bart Wyatt by Todd Fleming:

"Inline transfer to proxy, then inline transfer from proxy. Proxy’s active would delegate to contract’s eosio.code The original contract would issue both transfers, but with a different auth."

People that helped make this happen

  • Todd Fleming
  • EOSBet
  • Nathan Rempel ( genereos )
  • Jesta ( Greymass )
  • Igor ( EOS Rio )
  • Syed ( EOS Cafe )
  • Michael Yeates ( eosDac )
  • nsjames ( Scatter )

Things that didn't work.

  • There's no way to check an account's code_hash from within a smart contract currently.
  • There's no way to check an account's last_code_update from within a smart contract currently.
  • We had an idea for an oracle, we built it out and it worked well and was easy to use from smart contracts, however if a malicious actor used a batch transaction to both setcode and get tokens from a dapp then the oracle solution would fail.

Need a way to convert account names to strings?

The guys from EOS Bet threw this together.


    std::string name_to_string(uint64_t acct_int) const {
       static const char* charmap = ".12345abcdefghijklmnopqrstuvwxyz";

        std::string str(13,'.');

        uint64_t tmp = acct_int;

        for( uint32_t i = 0; i <= 12; ++i ) {
           char c = charmap[tmp & (i == 0 ? 0x0f : 0x1f)];
           str[12-i] = c;
           tmp >>= (i == 0 ? 4 : 5);
        }

        boost::algorithm::trim_right_if( str, []( char c ){ return c == '.'; } );
        return str;
     }
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].