Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
accounts.map(async (a) => {
balances[a] = {
[CeloContract.GoldToken]: await goldToken.balanceOf(a),
[CeloContract.StableToken]: await stableToken.balanceOf(a),
}
})
)
describe('when not explicitly specifying a gas fee recipient', () =>
testTransferToken({
expectedGas: GOLD_TRANSACTION_GAS_COST,
transferToken: CeloContract.GoldToken,
feeToken: CeloContract.GoldToken,
}))
describe('when not explicitly specifying a gas fee recipient', () =>
testTransferToken({
expectedGas: GOLD_TRANSACTION_GAS_COST,
transferToken: CeloContract.GoldToken,
feeToken: CeloContract.GoldToken,
}))
export async function getTokenAddresses() {
if (goldTokenAddress && stableTokenAddress) {
return { goldTokenAddress, stableTokenAddress }
} else {
const kit = await getContractKit()
goldTokenAddress = await kit.registry.addressFor(CeloContract.GoldToken)
stableTokenAddress = await kit.registry.addressFor(CeloContract.StableToken)
return { goldTokenAddress, stableTokenAddress }
}
}
async function getFeeCurrencyContractAddress(
kit: ContractKit,
feeCurrency: FeeCurrency
): Promise {
switch (feeCurrency) {
case FeeCurrency.cUSD:
return kit.registry.addressFor(CeloContract.StableToken)
case FeeCurrency.cGLD:
return kit.registry.addressFor(CeloContract.GoldToken)
default:
return kit.registry.addressFor(CeloContract.StableToken)
}
}