Skip to content

Commit

Permalink
Merge branch 'main' into feature/learn
Browse files Browse the repository at this point in the history
  • Loading branch information
fhildeb committed Oct 23, 2023
2 parents 31ec5b9 + 289661d commit 13ed188
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docs/guides/digital-assets/read-asset-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import Web3 from 'web3';
// Static variables
const SAMPLE_PROFILE_ADDRESS = '0xa907c1904c22DFd37FF56c1f3c3d795682539196';
const RPC_ENDPOINT = 'https://rpc.l16.lukso.network';
const IPFS_GATEWAY = 'https://2eff.lukso.dev/ipfs/';
const IPFS_GATEWAY = 'https://api.universalprofile.cloud/ipfs';

// Parameters for the ERC725 instance
const provider = new Web3.providers.HttpProvider(RPC_ENDPOINT);
Expand Down Expand Up @@ -106,7 +106,7 @@ import Web3 from 'web3';
// Static variables
const SAMPLE_PROFILE_ADDRESS = '0x0C03fBa782b07bCf810DEb3b7f0595024A444F4e';
const RPC_ENDPOINT = 'https://rpc.l14.lukso.network';
const IPFS_GATEWAY = 'https://2eff.lukso.dev/ipfs/';
const IPFS_GATEWAY = 'https://api.universalprofile.cloud/ipfs';

// Parameters for the ERC725 instance
const provider = new Web3.providers.HttpProvider(RPC_ENDPOINT);
Expand Down Expand Up @@ -231,7 +231,7 @@ import Web3 from 'web3';
// Static variables
const SAMPLE_PROFILE_ADDRESS = '0xa907c1904c22DFd37FF56c1f3c3d795682539196';
const RPC_ENDPOINT = 'https://rpc.l16.lukso.network';
const IPFS_GATEWAY = 'https://2eff.lukso.dev/ipfs/';
const IPFS_GATEWAY = 'https://api.universalprofile.cloud/ipfs';

// Parameters for the ERC725 instance
const provider = new Web3.providers.HttpProvider(RPC_ENDPOINT);
Expand Down Expand Up @@ -297,7 +297,7 @@ import LSP1MinimalABI from './lsp1_legacy_minimal_abi.json';
// Static variables
const SAMPLE_PROFILE_ADDRESS = '0x0C03fBa782b07bCf810DEb3b7f0595024A444F4e';
const RPC_ENDPOINT = 'https://rpc.l14.lukso.network';
const IPFS_GATEWAY = 'https://2eff.lukso.dev/ipfs/';
const IPFS_GATEWAY = 'https://api.universalprofile.cloud/ipfs';

// Parameters for the ERC725 instance
const provider = new Web3.providers.HttpProvider(RPC_ENDPOINT);
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const provider = new Web3.providers.HttpProvider(

const erc725 = new ERC725(schema, myUPAddress, provider);
const config = {
ipfsGateway: 'https://2eff.lukso.dev/ipfs/',
ipfsGateway: 'https://api.universalprofile.cloud/ipfs',
};

const data = await erc725.fetchData();
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/universal-profile/edit-profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async function editProfileInfo() {
];

const erc725 = new ERC725(schema, profileAddress, web3.currentProvider, {
ipfsGateway: 'https://2eff.lukso.dev/ipfs/',
ipfsGateway: 'https://api.universalprofile.cloud/ipfs',
});

// Step 3.2 - Encode the LSP3Profile data
Expand Down Expand Up @@ -421,7 +421,7 @@ async function editProfileInfo() {
];

const erc725 = new ERC725(schema, profileAddress, web3.currentProvider, {
ipfsGateway: 'https://2eff.lukso.dev/ipfs/',
ipfsGateway: 'https://api.universalprofile.cloud/ipfs',
});

// Step 3.2 - Encode the LSP3Profile data (to be written on our UP)
Expand Down
9 changes: 5 additions & 4 deletions docs/learn/dapp-developer/siwe.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const accounts = await web3.eth.getAccounts();

## Sign the message

Once you have access to the Universal Profile address, you can request a signature. The UP Browser Extension will sign the message with the controller key used by the extension (a smart contract can't sign).
Once you have access to the Universal Profile address, you can request a signature. The UP Browser Extension will sign the message with the controller key used by the extension (a smart contract can't sign by itself).
:::tip
If you need further explanation on the `SiWeMessage` properties, please have a look at the [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) specification.
If you need further explanation on the `SiweMessage` properties, please have a look at the [EIP-4361](https://eips.ethereum.org/EIPS/eip-4361) specification.
:::

```js
Expand Down Expand Up @@ -98,10 +98,11 @@ Resources:

Your Dapp has now received a message signed by the controller address of the Universal Profile. To finalise the login, you need to verify if the message was signed by an address which has the `SIGN` permission for this UP.

To do so, you can use the [`isValidSignature(...)`](../../contracts/contracts/UniversalProfile.md#isvalidsignature) function to check if the signature was signed ([EIP-1271](https://eips.ethereum.org/EIPS/eip-1271)) by an EOA that has the [`SIGN` permission](../../standards/universal-profile/lsp6-key-manager#permissions) over the Universal Profile.
To do so, you can use the [`isValidSignature(...)`](../../contracts/contracts/UniversalProfile.md#isvalidsignature) function ([EIP-1271](https://eips.ethereum.org/EIPS/eip-1271)) to check the signature.

```js
// If the signature is valid it should return the succes value 0x1626ba7e, then, the message was signed by an EOA which has a SIGN permission for this Universal Profile.
// If the signature is valid it should return the succes value 0x1626ba7e.
// Then, the message was signed by an EOA which has a SIGN (https://github.com/lukso-network/standards/universal-profile/lsp6-key-manager#permissions)permission for this Universal Profile.
// For additional details, check https://eips.ethereum.org/EIPS/eip-1271
const isValidSignature = await myUniversalProfileContract.methods
.isValidSignature(hashedMessage, signature)
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function Index() {
<CallToActionButton
bgColor="#FFCCCC"
color="#383838"
link="./networks/mainnet/running-a-node"
text="PARTICIPATE IN NETWORKS"
link="https://app.buidlbox.io/lukso/build-up-2"
text="JOIN THE HACKATHON (30 Oct - 27 Nov)"
/>
<br />
<div className={styles.cardContainer}>
Expand Down
Binary file added static/img/learn/siwe1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/learn/siwe2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 13ed188

Please sign in to comment.