MCPcopy Create free account
hub / github.com/cardstack/cardstack / makeToken

Function makeToken

packages/cardpay-subgraph/src/utils.ts:26–36  ·  view source on GitHub ↗
(address: Address)

Source from the content-addressed store, hash-verified

24export let protocolVersions = new Map<string, i32>();
25
26export function makeToken(address: Address): string {
27 let token = toChecksumAddress(address);
28 if (Token.load(token) == null) {
29 let tokenEntity = new Token(token);
30 tokenEntity.symbol = fetchTokenSymbol(address);
31 tokenEntity.name = fetchTokenName(address);
32 tokenEntity.decimals = fetchTokenDecimals(address);
33 tokenEntity.save();
34 }
35 return token;
36}
37
38export function makeTransaction(event: ethereum.Event): void {
39 let txEntity = new Transaction(event.transaction.hash.toHex());

Callers 10

handleMerchantClaimFunction · 0.90
handleMerchantPaymentFunction · 0.90
handleMerchantFeeFunction · 0.90
handleExecutionSuccessFunction · 0.90
handleNewPairFunction · 0.90
handleTransferFunction · 0.90
handleCreatePrepaidCardFunction · 0.90
handleSentBridgedTokensFunction · 0.90

Calls 5

toChecksumAddressFunction · 0.85
fetchTokenSymbolFunction · 0.85
fetchTokenNameFunction · 0.85
fetchTokenDecimalsFunction · 0.85
saveMethod · 0.45

Tested by

no test coverage detected