Web3 Voice🎙
0:4a4a2b20002bd599821d2b32a27d8bb4a0273247086e12c9f485376589d34ee5
0:8134e750d3cbc177227b0487273e5648ef44273c8c76f2fe705784d2dfcda9a4
0:673ac0f6fdb9be78fcb138d95156a34b7eb365e47f2b5deb750da80dffda11fc
npx sweetpie verify --network mainnet DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1"
npx sweetpie graph https://t.me/EverscaleGuild/117
TODO добавить подробности
git clone git@github.com:tonlabs/gosh.gitну использовали коварны и централизованный
github.comмайрасовфт и все такое, а теперь приближается тот замечательное и светлое будущие крипто-анархизма и децентрализации блокченов:
gosh[::<NETWORK>]://[<USER_ACCOUNT>@]GOSH_ROOT/REPO_NAME
git clone gosh::net.ton.dev://my-wallet@0:a6af961f2973bb00fe1d3d6cfee2f2f9c89897719c2887b31ef5ac4fd060638f/my-user-name/my-repo
https://github.com/tonlabs/gosh/tree/main/git-remote-gosh#setup-helper#pragma once
#include <tvm/schema/message.hpp>
#include <tvm/replay_attack_protection/timestamp.hpp>
#include <tvm/smart_switcher.hpp>
#include <tvm/contract_handle.hpp>
namespace tvm { inline namespace schema {
__interface ITradingPair {
[[internal, noaccept, answer_id]]
bool_t onDeploy(uint128 min_amount, uint128 deploy_value, address notify_addr) = 10;
// ========== getters ==========
[[getter]]
address getFlexAddr() = 11;
[[getter]]
address getTip3Root() = 12;
[[getter]]
uint128 getMinAmount() = 13;
[[getter]]
address getNotifyAddr() = 14;
};
using ITradingPairPtr = handle<ITradingPair>;
struct DTradingPair {
address flex_addr_;
address tip3_root_;
uint128 min_amount_; // minimum amount to buy/sell
address notify_addr_; // address for deals notifications
};
__interface ETradingPair {
};
// Prepare Trading Pair StateInit structure and expected contract address (hash from StateInit)
inline
std::pair<StateInit, uint256> prepare_trading_pair_state_init_and_addr(DTradingPair pair_data, cell pair_code) {
cell pair_data_cl = prepare_persistent_data<ITradingPair, void, DTradingPair>({}, pair_data);
StateInit pair_init {
/*split_depth*/{}, /*special*/{},
pair_code, pair_data_cl, /*library*/{}
};
cell pair_init_cl = build(pair_init).make_cell();
return { pair_init, uint256(tvm_hash(pair_init_cl)) };
}
}} // namespace tvm::schema
0:d4a698db78e27b8e8ccd3f75310feebe0f28370b1d8b401f3873804d24558b34
механика работы с ордерами сделан через дебота flexAPI, полагаю матчинг тоже будет через него
const {SERegistry} = require('everdev/dist/controllers/se/registry')
const {solidityCompileCommand} = require('everdev/dist/controllers/solidity')
const {SignerRegistry} = require('everdev/dist/controllers/signer/registry')
const {
TonClient,
signerKeys,
builderOpBitString,
builderOpCell,
} = require('@tonclient/core')
const {Account} = require('@tonclient/appkit')
const {StringTerminal, resolveContract} = require('everdev/dist/core/utils')
const {libNode} = require('@tonclient/lib-node')
const crypto = require('crypto')
TonClient.useBinaryLibrary(libNode)
/**
* @param client {TonClient}
* @returns {Promise<void>}
*/
async function main(client) {
const terminal = new StringTerminal()
// npx everdev se reset
await (new SERegistry).reset(terminal, '*')
// npx everdev sol compile --code --output-dir build App.sol
await solidityCompileCommand.run(terminal, {
outputDir: 'build',
file: 'App.sol',
code: true,
})
// npx everdev js wrap build/App
const AppArtifact = resolveContract('build/App')
// npx everdev signer info alice | jq .keys
const signer = signerKeys((new SignerRegistry).get('alice').keys)
// npx everdev contract deploy build/App --value 10000000000
const contract = new Account(AppArtifact.package, {signer, client})
await contract.deploy({useGiver: true})
// interact
const address = await contract.getAddress()
const balance = await contract.getBalance()
console.log(`Contract was deployed at address: ${address} with balance: ${balance}`)
const chose = 'foo'
const notice = 1
const data = `${chose}-${notice}`
console.log('chose:', chose, 'notice:', notice, 'data:', data)
console.log(
'tvm.hash(format("{}-{}", chose, notice)):',
(await contract.runLocal('tvmHashFormat', {chose, notice})).decoded.output.hash
)
console.log(
'tvm.hash(builder.toCell()):',
(await contract.runLocal('tvmHashBuilderToCell', {chose, notice})).decoded.output.hash
)
const encode = await TonClient.default.boc.encode_boc({
builder: [
builderOpCell([
builderOpBitString(
Buffer.from(data, 'utf8').toString('hex')
)
])
],
})
console.log('EverSDK.boc.get_boc_hash:', `0x${(await TonClient.default.boc.get_boc_hash(encode)).hash}`)
// printf '%s-%s' foo 1 | sha256sum | cut -d' ' -f1
console.log('NodeJs.crypto:', `0x${crypto.createHash('sha256').update(data).digest('hex')}`)
console.log('EverSDK.crypto.sha256:', `0x${(await TonClient.default.crypto.sha256({
data: Buffer.from(data).toString('base64'),
})).hash}`)
}
const client = new TonClient({
network: {
endpoints: ['http://localhost'],
}
})
main(client).then(() => {
process.exit(0)
}).catch((error) => {
if (error.code === 504) {
console.error(`Network is inaccessible`)
} else {
console.error(error)
}
process.exit(1)
})
Length body message
AppWithoutPragma:
- deploy: 121
- call put: 121
AppWithPragmaExpire:
- deploy: 129
- call put: 129
AppWithPragmaPubkey:
- deploy: 165
- call put: 165
AppWithPragmaPubkeyAndExpire:
- deploy: 169
- call put: 169
abi.rs — in the future, there will be a database of popular ABIs)MAX_QUEUED_REQUESTS = 5;https://github.com/tonlabs/ton-labs-contracts/blob/5ee039e4d093b91b6fdf7d77b9627e2e7d37f000/solidity/safemultisig/SafeMultisigWallet.sol#L48-L52
EXPIRATION_TIME = 3600; // lifetime is 1 hour
MAX_CUSTODIAN_COUNT = 32;
MIN_VALUE = 1e6;
MAX_CLEANUP_TXNS = 40;
EXPIRATION_TIME = 3600 lifetime transaction