Logo: N.A.
Name: GigaCommunis
Ticker Symbol: N.A.
Network: Ethereum
Contract Address: 0x947203E20813e4f7757fb2304fd1E34eDC3c4FF9
Purpose: gCOMM is developed as wrapping contract for COMM token. Every 1e9 COMM token equals one gCOMM token.
Project URL: https://app.hexpay.day/1/communis/giga
Project social media: N.A.
Contract Source Code: Link
Audit(s): NIL

REVIEWED BY: Elmyre

Preface:

This is a complete review of the Giga Communis smart contract project based on the available code in https://etherscan.io/address/0x947203e20813e4f7757fb2304fd1e34edc3c4ff9#code.

Even though the code is simple, I would advise anyone that is reading this document to also look at other reviews and analysis of the contract! Some issues or security concerns might not be covered here due to my lack of knowledge and understanding, so getting a second opinion is a good thing to keep in mind! This review is based on the deployed version of the code.

Code Review:

The GigaCommunis smart contract was developed to act as a wrapping contract for the COMM token (I assume so user have to deal with a lower amount of token units). It provides functionality for minting (wrapping), burning (unwrapping) and trimming tokens. It also incorporates safety measures to handle excess balances and prevent potential issues.

It inherits from two OpenZeppelin contracts:

  • ERC20sol (@OpenZeppelin/openzeppelin-contracts/blob/v5.0.0/contracts/token/ERC20/ERC20.sol).
  • Multicall.sol (@OpenZeppelin/openzeppelin-contracts/blob/v5.0.0/contracts/utils/Multicall.sol).

These are widely used for creating ERC-20 tokens. They provide basic token functionality, and the ability to receive and execute a batch of function calls in a single transaction. The contract itself is very simple and has barely any functionality.

The Constructor, on deployment, initializes the contract with the name “Giga Communis” and symbol “gCOMM“.

  • Constants:
    • COMM: The Communis token contract address – 0x5A9780Bfe63f3ec57f01b087cD65BD656C9034A8
    • GIGA: The number representing 10003.
  • Public Functions:
    • decimals: Pure override function that returns the number of decimal places for the token. It overrides the default value for ERC20 tokens by setting it to 12.
  • External Functions:
    • mint: Mints a given amount of Giga Communis tokens to the user after transferring the specified amount of COMM tokens from him to the contract. This acts as a wrapping function for the COMM tokens.
    • mintFromExcess: Mints Giga Communis tokens to a given address based on the excess COMM tokens held by the contract. Uses the _excess function for the calculation.
    • burn: Burns a given amount of Giga Communis tokens to the user (sender) and transfers him the corresponding amount of COMM tokens held by the contract. This acts as an unwrapping function for the COMM tokens. The burning is made via the _burnTo function.
    • burnFrom: Similar to burn but can be executed by another address other than the COMM tokens holder based on a spending allowance. It matches the behaviour of the ERC20Burnable.burnFrom implementation from OpenZepplin.
    • burnFromExcess: Burns a specified number of Giga Communis tokens held by the contract.
    • trim: Allows removing surplus tokens from the contract by transferring a specified amount of a given token to a specified recipient. If the token happens to be the COMM token, the amount to be removed is limited to the outstanding amount. Uses the _excess function for the calculation.
    • excess: View function that exposes the _excess function to check the balances available for trimming.
  • Internal Functions:
    • _burnTo: Burns a specified number of Giga Communis tokens (amount) from the payer address and transfers the corresponding amount of COMM tokens to the recipient address.
    • _excess: View function that checks for excess balances of a given token and returns that value. If the token is COMM, the withdrawal limit is to the total COMM balance in the contract minus the total supply of Giga Communis times GIGA (Comm.balance – GigaComm.balance * GIGA). This is to make sure there that every GIGA Communis token in circulation actually matches the amount of COMM tokens locked in the contract.

Conclusion & Security Concerns:

The contract has no owner-only functions or special privileges, and the total supply is purely dependent on the amount of COMM tokens locked into the contract, acting like a wrapped version of it.

The contract also allows for the recovery of any unintended tokens sent to the contract via the trim function by any address which is a great feature most contracts don’t have.

No bugs or other security risks were found, and the code looks to be functioning as intended!

Economically, one can speculate that its value will be based on the COMM tokens value but that is beyond the scope of this review.

B9.xyz IS NOT OPTIMIZED TO BE VIEWED USING THE CURRENT RESOLUTION. IF YOU ARE USING A MOBILE PHONE, PLEASE ROTATE AND USE LANDSCAPE MODE.

Scroll to Top