Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] multitoken contracts (similar to ERC-1155) #70

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
ab10242
created some files
vporton Oct 27, 2020
9cab80e
created initial (non-functional but compilable) ZRC5 contract
vporton Oct 27, 2020
3eafa8f
made compilable
vporton Oct 27, 2020
e2dfd67
creating mirrored tokens
vporton Oct 27, 2020
594dfa8
made working contract
vporton Oct 27, 2020
5638932
contract updated
vporton Oct 27, 2020
9df31e3
created a test file (yet wrong)
vporton Oct 27, 2020
c06cc67
contract bug fix
vporton Oct 27, 2020
978eedf
a test almost finished
vporton Oct 27, 2020
6ef537a
bug fixes
vporton Oct 28, 2020
2fb4643
it works
vporton Oct 28, 2020
9fee92e
renamed wrongly named folder
vporton Oct 28, 2020
bab5930
example/zrc6/ZRC-6.md
vporton Oct 28, 2020
2b0d230
zrc-6.md created
vporton Oct 30, 2020
3546d1c
added name, symbol, decimals, init_supply
vporton Oct 30, 2020
6581e9d
preliminary version of ZRC-6
vporton Oct 30, 2020
d411120
bug fix
vporton Oct 30, 2020
bb9e2ef
new error
vporton Oct 30, 2020
b62eee9
bug fix
vporton Oct 30, 2020
09b52d9
bug fix
vporton Oct 30, 2020
2040807
an additional event
vporton Oct 30, 2020
8f66969
bug fix
vporton Oct 30, 2020
41040ca
remark
vporton Oct 30, 2020
27c2193
bug fix
vporton Oct 30, 2020
8c8e42a
grammar
vporton Oct 30, 2020
a4e0b9f
bug fix
vporton Oct 30, 2020
7b889f9
bug fix
vporton Oct 30, 2020
87558e8
bug fix
vporton Oct 30, 2020
eb44131
formatting
vporton Oct 30, 2020
211e519
bug fix
vporton Oct 30, 2020
2e984cc
bug fixes
vporton Oct 30, 2020
2d51484
standard number correction
vporton Oct 30, 2020
e53c062
multi-token operations
vporton Oct 30, 2020
a78681d
bug fix
vporton Oct 30, 2020
3bd8a81
bug fixes
vporton Oct 30, 2020
e1ecab0
bug fix
vporton Oct 30, 2020
ae7652c
bug fix
vporton Oct 30, 2020
09ce4b7
bug fix
vporton Oct 30, 2020
aedce85
bug fix
vporton Oct 30, 2020
fdeaa24
title fix
vporton Oct 30, 2020
d90a306
ZRC
vporton Oct 30, 2020
bd2a32c
BalancesMultiple
vporton Oct 30, 2020
6bdd50b
typo
vporton Oct 30, 2020
c21e83f
formatting
vporton Oct 30, 2020
046ffcd
typo
vporton Oct 30, 2020
8e121da
typo
vporton Oct 30, 2020
5ecdc3d
typos
vporton Oct 30, 2020
94fe9a2
typo
vporton Oct 30, 2020
47d1148
typos
vporton Oct 30, 2020
09ca052
contract address updated
vporton Oct 30, 2020
1eb010b
test bug fix
vporton Oct 30, 2020
1f0f731
Add FUNDING.yml
vporton Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
created a test file (yet wrong)
vporton committed Oct 27, 2020

Unverified

This user has not yet uploaded their public signing key.
commit 9df31e348a5542147dc4d43a5eb4349374bcb799
56 changes: 56 additions & 0 deletions example/zrc5/store.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const {BN, Long, bytes, units} = require('@zilliqa-js/util');
const {Zilliqa} = require('@zilliqa-js/zilliqa');
const {
toBech32Address,
getAddressFromPrivateKey,
} = require('@zilliqa-js/crypto');


async function main() {
const zilliqa = new Zilliqa('https://dev-api.zilliqa.com');
const CHAIN_ID = 333;
const MSG_VERSION = 1;
const VERSION = bytes.pack(CHAIN_ID, MSG_VERSION);
privkey = '07e0b1d1870a0ba1b60311323cb9c198d6f6193b2219381c189afab3f5ac41a9';
zilliqa.wallet.addByPrivateKey(
privkey
);
const address = getAddressFromPrivateKey(privkey);
console.log("Your account address is:");
console.log(`${address}`);
const myGasPrice = units.toQa('1000', units.Units.Li); // Gas Price that will be used by all transactions


const ftAddr = toBech32Address("9b80a12a68989575b7fd4b82a6dabee468ab9d92");
try {
const contract = zilliqa.contracts.at(ftAddr);
const callTx = await contract.call(
'Transfer',
[
{
vname: 'to',
type: 'ByStr20',
value: "0xBFe2445408C51CD8Ee6727541195b02c891109ee",
},
{
vname: 'amount',
type: 'Uint128',
value: "100",
}
],
{
// amount, gasPrice and gasLimit must be explicitly provided
version: VERSION,
amount: new BN(0),
gasPrice: myGasPrice,
gasLimit: Long.fromNumber(10000),
}
);
console.log(JSON.stringify(callTx.receipt, null, 4));

} catch (err) {
console.log(err);
}
}

main();