Lev 2 years ago
parent
commit
dd9339a548
  1. 98
      sources/cli.js
  2. 6
      sources/foundation.deploy.ts
  3. 8
      sources/foundation.tact
  4. 4
      sources/jetton.deploy.ts
  5. 2
      sources/output/jetton_Foundation.abi
  6. BIN
      sources/output/jetton_Foundation.code.boc
  7. 8
      sources/output/jetton_Foundation.code.fc
  8. 16
      sources/output/jetton_Foundation.code.fif
  9. 14
      sources/output/jetton_Foundation.code.rev.fif
  10. 2
      sources/output/jetton_Foundation.md
  11. 2
      sources/output/jetton_Foundation.pkg
  12. 5
      sources/output/jetton_Foundation.ts
  13. 2
      sources/output/jetton_Linker.abi
  14. 2
      sources/output/jetton_Linker.code.fc
  15. 2
      sources/output/jetton_Linker.code.fif
  16. 2
      sources/output/jetton_Linker.pkg
  17. 1
      sources/output/jetton_Linker.ts
  18. 2
      sources/output/jetton_PseudoStaking.abi
  19. 2
      sources/output/jetton_PseudoStaking.code.fc
  20. 2
      sources/output/jetton_PseudoStaking.code.fif
  21. 2
      sources/output/jetton_PseudoStaking.pkg
  22. 1
      sources/output/jetton_PseudoStaking.ts
  23. 2
      sources/output/jetton_TONB.abi
  24. 2
      sources/output/jetton_TONB.code.fc
  25. 2
      sources/output/jetton_TONB.code.fif
  26. 2
      sources/output/jetton_TONB.pkg
  27. 1
      sources/output/jetton_TONB.ts
  28. 2
      sources/output/jetton_TONBWallet.abi
  29. 2
      sources/output/jetton_TONBWallet.code.fc
  30. 2
      sources/output/jetton_TONBWallet.code.fif
  31. 2
      sources/output/jetton_TONBWallet.pkg
  32. 1
      sources/output/jetton_TONBWallet.ts
  33. 44
      sources/pseudostaking.deploy.ts
  34. 9
      sources/utils/config.ts
  35. 60
      sources/utils/interactions.ts

98
sources/cli.js

