šŸŽ‰ Welcome to PartyFinance documentation!
Protocol
Contracts
libraries
LibSignatures

LibSignatures

Sig

struct Sig {
  bytes32 r;
  bytes32 s;
  uint8 v;
}

Allocation

struct Allocation {
  address[] sellTokens;
  uint256[] sellAmounts;
  address[] buyTokens;
  address[] spenders;
  address payable[] swapsTargets;
  bytes[] swapsCallData;
  uint256 partyValueDA;
  uint256 partyTotalSupply;
  uint256 expiresAt;
}

recover

function recover(bytes32 _hash, bytes _signature) internal pure returns (address)

Returns the address that signed a hashed message with a signature

getMessageHash

function getMessageHash(bytes _abiEncoded) internal pure returns (bytes32)

Returns an Ethereum Signed Message.

Produces a hash corresponding to the one signed with the eth_sign JSON-RPC method (opens in a new tab) as part of EIP-191.

isValidAllocation

function isValidAllocation(address user, address signer, struct LibSignatures.Allocation allocation, struct LibSignatures.Sig rsv) internal view returns (bool)

Verifies the tx signature against the PartyFi Sentinel address

Used by the deposit, join, kick, leave and swap actions

Parameters

NameTypeDescription
useraddressThe user involved in the allocation
signeraddressThe PartyFi Sentinel singer address
allocationstruct LibSignatures.AllocationThe allocation struct to verify
rsvstruct LibSignatures.SigThe values for the transaction's signature