View Fismo Storage

Methods

🦠 getLastPosition

Get the last recorded position of the given user.

Signature

function getLastPosition (
    address _user
)
external
view
returns (
    bool success, 
    FismoTypes.Position memory position
);

Arguments

Name Description Type
_user the address of the user address

Returns

Name Description Type
success whether any history exists for the user bool
position the last recorded position of the given user FismoTypes.Position

🦠 getPositionHistory

Get the entire position history for a given user.

Signature

function getPositionHistory (
    address _user
)
external
view
returns (
    bool success, 
    FismoTypes.Position[] memory history
);

Arguments

Name Description Type
_user the address of the user address

Returns

Name Description Type
success whether any history exists for the user bool
history an array of Position structs FismoTypes.Position[]

🦠 getUserState

Get the current state for a given user in a given machine.

Reverts if

  • Machine does not exist

Note

  • If the user has not interacted with the machine, the initial state for the machine is returned.

Signature

function getUserState (
    address _user, 
    bytes4 _machineId
)
external
view
returns (
    FismoTypes.State memory state
);

Arguments

Name Description Type
_user the address of the user address
_machineId the id of the machine bytes4

Returns

Name Type Description
state FismoTypes.State the user’s current state in the given machine

🦠 getMachineURI

Get the off-chain metadata URI for the given machine.

Reverts if

  • Machine does not exist

Signature

function getMachineURI(bytes4 _machineId)
external
view
returns (string memory uri);

Arguments

Name Description Type
_machineId the id of the machine bytes4

Returns

Name Description Type
uri the URI for the given machine string