Skip to content

Commit

Permalink
improvement: contract
Browse files Browse the repository at this point in the history
  • Loading branch information
as-iotex committed Apr 17, 2022
1 parent 714a008 commit b320b68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ IOTEX_SIGNATURE_C_STRING_SIZE LITERAL1
IOTEX_CONTRACT_ENCODED_FUNCTIONSELECTOR_SIZE LITERAL1
IOTEX_CONTRACT_ENCODED_TOTALSUPPLY_SIZE LITERAL1
IOTEX_CONTRACT_ENCODED_TRANSFER_SIZE LITERAL1
IOTEX_CONTRACT_ENCODED_BALANCEOF_SIZE LITERAL1
6 changes: 4 additions & 2 deletions src/contract/xrc20Contract.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#include "IoTeXConstants.h"

#define IOTEX_CONTRACT_ENCODED_FUNCTIONSELECTOR_SIZE 4
#define IOTEX_CONTRACT_ENCODED_TOTALSUPPLY_SIZE 36
#define IOTEX_CONTRACT_ENCODED_TOTALSUPPLY_SIZE 4
#define IOTEX_CONTRACT_ENCODED_BALANCEOF_SIZE 36
#define IOTEX_CONTRACT_ENCODED_TRANSFER_SIZE 68

namespace iotex
Expand All @@ -19,7 +20,8 @@ class Xrc20Contract
*
* @param[out] data The buffer where the data is stored
*/
static void generateCallDataForTotalSupply(uint8_t data[4]);
static void
generateCallDataForTotalSupply(uint8_t data[IOTEX_CONTRACT_ENCODED_TOTALSUPPLY_SIZE]);

/**
* @brief Generates the Ethereum ABI encoded data for calling the balanceOf() function of a
Expand Down

0 comments on commit b320b68

Please sign in to comment.