|
|
|
@@ -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(); |