@ -1,7 +1,7 @@
const subcommand = require('subcommand');
const { deployTONB, deposit, withdraw, transfer, blacklistAddress, getTONBOpen, getFoundationOpen, changeTONBOwner, createBlacklistVote } = require('./utils/interactions');
const { wallet_data, client, client4 } = require('./utils/config');
const { deployTONB, deposit, withdraw, transfer, blacklistAddress, getTONBOpen, getFoundationOpen, changeTONBOwner, createBlacklistVote, castVote, finishVote, requestUnstake, collectProfit } = require('./utils/interactions');
const { wallet_data, client, client4, staking_addr } = require('./utils/config');
const { randomAddress, TON } = require('./utils/helpers');
const { toNano, Address } = require('ton');
const { TONB } = require('./output/jetton_TONB');
@ -32,8 +32,8 @@ const match = subcommand([
}
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts._[1]));
let tonb_addr = await deployTONB(undefined, true);
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let tonb_addr = (await getTONBOpen(undefined, staking_addr)).address;
await deposit(my_wallet, secretKey, parseFloat(opts._[0]) * 1000000000, tonb_addr);
}
},
@ -54,8 +54,8 @@ const match = subcommand([
}
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts._[1]));
let tonb_addr = await deployTONB(undefined, true);
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let tonb_addr = (await getTONBOpen(undefined, staking_addr)).address;
await withdraw(my_wallet, secretKey, parseFloat(opts._[0]) * 1000000000, tonb_addr);
}
},
@ -74,7 +74,7 @@ const match = subcommand([
}],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data();
let tonb_addr = await deployTONB(undefined, true);
let tonb_addr = (await getTONBOpen(undefined, staking_addr)).address;
await transfer(my_wallet, secretKey, parseFloat(opts._[0]) * 1000000000, tonb_addr, opts._[1]);
}
},
@ -92,8 +92,8 @@ const match = subcommand([
}
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts._[1]));
let tonb_addr = await deployTONB(undefined, true);
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let tonb_addr = (await getTONBOpen(undefined, staking_addr)).address;
if (!opts._[0]) {
opts._[0] = 'kQD7zbEMaWC2yMgSJXmIF7HbLr1yuBo2GnZF_CJNkUiGSVZ8'// my_wallet.address;
}
@ -114,7 +114,7 @@ const match = subcommand([
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let tonb = await getTONBOpen();
let tonb = await getTONBOpen(undefined, staking_addr);
let addr = Address.parse(opts._[0]);
if (opts._[1]) {
let tonb_addr = Address.parse(opts._[1]);
@ -139,20 +139,15 @@ const match = subcommand([
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let foundation = await getFoundationOpen((await getTONBOpen()).address);
let foundation = await getFoundationOpen((await getTONBOpen(undefined, staking_addr)).address);
if (opts._[1]) {
let foundation_addr = Address.parse(opts._[1]);
foundation = client.open(Foundation.fromAddress(foundation_addr));
}
let addr = Address.parse(opts._[0]);
let adminIndex = BigInt(parseInt(opts.w));
// let msg = {
// $$type: 'InitiateBlacklistVote', wallet: addr,
// vote_time: 10n, quorum_percent: 50n, adminIndex // An admin has to create the vote
// };
// await foundation.send(my_wallet, { value: toNano('1.1') }, msg);
await createBlacklistVote(my_wallet, secretKey, foundation.address,
addr, 10n, adminIndex);
addr, 40n, adminIndex);
}
},
{
@ -167,7 +162,7 @@ const match = subcommand([
}
],
async command(opts) {
let foundation = await getFoundationOpen((await getTONBOpen()).address);
let foundation = await getFoundationOpen((await getTONBOpen(undefined, staking_addr)).address);
if (opts._[1]) {
let foundation_addr = Address.parse(opts._[1]);
foundation = client4.open(Foundation.fromAddress(foundation_addr));
@ -195,14 +190,73 @@ const match = subcommand([
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let foundation = await getFoundationOpen((await getTONBOpen()).address);
let foundation = await getFoundationOpen((await getTONBOpen(undefined, staking_addr)).address);
if (opts._[2]) {
let foundation_addr = Address.parse(opts._[2]);
foundation = client.open(Foundation.fromAddress(foundation_addr));
}
await foundation.send(my_wallet, { value: toNano('0.1') }, {
$$type: 'VoteMsg', voteId: opts._[0], vote: opts._[1], adminIndex: BigInt(parseInt(opts.w))
});
let adminIndex = BigInt(parseInt(opts.w));
await castVote(my_wallet, secretKey, foundation.address, parseInt(opts._[0]), parseInt(opts._[1]), adminIndex);
}
},
{
name: 'finish-vote',
options: [
{
name: 'vote-id'
},
{
name: 'foundation-address',
required: false
},
wal_opt
],
async command(opts) {
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
let foundation = await getFoundationOpen((await getTONBOpen(undefined, staking_addr)).address);
if (opts._[1]) {
let foundation_addr = Address.parse(opts._[1]);
foundation = client.open(Foundation.fromAddress(foundation_addr));
}
let adminIndex = BigInt(parseInt(opts.w));
await finishVote(my_wallet, secretKey, foundation.address, parseInt(opts._[0]), adminIndex);
}
},
{
name: 'request-unstake',
options: [
{
name: 'foundation-address',
required: false
}
],
async command(opts) {
let foundation = await getFoundationOpen((await getTONBOpen(undefined, staking_addr)).address);
if (opts._[0]) {
let foundation_addr = Address.parse(opts._[0]);
foundation = client.open(Foundation.fromAddress(foundation_addr));
}
let { my_wallet, secretKey } = await wallet_data();
await requestUnstake(my_wallet, secretKey, foundation.address, 0);
}
},
{
name: 'collect-profit',
options: [
{
name: 'foundation-address',
required: false
},
wal_opt
],
async command(opts) {
let foundation = await getFoundationOpen((await getTONBOpen(undefined, staking_addr)).address);
if (opts._[0]) {
let foundation_addr = Address.parse(opts._[0]);
foundation = client.open(Foundation.fromAddress(foundation_addr));
}
let { my_wallet, secretKey } = await wallet_data(parseInt(opts.w));
await collectProfit(my_wallet, secretKey, foundation.address, parseInt(opts.w));
}
}
]);

6
sources/foundation.deploy.ts

@ -1,8 +1,6 @@
import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano, Cell} from "ton";
import {mnemonicToPrivateKey} from "ton-crypto";
import {buildOnchainMetadata} from "./utils/helpers";
import {Foundation} from "./output/jetton_Foundation";
import {client, wallet_data, workchain} from "./utils/config";
import {client, staking_addr, wallet_data, workchain} from "./utils/config";
import { createDistribution, createAddressList, getTONBState } from './utils/interactions';
@ -20,7 +18,7 @@ import { createDistribution, createAddressList, getTONBState } from './utils/int
let init = await Foundation.init(
createDistribution([my_wallet.address], [100n]),
createAddressList([my_wallet.address]),
contractAddress(workchain, await getTONBState()));
contractAddress(workchain, await getTONBState(undefined, staking_addr)));
let destination_address = contractAddress(workchain, init);

8
sources/foundation.tact

@ -38,7 +38,7 @@ contract Foundation {
require(msg.voteId < self.n_votes, "Invalid vote id");
let vote: Vote = self.votes.get(msg.voteId)!!;
require(vote.ended == false, "Vote already ended");
require(vote.vote_end >= now(), "Vote is not finished yet");
require(vote.vote_end <= now(), "Vote is not finished yet");
let n_yes: Int = 0;
let n_no: Int = 0;
let n_abstain: Int = 0;
@ -98,7 +98,7 @@ contract Foundation {
require(msg.voteId < self.n_votes, "Invalid vote id");
let vote: Vote = self.votes.get(msg.voteId)!!;
require(vote.ended == false, "Vote already ended");
// require(vote.vote_end > now(), "Vote is finished");
require(vote.vote_end > now(), "Vote is finished");
require(msg.vote >= 0 && msg.vote <= 2, "Invalid vote");
vote.votes.set(msg.adminIndex, msg.vote);
self.votes.set(msg.voteId, vote);
@ -235,11 +235,11 @@ contract Foundation {
let profit: Int? = self.profits.get(ctx.sender);
require(profit != null, "No profit to collect");
let amount: Int = profit!!;
require(amount > withdraw_gas_consumption, "No profit to collect");
self.profits.set(ctx.sender, 0);
send(SendParameters{
to: ctx.sender,
value: amount - withdraw_gas_consumption,
mode: SendRemainingValue
value: amount - withdraw_gas_consumption
});
}

4
sources/jetton.deploy.ts

@ -2,7 +2,7 @@ import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, Wa
import {mnemonicToPrivateKey} from "ton-crypto";
import {buildOnchainMetadata} from "./utils/helpers";
import {TONB} from "./output/jetton_TONB";
import {client, wallet_data, workchain, owner, jettonParams, default_content} from "./utils/config";
import {client, wallet_data, workchain, owner, jettonParams, default_content, staking_addr} from "./utils/config";
import { getTONBState } from "./utils/interactions";
@ -17,7 +17,7 @@ import { getTONBState } from "./utils/interactions";
// Get deployment wallet balance
let balance: bigint = await my_wallet.getBalance();
// Compute init data for deployment
let init = await getTONBState();
let init = await getTONBState(undefined, staking_addr);
let destination_address = contractAddress(workchain, init);

2
sources/output/jetton_Foundation.abi

File diff suppressed because one or more lines are too long

BIN
sources/output/jetton_Foundation.code.boc

Binary file not shown.

8
sources/output/jetton_Foundation.code.fc

@ -482,7 +482,7 @@ _ $__gen_get_AdminPercents() method_id(87676) {
throw_unless(46931, ($msg'voteId < $self'n_votes));
var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = __gen_Vote_not_null(__gen_readopt_Vote(__tact_dict_get_int_cell($self'votes, 257, $msg'voteId)));
throw_unless(30386, ($vote'ended == false));
throw_unless(34326, ($vote'vote_end >= now()));
throw_unless(34326, ($vote'vote_end <= now()));
int $n_yes = 0;
int $n_no = 0;
int $n_abstain = 0;
@ -532,6 +532,7 @@ _ $__gen_get_AdminPercents() method_id(87676) {
throw_unless(46931, ($msg'voteId < $self'n_votes));
var ($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result) = __gen_Vote_not_null(__gen_readopt_Vote(__tact_dict_get_int_cell($self'votes, 257, $msg'voteId)));
throw_unless(30386, ($vote'ended == false));
throw_unless(16994, ($vote'vote_end > now()));
throw_unless(29720, (($msg'vote >= 0) & ($msg'vote <= 2)));
$vote'votes~__tact_dict_set_int_int(257, $msg'adminIndex, $msg'vote, 257);
$self'votes~__tact_dict_set_int_cell(257, $msg'voteId, __gen_writecell_Vote(($vote'id, $vote'votes, $vote'vote_end, $vote'quorum_percent, $vote'ended, $vote'result)));
@ -641,8 +642,9 @@ _ $__gen_get_AdminPercents() method_id(87676) {
int $profit = __tact_dict_get_slice_int($self'profits, 267, $ctx'sender, 257);
throw_unless(42983, (~ null?($profit)));
int $amount = __tact_not_null($profit);
throw_unless(42983, ($amount > 150000000));
$self'profits~__tact_dict_set_slice_int(267, $ctx'sender, 0, 257);
$send((true, $ctx'sender, ($amount - 150000000), 64, null(), null(), null()));
$send((true, $ctx'sender, ($amount - 150000000), 0, null(), null(), null()));
return ((($self'founders'addresses, $self'founders'length), (($self'admins'addresses'addresses, $self'admins'addresses'length), $self'admins'percents), $self'tonb, $self'votes, $self'profits, $self'proposals, $self'n_votes), ());
}
@ -761,5 +763,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmTpahMZ5QmQr9Tr28bzZjVXyrZDoiJu5wUsDtQignQvds";
return "ipfs://QmNQiJe7zoeswirUzh8ypebXAuUtah51gawoLn9oLTwpeL";
}

16
sources/output/jetton_Foundation.code.fif

@ -766,7 +766,7 @@ PROGRAM{
34326 PUSHINT
s2 PUSH
NOW
GEQ
LEQ
THROWANYIFNOT
0 PUSHINT
s0 s0 s0 PUSH3
@ -928,6 +928,11 @@ PROGRAM{
s2 PUSH
0 EQINT
THROWANYIFNOT
16994 PUSHINT
s4 PUSH
NOW
GREATER
THROWANYIFNOT
29720 PUSHINT
s7 PUSH
-1 GTINT
@ -1290,6 +1295,11 @@ PROGRAM{
NOT
THROWANYIFNOT
__tact_not_null INLINECALLDICT
42983 PUSHINT
OVER
150000000 PUSHINT
GREATER
THROWANYIFNOT
s0 s4 XCHG
267 PUSHINT
s2 PUSH
@ -1301,7 +1311,7 @@ PROGRAM{
150000000 PUSHINT
SUB
s5 s5 s0 XCHG3
64 PUSHINT
0 PUSHINT
PUSHNULL
PUSHNULL
PUSHNULL
@ -1526,6 +1536,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d547061684d5a35516d51723954723238627a5a6a565879725a446f694a753577557344745169676e51766473} PUSHSLICE
x{697066733a2f2f516d4e51694a65377a6f6573776972557a6838797065625841755574616835316761776f4c6e396f4c547770654c} PUSHSLICE
}>
}END>c

14
sources/output/jetton_Foundation.code.rev.fif

@ -150,7 +150,7 @@ SETCP0
34326 PUSHINT
s2 PUSH
NOW
GEQ
LEQ
THROWANYIFNOT
0 PUSHINT
0 0 0 PUSH3
@ -522,6 +522,11 @@ SETCP0
s2 PUSH
0 EQINT
THROWANYIFNOT
16994 PUSHINT
s4 PUSH
NOW
GREATER
THROWANYIFNOT
29720 PUSHINT
s7 PUSH
-1 GTINT
@ -2135,6 +2140,11 @@ SETCP0
s0 PUSH
ISNULL
128 THROWIF
42983 PUSHINT
s1 PUSH
150000000 PUSHINT
GREATER
THROWANYIFNOT
s0 s4 XCHG
267 PUSHINT
s2 PUSH
@ -2146,7 +2156,7 @@ SETCP0
150000000 PUSHINT
SUB
s5 s5 s0 XCHG3
64 PUSHINT
0 PUSHINT
PUSHNULL
PUSHNULL
PUSHNULL

2
sources/output/jetton_Foundation.md

@ -1,6 +1,6 @@
# TACT Compilation Report
Contract: Foundation
BOC Size: 3554 bytes
BOC Size: 3576 bytes
# Types
Total Types: 36

2
sources/output/jetton_Foundation.pkg

File diff suppressed because one or more lines are too long

5
sources/output/jetton_Foundation.ts

@ -1806,8 +1806,8 @@ function dictValueParserWithdraw(): DictionaryValue<Withdraw> {
}
async function Foundation_init(admins: Distribution, founders: AddressList, tonb: Address) {
const __init = 'te6ccgEBBgEAdQABFP8A9KQT9LzyyAsBAgFiAgMCAswEBQAnoUrcBN5EAt5EsAbeRCBqgggH4BEAAdwAhdtra2uAVkZgUINK8SiCslTAF6AECAgOeAZCMJqCoqkAF6AECAgOeAegAA54sJegACZHoACfoAQICA54BkrGZkgOZkw=';
const __code = 'te6ccgECOAEADdYAART/APSkE/S88sgLAQIBYgIDAgLMEBECASAEBQIBIAYHAgEgCgsBgblFztRNDUAfhi9ASBAQHXAFkC1AHQ9ASBAQHXAFkC9ARQMwP6QAEB9ATUMND0BPQEgQEB1wAwEIoQZxBWbBrbPICAGBuWfO1E0NQB+GL0BIEBAdcAWQLUAdD0BIEBAdcAWQL0BFAzA/pAAQH0BNQw0PQE9ASBAQHXADAQihBnEFZsGts8gJAARskQAIEFlfCQBNu70YJwXOw9XSyuex6E7DnWSoUbZoJwndY1LStkfLMi068t/fFiOYAgEgDA0BsbSHHaiaGoA/DF6AkCAgOuALIF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cD/ODY0LwOWj8aBAQEjAvAM2zwgbvLQgG8lJMAAjxV/cIBABiBu8tCA2zwsAwRQd21t2zyRM+IjwAEwA8ACnTg4OAcgbvLQgBBXBgWSXwPikTDiMzIwAfbIcQHKAVAHAcoAcAHKAlAFzxZQA/oCcAHKaCNusyVus7GOTH8BygDIcAHKAHABygAkbrOdfwHKAAQgbvLQgFAEzJY0A3ABygDiJG6znX8BygAEIG7y0IBQBMyWNANwAcoA4nABygACfwHKAALJWMyXMzMBcAHKAOIhbrMxADCcfwHKAAEgbvLQgAHMlTFwAcoA4skB+wAAHMgBggqcg5ZYyx8BzxbJAGQgbpIwbeDQgQEB1wD6QCHXCwHDAJEBkjFt4gH0BNIAAZWBAQHXAJJtAeL0BFVAbBVvBQEMyFVQ2zzJNQBMUFaBAQHPABP0AIEBAc8AgQEBzwDKACFus5Z/AcoAygCUcDLKAOIB5oEBAVRXAFIwQTP0DG+hlAHXADCSW23iIG7y0IAgwAGOTiDAAo4fMIEBAVRfAFIwQTP0DG+hlAHXADCSW23iIG7y0IAToI4lwACOH4EBAVRfAFIwQTP0DG+hlAHXADCSW23iIG7y0IASoAHeAuJAE+MNA6Q3AD4wgQEBVF8AUjBBM/QMb6GUAdcAMJJbbeIgbvLQgBSgARogbpIwbeDQ2zxsFm8GOQA+gQEB1wD0BIEBAdcAgQEB1wDSANIAAZLSAJJtAeJVUDcGG30=';
let systemCell = Cell.fromBase64(__system);
let builder = new TupleBuilder();
builder.writeCell(systemCell);
@ -1862,6 +1862,7 @@ const Foundation_errors: { [key: number]: { message: string } } = {
6873: { message: `Only an admin can initiate a vote` },
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
16994: { message: `Vote is finished` },
18474: { message: `only the owner can set a new owner` },
19362: { message: `Invalid quorum percent` },
29720: { message: `Invalid vote` },

2
sources/output/jetton_Linker.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_Linker.code.fc

@ -229,5 +229,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmT6MF61LUeoFNCvMjWniLYhTxNcuqbdymD4hwdqxuPN7t";
return "ipfs://QmYJH6pt4rAboUzZWHtn1mrnbty3vb3SYvYRtmj25FMSGZ";
}

2
sources/output/jetton_Linker.code.fif

@ -354,6 +354,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d54364d4636314c55656f464e43764d6a576e694c596854784e6375716264796d4434687764717875504e3774} PUSHSLICE
x{697066733a2f2f516d594a48367074347241626f557a5a5748746e316d726e627479337662335359765952746d6a3235464d53475a} PUSHSLICE
}>
}END>c

2
sources/output/jetton_Linker.pkg

File diff suppressed because one or more lines are too long

1
sources/output/jetton_Linker.ts

@ -1862,6 +1862,7 @@ const Linker_errors: { [key: number]: { message: string } } = {
6873: { message: `Only an admin can initiate a vote` },
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
16994: { message: `Vote is finished` },
18474: { message: `only the owner can set a new owner` },
19362: { message: `Invalid quorum percent` },
29720: { message: `Invalid vote` },

2
sources/output/jetton_PseudoStaking.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_PseudoStaking.code.fc

@ -284,5 +284,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://Qmd2r7TFbd5yEF7FuvHJJGMr438Yefi1v8tSa9QgS8sf32";
return "ipfs://QmdoULq5gDK4DSXmexrZT7UjZ4Es75uDjT4QtSJsCmF8DD";
}

2
sources/output/jetton_PseudoStaking.code.fif

@ -490,6 +490,6 @@ PROGRAM{
209801025412363888721030803524359905849 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d64327237544662643579454637467576484a4a474d7234333859656669317638745361395167533873663332} PUSHSLICE
x{697066733a2f2f516d646f554c713567444b344453586d6578725a5437556a5a344573373575446a54345174534a73436d46384444} PUSHSLICE
}>
}END>c

2
sources/output/jetton_PseudoStaking.pkg

File diff suppressed because one or more lines are too long

1
sources/output/jetton_PseudoStaking.ts

@ -1859,6 +1859,7 @@ const PseudoStaking_errors: { [key: number]: { message: string } } = {
6873: { message: `Only an admin can initiate a vote` },
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
16994: { message: `Vote is finished` },
18474: { message: `only the owner can set a new owner` },
19362: { message: `Invalid quorum percent` },
29720: { message: `Invalid vote` },

2
sources/output/jetton_TONB.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_TONB.code.fc

@ -825,5 +825,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmaCsDf34Xaxg6RGCy1BqUwKzksQBKWiYMbsGQHRtkYiEi";
return "ipfs://QmNNPCWJbjhcLqsDHWv4fBUrP2q6uZWXYhHdCHLCiqoPHJ";
}

2
sources/output/jetton_TONB.code.fif

@ -1564,6 +1564,6 @@ PROGRAM{
86142586315491086060343270784266291122 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d6143734466333458617867365247437931427155774b7a6b7351424b5769594d627347514852746b59694569} PUSHSLICE
x{697066733a2f2f516d4e4e5043574a626a68634c717344485776346642557250327136755a57585968486443484c4369716f50484a} PUSHSLICE
}>
}END>c

2
sources/output/jetton_TONB.pkg

File diff suppressed because one or more lines are too long

1
sources/output/jetton_TONB.ts

@ -1862,6 +1862,7 @@ const TONB_errors: { [key: number]: { message: string } } = {
6873: { message: `Only an admin can initiate a vote` },
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
16994: { message: `Vote is finished` },
18474: { message: `only the owner can set a new owner` },
19362: { message: `Invalid quorum percent` },
29720: { message: `Invalid vote` },

2
sources/output/jetton_TONBWallet.abi

File diff suppressed because one or more lines are too long

2
sources/output/jetton_TONBWallet.code.fc

@ -514,5 +514,5 @@ _ supported_interfaces() method_id {
}
_ get_abi_ipfs() {
return "ipfs://QmRzLCb5R2UswBfZBwdXxRm4MWmH4xYWfkxPfFmWZUAkQ6";
return "ipfs://QmYcmZHijG5Y8MNwToij96MARENtUjPXwBhB7QA6dvDCGV";
}

2
sources/output/jetton_TONBWallet.code.fif

@ -1011,6 +1011,6 @@ PROGRAM{
209778528950190195973528115415557644819 PUSHINT
}>
get_abi_ipfs PROC:<{
x{697066733a2f2f516d527a4c436235523255737742665a4277645878526d344d576d4834785957666b785066466d575a55416b5136} PUSHSLICE
x{697066733a2f2f516d59636d5a48696a473559384d4e77546f696a39364d4152454e74556a50587742684237514136647644434756} PUSHSLICE
}>
}END>c

2
sources/output/jetton_TONBWallet.pkg

File diff suppressed because one or more lines are too long

1
sources/output/jetton_TONBWallet.ts

@ -1861,6 +1861,7 @@ const TONBWallet_errors: { [key: number]: { message: string } } = {
6873: { message: `Only an admin can initiate a vote` },
13650: { message: `Invalid bounced message` },
16059: { message: `Invalid value` },
16994: { message: `Vote is finished` },
18474: { message: `only the owner can set a new owner` },
19362: { message: `Invalid quorum percent` },
29720: { message: `Invalid vote` },

44
sources/pseudostaking.deploy.ts

@ -0,0 +1,44 @@
import { beginCell, contractAddress, toNano, TonClient, TonClient4, Address, WalletContractV4, internal, fromNano, Cell} from "ton";
import {mnemonicToPrivateKey} from "ton-crypto";
import {buildOnchainMetadata} from "./utils/helpers";
import {client, wallet_data, workchain, owner, jettonParams, default_content} from "./utils/config";
import { PseudoStaking } from "./output/jetton_PseudoStaking";
(async () => {
let {my_wallet, secretKey} = await wallet_data(1);
// Get deployment wallet balance
let balance: bigint = await my_wallet.getBalance();
// Compute init data for deployment
let init = await PseudoStaking.init();
let destination_address = contractAddress(workchain, init);
let deployAmount = toNano('7');
// send a message on new address contract to deploy it
let seqno: number = await my_wallet.getSeqno();
console.log('🛠Preparing new outgoing massage from deployment wallet. Seqno = ', seqno);
console.log('Current deployment wallet balance = ', fromNano(balance).toString(), '💎TON');
await my_wallet.sendTransfer({
seqno,
secretKey,
messages: [internal({
value: deployAmount,
to: destination_address,
init: {
code : init.code,
data : init.data
},
body:
})]
});
console.log('======deployment message sent to ', destination_address, ' ======');
})();

9
sources/utils/config.ts

@ -16,6 +16,8 @@ let mnemonics = "basic security merge opera inject core melody polar become forc
let mnemonics2 = "road learn slow crucial mixed grunt copy ribbon coyote shrimp onion pledge any tornado rebel three glimpse winner bless thunder immune february coin egg"
// read more about wallet apps https://ton.org/docs/participate/wallets/apps#tonhub-test-environment
export const staking_addr = Address.parse('EQC5Y865mUcSTsSpJYbli0KmSiriJUBFHlKmvNqkS7T5V567');
export async function wallet_data(w: number = 0) {
let keyPair = await mnemonicToPrivateKey(mnemonics.split(" "));
let secretKey = keyPair.secretKey;
@ -40,15 +42,16 @@ export let workchain = 0; //we are working in basechain.
// - Data is stored on-chain (except for the image data itself)
export const jettonParams = {
name: "TONB DEMO",
description: "TON Banking",
name: "TON Banking",
description: "TON Banking (demo-1)",
// image: "https://ipfs.io/ipfs/QmbPZjC1tuP6ickCCBtoTCQ9gc3RpkbKx7C1LMYQdcLwti" // Image url
image: "https://cache.tonapi.io/imgproxy/gZXLNT_UkpFUSUUbTQsilCqwq_tXa4Kgmf55b5SmVQo/rs:fill:200:200:1/g:no/aHR0cHM6Ly90b24ub3JnL2Rvd25sb2FkL3Rvbl9zeW1ib2wucG5n.webp",
symbol: "TONB"
};
// Owner should usually be the deploying wallet's address.
export let owner = Address.parse('EQAuAiFGgkxoQvBWXjXQcLYb8BW4fO6UJkt6_uCONJ2y5VUk');
// export let owner = Address.parse('EQAuAiFGgkxoQvBWXjXQcLYb8BW4fO6UJkt6_uCONJ2y5VUk');
export let owner = Address.parse('EQD7zbEMaWC2yMgSJXmIF7HbLr1yuBo2GnZF_CJNkUiGSe32')
// Create content Cell

60
sources/utils/interactions.ts

@ -1,13 +1,13 @@
import { Cell, Address, internal, beginCell, contractAddress, toNano, fromNano, SendMode } from "ton";
import { storeDeposit, storeWithdraw, storeTokenTransfer, storeBlacklistWallet } from "../output/jetton_TONB";
import { storeDeposit, storeWithdraw, storeTokenTransfer, storeBlacklistWallet, storeVoteMsg } from "../output/jetton_TONB";
import { TON } from "./helpers";
import { wallet_data, owner, default_content, workchain, client } from './config';
import { TONB } from "../output/jetton_TONB";
import { TONBWallet } from '../output/jetton_TONBWallet';
import { Distribution, AddressList } from '../output/jetton_TONBWallet';
import { Dictionary } from 'ton-core';
import { PseudoStaking, storeSetOwner, storeInitiateBlacklistVote } from '../output/jetton_PseudoStaking';
import { Foundation } from '../output/jetton_Foundation';
import { PseudoStaking, storeSetOwner, storeInitiateBlacklistVote, storeFinishVote, RequestUnstake } from '../output/jetton_PseudoStaking';
import { Foundation, storeCollectProfit, storeRequestUnstake } from '../output/jetton_Foundation';
export async function sendMessage(wallet: any, secretKey: Buffer, msg: { value: string | bigint, to: Address, bounce?: boolean, init?: { code?: Cell, data?: Cell }, body?: any }) {
let seqno: number = await wallet.getSeqno();
@ -24,7 +24,7 @@ export async function deposit(wallet: any, secretKey: Buffer, value_: bigint | n
console.log('📤Sending deposit message to ', tonb, ' with value ', value_, '💎TON');
let value = BigInt(value_);
let msg_body_b = beginCell();
storeDeposit({amount: value as bigint, $$type: 'Deposit'})(msg_body_b);
storeDeposit({ amount: value as bigint, $$type: 'Deposit' })(msg_body_b);
let msg_body = msg_body_b.endCell();
// let msg_body = msg_body_b.storeUint(0x8999b164, 32).storeUint(value, 257).endCell();
let msg_value = value as bigint + toNano('0.1');
@ -38,19 +38,19 @@ export async function withdraw(wallet: any, secretKey: Buffer, value_: bigint |
let msg_body_b = beginCell();
storeWithdraw({ amount: value as bigint, $$type: 'Withdraw' })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('0.11');
let msg_value = toNano('0.2');
await sendMessage(wallet, secretKey, { value: msg_value, to: tonb, body: msg_body });
}
export async function transfer(wallet: any, secretKey: Buffer, value_: bigint | number, tonb: Address, to: Address) {
let value = BigInt(value_);
let msg_body_b = beginCell();
storeTokenTransfer({
amount: value as bigint, destination: to, queryId: 0n,
storeTokenTransfer({
amount: value as bigint, destination: to, queryId: 0n,
forwardTonAmount: 0n, $$type: 'TokenTransfer',
forwardPayload: beginCell().endCell(),
responseDestination: null, customPayload: null
})(msg_body_b);
})(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('0.11');
let wallet_addr = await getWalletAddress(tonb, wallet.address);
@ -97,7 +97,7 @@ export async function getTONB(owner2?: Address, tonb_content?: any, add_staking:
}
export async function getTONBOpen(tonb_content?: any, add_staking: boolean | Address = false) {
let tonb = await getTONB(tonb_content, add_staking);
let tonb = await getTONB(undefined, tonb_content, add_staking);
return client.open(tonb);
}
@ -106,7 +106,7 @@ export async function getFoundation(
admins?: Address[],
admin_percents?: bigint[],
founders?: Address[],
) {
) {
if (!admins) {
admins = [owner];
admin_percents = [100n];
@ -125,7 +125,7 @@ export async function getFoundationOpen(
admins?: Address[],
admin_percents?: bigint[],
founders?: Address[],
) {
) {
let foundation = await getFoundation(tonb_address, admins, admin_percents, founders);
return client.open(foundation);
}
@ -210,11 +210,47 @@ export async function changeTONBOwner(wallet: any, secretKey: Buffer, tonb: Addr
}
export async function createBlacklistVote(
wallet: any, secretKey: Buffer, foundation: Address, target: Address,
wallet: any, secretKey: Buffer, foundation: Address, target: Address,
vote_time: bigint, adminIndex: bigint, quorum_percent: bigint = 50n) {
let msg_body_b = beginCell();
storeInitiateBlacklistVote({ $$type: 'InitiateBlacklistVote', wallet: target, vote_time, adminIndex, quorum_percent })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('1.01');
await sendMessage(wallet, secretKey, { value: msg_value, to: foundation, body: msg_body });
}
export async function castVote(
wallet: any, secretKey: Buffer, foundation: Address, voteId: bigint, vote: bigint, adminIndex: bigint) {
let msg_body_b = beginCell();
storeVoteMsg({ $$type: 'VoteMsg', voteId, vote, adminIndex })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('0.05');
await sendMessage(wallet, secretKey, { value: msg_value, to: foundation, body: msg_body });
}
export async function finishVote(
wallet: any, secretKey: Buffer, foundation: Address, voteId: bigint) {
let msg_body_b = beginCell();
storeFinishVote({ $$type: 'FinishVote', voteId })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('1.05');
await sendMessage(wallet, secretKey, { value: msg_value, to: foundation, body: msg_body });
}
export async function requestUnstake(
wallet: any, secretKey: Buffer, foundation: Address, founderIndex: bigint) {
let msg_body_b = beginCell();
storeRequestUnstake({ $$type: 'RequestUnstake', founderIndex })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('0.05');
await sendMessage(wallet, secretKey, { value: msg_value, to: foundation, body: msg_body });
}
export async function collectProfit(
wallet: any, secretKey: Buffer, foundation: Address, adminIndex: bigint) {
let msg_body_b = beginCell();
storeCollectProfit({ $$type: 'CollectProfit', adminIndex })(msg_body_b);
let msg_body = msg_body_b.endCell();
let msg_value = toNano('0.05');
await sendMessage(wallet, secretKey, { value: msg_value, to: foundation, body: msg_body });
}
Loading…
Cancel
Save