Skip to content

Commit

Permalink
Merge pull request #568 from lukso-network/abi/lsp6
Browse files Browse the repository at this point in the history
add LSP6 ABI Technical reference
  • Loading branch information
CJ42 authored Jul 11, 2023
2 parents a85771d + 57662df commit bcd6e7b
Show file tree
Hide file tree
Showing 9 changed files with 1,010 additions and 292 deletions.
986 changes: 986 additions & 0 deletions docs/contracts/contracts/LSP6KeyManager/LSP6KeyManager.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/contracts/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The **Universal Profile** contracts allow a better representation of the identit

- **[LSP0ERC725Account](../standards/smart-contracts/lsp0-erc725-account.md)**: a contract that can be used as an account and represents an **identity on-chain**.
- **[LSP1UniversalReceiverDelegateUP](./contracts/LSP1UniversalReceiver/LSP1UniversalReceiverDelegateUP/LSP1UniversalReceiverDelegateUP.md)**: a contract that allows the account to react to the calls that it receives (Normal transaction, Token transfer, Vaults transfer, etc.).
- **[LSP6KeyManager](../standards/smart-contracts/lsp6-key-manager.md)**: a contract that allows **multi-control** over the account using different permissions.
- **[LSP6KeyManager](../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md)**: a contract that allows **multi-control** over the account using different permissions.
- **LSP11BasicSocialRecovery**

### Digital Assets
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/key-manager/execute-relay-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ const keyManager = new ethers.Contract(

### Step 3 - Prepare the relay call parameters

Get the `nonce` of the controller key from the KeyManager by instantiating the KeyManager smart contract instance and calling the [`getNonce`](../../standards/smart-contracts/lsp6-key-manager.md#getnonce) function.
Get the `nonce` of the controller key from the KeyManager by instantiating the KeyManager smart contract instance and calling the [`getNonce`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#getnonce) function.

The `channelId` is used to prevent nonce conflicts when multiple apps send transactions to the same KeyManager at the same time. Read more about [out of order execution here](../../standards/universal-profile/lsp6-key-manager.md#out-of-order-execution).

Expand Down Expand Up @@ -288,7 +288,7 @@ let { signature } = await eip191Signer.signDataWithIntendedValidator(

</Tabs>

Now the `signature`, `abiPayload`, `nonce`, `validityTimestamps` and `keyManagerAddress` can be sent to a third party to execute the transaction using [`executeRelayCall`](../../standards/smart-contracts/lsp6-key-manager#executerelaycall).
Now the `signature`, `abiPayload`, `nonce`, `validityTimestamps` and `keyManagerAddress` can be sent to a third party to execute the transaction using [`executeRelayCall`](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall).

## Execute via `executeRelayCall`

Expand Down Expand Up @@ -347,7 +347,7 @@ const executeRelayCallTransaction = await keyManager

:::tip LSP6KeyManager executeRelayCall

You can find more information about the [LSP6KeyManager `executeRelayCall` here](../../standards/smart-contracts/lsp6-key-manager#executerelaycall).
You can find more information about the [LSP6KeyManager `executeRelayCall` here](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall).

:::

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/universal-profile/create-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ In the context of Universal Profile, _reading data from the contract storage can
- `execute(...)` = transfer LYX to addresses, call other contracts, or create and deploy new contracts (see [ERC725X](../../standards/universal-profile/lsp0-erc725account#erc725x---generic-executor) executor)
- `transferOwnership(...)` = make an address be the new owner of the Universal Profile.

In this guide, our Universal Profile's owner will be a contract called a **Key Manager**. The [Key Manager](../../standards/smart-contracts/lsp6-key-manager.md) is a smart contract that enables granting specific permissions to `addresses`, so that they can interact with the Universal Profile. For example, transferring LYX on behalf of the Universal Profile.
In this guide, our Universal Profile's owner will be a contract called a **Key Manager**. The [Key Manager](../../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md) is a smart contract that enables granting specific permissions to `addresses`, so that they can interact with the Universal Profile. For example, transferring LYX on behalf of the Universal Profile.

:::info Learn More
You can implement any complex ownership structure (and fine-grained control) on top of Universal Profiles. The structure includes having a UP owned and controlled by:
Expand Down
3 changes: 2 additions & 1 deletion docs/standards/relayer-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import TabItem from '@theme/TabItem';

## POST `/execute`

Executes a signed transaction on behalf of a Universal Profile using [`executeRelayCall()`](./smart-contracts/lsp6-key-manager#executerelaycall).
Executes a signed transaction on behalf of a Universal Profile using [`executeRelayCall()`](../contracts/contracts/LSP6KeyManager/LSP6KeyManager.md#executerelaycall).

- Use signed message provided in request for authentication.
- Calculate and return the transaction hash in response.
Expand Down Expand Up @@ -39,6 +39,7 @@ Returns the available quota left for a registered Universal Profile.
- `signature` is the message value signed by a controller key with the [`SIGN` permission](./universal-profile/lsp6-key-manager#permissions) of the Universal Profile. The hash to sign should be calculated as [EIP-712](https://eips.ethereum.org/EIPS/eip-712) hash where the message is `keccack256(address, timestamp)`. Make sure that no matter the language or platform timestamp is of type `int`, `int256`, `uint` or `uint256`. In the backend the message is reconstructed using [soliditysha3()](https://web3js.readthedocs.io/en/v1.7.4/web3-utils.html#soliditysha3) to verify the signature.

[Web3.js](https://web3js.readthedocs.io/en/v1.8.0/web3-eth-accounts.html?#sign) and [ethers.js](https://docs.ethers.io/v5/api/signer/#Signer-signMessage) both automatically hash when using their native sign functions. This may need to be done manually if using a different library.

- `timestamp` in **seconds**. Must be now +/- 5 seconds.

<details>
Expand Down
273 changes: 0 additions & 273 deletions docs/standards/smart-contracts/lsp6-key-manager.md

This file was deleted.

Loading

0 comments on commit bcd6e7b

Please sign in to comment.