casper-ecosystem / cep18 Goto Github PK
View Code? Open in Web Editor NEWImplementation of ERC20 token for the CasperLabs platform.
Home Page: https://casper.network/docs/dapp-dev-guide
License: Apache License 2.0
Implementation of ERC20 token for the CasperLabs platform.
Home Page: https://casper.network/docs/dapp-dev-guide
License: Apache License 2.0
This ticket accounts for work done to clarify usage of storage::new_contract
in relation to contract vs package hash.
Relevant information can be found in this slack conversation.
We're doing this in CEP78 so to be consistent let's do the same in ERC20
All of the links in the tutorial that refer to the old docs site (https://casper.network/docs) do not work properly, as they just redirect to the main docs landing page.
For example, the first one is: Writing Rust Contracts on Casper
I would have fixed these myself but some of the broken links don't have an obvious match in the new docs site.
Please see this comment. #69 (comment)
I am creating this ticket to separate out the task so we do not hold up the release of 1.0. 1.0 is needed by Astronomica/Beastleague so we must release on time. This work is requested by a valued partner, MAKE. Once our lead engineers give the approval to do this, we will continue development.
Additional note: If we can include this change without delaying the scheduled release, we will.
To validate the namings of entry points and DB Schema aligned with EquityBrix
Better error handling that @gyroflaw suggested
We are having an independent agency do an audit review of the contract. This ticket allows us time to make the appropriate changes based on their findings. allowing for half a sprint and will adjust based on findings
And please check if everything is working correctly.
This ticket captures the effort to make the necessary updates regarding the "upgrade mechanism" for cep-18 into the existing and tutorials.
https://github.com/casper-ecosystem/cep18/blob/dev/cep18/src/main.rs#L363-L391
https://github.com/casper-ecosystem/cep18/pull/113
entry points in the contract are calling the emit function, but during installation the CES library is not initialized.
This ticket accounts for creating framework docs around the Checkpoint system. Ideally, it would allow us to quickly update and release documentation alongside Checkpointer when it is fully ready for release.
Checkpointer Demo Video:
https://drive.google.com/file/d/1BJOyW8iZbCj71fisigd6MLE0JPWafS68/view?usp=sharing
Once the Peregrine upgrade is live, newly installed CEP-18 contracts will benefit from lower transaction fees.
For older contracts to operate with the same lower fees, the owner must upgrade the contract.
A new version of CEP-18 that supports the upgrade path is needed.
Hi,
I'm sending a transfer deploy using the JS CEP18Client
from here and I got the following error from RPC, could you please clarify what it means as it doesn't tell anything specific.
{
"jsonrpc": "2.0",
"id": "0",
"error": {
"code": -32602,
"message": "Invalid params",
"data": null
}
}
Here is the deploy generated from the CEP18Client
:
{"jsonrpc":"2.0","id":"0","method":"account_put_deploy","params":{"deploy":{"hash":"32c38ee2f2fb611ea02f52603aeed79865097f8adb165a0f169afec1722b7dde","header":{"account":"020304Bb523043dec125E3f31efA82fF2B8E30dF97211bcf87CDb3B6BaE6586AdD4A","timestamp":"2023-06-23T13:54:52.666Z","ttl":"30m","gas_price":1,"body_hash":"b61f918d9f7d788b619da298651b3b82c98fb01dc1574ed6b84d22cae0e37b4f","dependencies":[],"chain_name":"casper-test"},"payment":{"ModuleBytes":{"module_bytes":"","args":[["amount",{"bytes":"0480f0fa02","cl_type":"U512"}]]}},"session":{"StoredContractByHash":{"hash":"","entry_point":"transfer","args":[["recipient",{"bytes":"00f98f2ed4ea79f13cf3e5681e5b2dfbb2b9ef48770a76f04f2f934503522a44f5","cl_type":"Key"}],["amount",{"bytes":"0103","cl_type":"U256"}]]}},"approvals":[{"signer":"020304Bb523043dec125E3f31efA82fF2B8E30dF97211bcf87CDb3B6BaE6586AdD4A","signature":"0222d7ae442bf1cb244aea8536aea3b6b507b2a7f1614a02d0f3d3cbbd36435813651ba04d19f1b8ba4b5c5db481016874027c5a1a97c9911f4c877add5806cb33"}]}}}
Could you please advise what is wrong?
Remove the obsolete cargo casper --erc20 <PATH TO NEW PROJECT>
comment from this comments section of lib.rs
Includes Unit and Integration tests.
While working on #75 and talking with our developers, I see that we need to update a few more sections:
Hello!
Is it possible to keep some token on a smart contract balance?
And how to implement such behaviour?
cargo casper --erc20 <PATH TO NEW PROJECT>
returns
error: Found argument '--erc20' which wasn't expected, or isn't valid in this context
If you tried to supply `--erc20` as a value rather than a flag, use `-- --erc20`
USAGE:
cargo casper [FLAGS] <path>
cd <path>
make prepare
make test
For more information try --help
Should ERC20 repo be used like this?
. forking our erc20 repo if working on an erc20 token.
Hi
Is this library production ready? Does anyone use it in their apps/projects so we can look at how to use it?
Is there some reference implementation with a real-life usage example as we did in the Casper Wallet playground?
It would be really helpful, thanks :)
There must be comprehensive example code illustrating the installation & invocation of all example smart contracts within eco-system. Also if in the example smart contracts there are no examples with optional arguments then a new example smart contract should be created.
Hi
I'm trying to install the "cep-18" client using the official installation readme guide.
There is an error in the installation script while using "npm i casper-erc20-js-client".
What is your advice here so we can use it properly in the Casper Wallet product?
npm i casper-cep18-js-client
npm ERR! code 1
npm ERR! path /Users/piotrek/Dev/casper-wallet/node_modules/casper-cep18-js-client
npm ERR! command failed
npm ERR! command sh -c -- npm run generate:wasm
npm ERR! > casper-cep18-js-client@1.0.0 generate:wasm
npm ERR! > ts-node "src/scripts/copy-and-convert-wasms.ts"
npm ERR! node:internal/modules/cjs/loader:988
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module './copy-and-convert-wasms.ts'
npm ERR! Require stack:
npm ERR! - /Users/piotrek/Dev/casper-wallet/node_modules/casper-cep18-js-client/src/scripts/imaginaryUncacheableRequireResolveScript
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:985:15)
npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:109:19)
npm ERR! at requireResolveNonCached (/Users/piotrek/Dev/casper-wallet/node_modules/ts-node/dist/bin.js:549:16)
npm ERR! at getProjectSearchDir (/Users/piotrek/Dev/casper-wallet/node_modules/ts-node/dist/bin.js:519:40)
npm ERR! at phase3 (/Users/piotrek/Dev/casper-wallet/node_modules/ts-node/dist/bin.js:267:27)
npm ERR! at bootstrap (/Users/piotrek/Dev/casper-wallet/node_modules/ts-node/dist/bin.js:47:30)
npm ERR! at main (/Users/piotrek/Dev/casper-wallet/node_modules/ts-node/dist/bin.js:33:12)
npm ERR! at Object.<anonymous> (/Users/piotrek/Dev/casper-wallet/node_modules/ts-node/dist/bin.js:579:5)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1155:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! '/Users/piotrek/Dev/casper-wallet/node_modules/casper-cep18-js-client/src/scripts/imaginaryUncacheableRequireResolveScript'
npm ERR! ]
npm ERR! }
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/piotrek/.npm/_logs/2023-06-09T13_23_33_383Z-debug-0.log
Enable Gitpod support.
As we rework the ERC-20 contract to be compatible with CEP-78 standards, there will be updates necessary to the js client to be released. This epic captures the necessary work to update and republish the js client.
Currently, the ERC20 test contract in the ERC20 Repo contains unsafe code. The below comments from the contract contains the details.
The aim of this ticket is to analyse the contract, remove unsafe code and update the example contract to align to Casper's Token Standards.
Comments in the example contract;
This can all be addressed if we flatten ERC20 implementation in the style of the cep-78 implementation i.e. a simple contract and no library.
the deliverable should be a contract repo with one straightforward contract implementation and integration tests
Create a tutorial in a similar manner to the existing CEP18 documentation that outlines the use of each aspect of CEP78 in a more direct and user-friendly way.
with this PR #69 we brought our CEP 18 contract up to be consistent with CEP78 and added CES events. (events modality). We need to follow up with the appropriate documentation updates.
If there isn't enough token in a given account to complete a transfer transaction, the contract should return the ERC20TransferError::NotEnoughBalance
error.
The contract should return an error.
Been trying to deploy this to testnet and keep getting "Out of gas error"
https://testnet.cspr.live/account/01b202457a136b9acb8a03760797ed2e6c5ee486c367371043369a9a572dc833cb
On Ubuntu 18 LTS
Casper client 1.1.1
Ran the commands:
git clone https://github.com/casper-ecosystem/erc20 && cd erc20
make prepare
make build-contract
casper-client put-deploy --chain-name casper-test --node-address http://173.249.29.90:7777 --secret-key ./keys/secret_key.pem --session-path ./target/wasm32-unknown-unknown/release/contract.wasm --payment-amount 3000000000 --session-arg "token_name:string='GAP CSPR-ETH'" --session-arg "token_symbol:string='GAP'" --session-arg "token_decimals:u8='2'" --session-arg "token_total_supply:u256='100000000'"
you can most likely reuse script from there
https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/dev/.github/workflows/ci-cep-78-client.yml
This note from our security audit was never pushed back to the casper labs erc20
https://github.com/Rengo-Labs/CasperLabs-Crates/blob/6e2e449d11c097df318e6660667dc85c8bc12aae/casper_erc20_new/src/lib.rs#L207
https://github.com/Rengo-Labs/CasperLabs-Crates/blob/6e2e449d11c097df318e6660667dc85c8bc12aae/casper_erc20_new/src/lib.rs#L223
Per QSP-7
https://certificate.quantstamp.com/full/rengo-labs
This was added to address an issue reported by the community https://github.com/casper-ecosystem/cep18/blob/i335/cep18/src/main.rs#L96
update the client to support a new entry point: increase_allowance: https://github.com/casper-ecosystem/cep18/blob/i335/cep18/src/main.rs#L113
Low Level Design Doc
https://docs.google.com/document/d/1dm1F3IZw5YjmkalOkIB1Biv7FaYzOfYlwNdq1tH-rzg/edit
EquityBrix AWS Environment
Deploy Code
error[E0432]: unresolved imports libc::sysconf
, libc::_SC_PAGESIZE
getting this error while make test .
Generate a step by step guide for the EB team to reference for UAT.
so it will be the same between repos - maybe in future we can release it as npm package.
https://github.com/casper-ecosystem/cep-78-enhanced-nft/blob/dev/client-js/scripts/copy-and-convert-wasms.ts
An AWS connected environment to int-test .
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.