Simon Lee 1 year ago
parent
commit
a2bf0c3ee8
2 changed files with 39 additions and 6 deletions
  1. 2
    2
      TC2/start.ts
  2. 37
    4
      TC9/start.ts

+ 2
- 2
TC2/start.ts View File

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


async function main() { 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(); main();

+ 37
- 4
TC9/start.ts View File

chainId: 1337 chainId: 1337
} }
); );
const signed = await signer.signTransaction(tx); const signed = await signer.signTransaction(tx);
return signed; 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(); const calc = new Calulator();
const holder2 = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',provider); const holder2 = new Wallet('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',provider);


async function main() { 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); // const tx = await getTransferData('test001',holder2, holder1,1);
// console.log(tx); // 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(); main();

Loading…
Cancel
Save