Sepcial roles for ESDT
Set special roles for ESDT tokens using JS SDK based on a real-life example
What are the ESDT special roles
ESDT special roles and JS SDK
const args: TypedValue[] = [
BytesValue.fromUTF8(ticker),
new AddressValue(new Address(address.trim())),
];
for (const role of esdtTokenSpecialRoles) {
if (specialRoles.includes(role)) {
args.push(BytesValue.fromUTF8(role));
}
}
const data = new ContractCallPayloadBuilder()
.setFunction(new ContractFunction('setSpecialRole'))
.setArgs(args)
.build();
const tx = new Transaction({
data,
gasLimit: esdtOpertationsGasLimit,
receiver: new Address(builtInEsdtSC.trim()),
value: 0,
chainID: shortChainId[chain],
});Sign and send the transaction
Summary
Last updated
Was this helpful?