Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 857 Bytes

函数.md

File metadata and controls

47 lines (32 loc) · 857 Bytes

函数

# @version ^0.3.7


@external
@pure
def multiply(x: uint256, y: uint256) -> uint256:
    return x * y


@external
@pure
def divide(x: uint256, y: uint256) -> uint256:
    return x / y


# A funciton that does nothing
@external
def doNothing():
    # pass is useful when you want to compile the contract now,
    # write the code later
    pass


# Functions can return multiple outputs
@external
@pure
def multiOut() -> (uint256, bool):
    return (1, True)


@external
@pure
def addAndSub(x: uint256, y: uint256) -> (uint256, uint256):
    return (x + y, x - y)

关注我们

Yanbo的TwitterWeb3Club的Twitter

加入Web3Club 官方讨论群:YanboTravelAllWorld(微信号)

加入我们