Solidity 046 Mathmatics

// SPDX-License-Identifier: GPL-3.0

pragma solidity >=0.7.0 <0.9.0;

// Import the interface IMath from the IMath.sol file.

// This interface should declare the function signatures that the Mathematics contract will implement.

import "./IMath.sol";

// The Mathematics contract implements the IMath interface.

contract Mathematics is IMath {

   

    // Implements the getSquare function from the IMath interface.

    // Calculates and returns the square of a given number.

    // @param value The number to square.

    // @return uint256 The square of the input value.

    function getSquare(uint256 value) external pure override returns (uint256) {

        return value ** 2;

    }

}

你可能感兴趣的:(智能合约,区块链,信任链,去中心化,分布式账本)