Simon Lee 1年前
父节点
当前提交
9f820b509f
共有 4 个文件被更改,包括 35 次插入20 次删除
  1. 10
    10
      .env
  2. 2
    2
      TC2/start.ts
  3. 3
    3
      TC3/start.ts
  4. 20
    5
      TC9/start.ts

+ 10
- 10
.env 查看文件

# CHAINID=1337 # CHAINID=1337


#OCI #OCI
# RPCURL=http://193.123.252.127:80
# CHAINID=1337
# GATE_WAY=https://api.stopulse.co.kr/main/v1/
# GATE_WAY_RAW=https://api.stopulse.co.kr/
# AUTHTOKEN=580c6006687220df84f83d7c345c00ad9829de0694bd00c09e211d8c810b7510
RPCURL=http://193.123.252.127:80
CHAINID=1337
GATE_WAY=http://api.stopulse.co.kr/main/v1/
GATE_WAY_RAW=http://api.stopulse.co.kr/
AUTHTOKEN=580c6006687220df84f83d7c345c00ad9829de0694bd00c09e211d8c810b7510






#dev #dev
RPCURL=http://193.123.252.127:80
CHAINID=1337
GATE_WAY=http://172.25.1.108/main/v1/
GATE_WAY_RAW=http://172.25.1.108/
AUTHTOKEN=18851850e4237cc34ea0a7a1de7cb5af362ee854363b60983ed4c18d9b12cb27
# RPCURL=http://193.123.252.127:80
# CHAINID=1337
# GATE_WAY=http://172.25.1.108/main/v1/
# GATE_WAY_RAW=http://172.25.1.108/
# AUTHTOKEN=18851850e4237cc34ea0a7a1de7cb5af362ee854363b60983ed4c18d9b12cb27







+ 2
- 2
TC2/start.ts 查看文件



let proms = []; let proms = [];
for(let i = 0; i < count; i++) { for(let i = 0; i < count; i++) {
console.log(`sending ${i} , nonce : ${signedData[i].nonce}`);
//console.log(`sending ${i} , nonce : ${signedData[i].nonce}`);
proms.push(send(signedData[i].sig)); proms.push(send(signedData[i].sig));
} }




async function main() { async function main() {
//spareToken('BCG_TEST'); //spareToken('BCG_TEST');
transfer(holder1,'BCG_TEST',holder2, holder1,1, 4);
transfer(holder1,'BCG_TEST',holder2, holder1,1, 1000);
} }


main(); main();

+ 3
- 3
TC3/start.ts 查看文件

console.log(`목적 서버 : ${gateWay}`); console.log(`목적 서버 : ${gateWay}`);


async function main() { async function main() {
//await readHealth('BCG_TEST',holder1,1000);
await readTest('BCG_TEST',holder1,5000);
// await readHealth('BCG_TEST',holder1,1000);
await readTest('BCG_TEST',holder1,1000);
} }


main(); main();




+ 20
- 5
TC9/start.ts 查看文件

import * as dotevnv from "dotenv" import * as dotevnv from "dotenv"
import {toUtf8String,parseUnits,ContractFactory, parseEther,JsonRpcProvider, Contract, JsonRpcSigner, Wallet,ContractTransactionResponse, MaxInt256 import {toUtf8String,parseUnits,ContractFactory, parseEther,JsonRpcProvider, Contract, JsonRpcSigner, Wallet,ContractTransactionResponse, MaxInt256
,Transaction,formatEther, ,Transaction,formatEther,
ZeroHash,ethers,keccak256
ZeroHash,ethers,keccak256,id
} from 'ethers' } from 'ethers'
import chalk from "chalk"; import chalk from "chalk";
import {Calulator} from "../inc/calc"; import {Calulator} from "../inc/calc";
return signed; return signed;
} }


async function getOperatorGrantData(symbol:string,from: Wallet, to: Wallet, amount: number = 1): Promise<any> {
async function getOperatorGrantData(symbol:string,signer:Wallet,tobeOperator: Wallet): Promise<any> {
const proxy = getDeploymentAddresses(symbol).address; const proxy = getDeploymentAddresses(symbol).address;
console.log(`토큰 주소 : ${proxy}`); console.log(`토큰 주소 : ${proxy}`);
let nonce = await getNonce(signer.address);
const token = new SecurityToken__factory(issuer).attach(proxy) as SecurityToken; const token = new SecurityToken__factory(issuer).attach(proxy) as SecurityToken;
//ret = await adminToken.grantRole( id('OPERATOR_ROLE'),tobeOperator,{ gasLimit: 20000000});

const tx = await token.grantRole.populateTransaction(
id('OPERATOR_ROLE'),tobeOperator,
{
gasLimit: 2100000,
nonce: nonce,
type: 2,
chainId: 1337
}
);
const signed = await signer.signTransaction(tx);
return signed;
} }


const calc = new Calulator(); const calc = new Calulator();
const holder2 = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',provider); const holder2 = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',provider);


async function main() { async function main() {
const tx = await getTransferData('test001',holder2, holder1,1);
// const tx = await getTransferData('test001',holder2, holder1,1);
// console.log(tx);

const tx = await getOperatorGrantData('test001',signer,holder2);
console.log(tx); console.log(tx);


} }

正在加载...
取消
保存