Simon Lee 1年前
父节点
当前提交
a2bf0c3ee8
共有 2 个文件被更改,包括 39 次插入6 次删除
  1. 2
    2
      TC2/start.ts
  2. 37
    4
      TC9/start.ts

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

@@ -261,8 +261,8 @@ const holder2 = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae
console.log(`목적 서버 : ${gateWay}`);

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

main();

+ 37
- 4
TC9/start.ts 查看文件

@@ -67,10 +67,32 @@ async function getOperatorGrantData(symbol:string,signer:Wallet,tobeOperator: Wa
chainId: 1337
}
);
const signed = await signer.signTransaction(tx);
return signed;
}

async function revokeOperator(symbol: string, address: string): Promise<any> {

const proxy = getDeploymentAddresses(symbol).address;
console.log(`토큰 주소 : ${proxy}`);
let nonce = await getNonce(signer.address);
const token = new SecurityToken__factory(admin).attach(proxy) as SecurityToken;

console.log('....');
const ret = await token.revokeRole( id('OPERATOR_ROLE'),address,{ gasLimit: 20000000});
await ret.wait();
console.log(`operator ${address} revoked..`)

}

async function printOperator(symbol: string) {
const proxy = getDeploymentAddresses(symbol).address;
console.log(`토큰 주소 : ${proxy}`);
const token = new SecurityToken__factory(issuer).attach(proxy) as SecurityToken;

console.log(chalk.green('등록된 오퍼레이터 목록'));
const ops = await token.operators();
console.log(ops);
}

const calc = new Calulator();
@@ -86,12 +108,23 @@ const holder1 = new Wallet('0xae6ae8e5ccbfb04590405997ee2d52d2b330726137b875053c
const holder2 = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',provider);

async function main() {

console.log(admin.address);
console.log(issuer.address);
console.log(holder1.address);
console.log(holder2.address);


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

const tx = await getOperatorGrantData('test001',signer,holder2);
console.log(tx);
// console.log('holder2를 오퍼레이터로 등록하는 txData');
// const tx = await getOperatorGrantData('test001',admin,holder2);
// console.log(tx);

await revokeOperator('test001',holder2.address);
await printOperator('test001');
}

main();

正在加载...
取消
保存