Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: SIWE tutorial and Solidity polishes #459

Merged
merged 4 commits into from
Jan 31, 2025
Merged

Conversation

matevz
Copy link
Member

@matevz matevz commented Nov 22, 2024

Fixes #338

Solidity sapphire-contracts related updates:

  • changes calldata bearer to bytes bearer so it can be passed as empty, if none available (e.g. in case you want to call a common isContractOwner() modifier in your setter methods where you don't use SIWE, but msg.sender directly)
  • renames bearer to authToken because the bearer token uses a specialized format which we don't
  • prepends Auth before auth-related errors so they are more unique in the complex contracts

PREVIEW

Future TODO

Could we adopt ERC-2771 naming conventions and flow? Replacing authMsgSender() with _msgSender is one option. What about appending the token after the calldata? ERC-2771 uses this for transactions, but would this work for the queries too? Can you use ERC-2771 seamlessly like writing myContract.getSomeSensitiveInfo() in your client code without special hacks involving appending the authToken at the end of callData manually each time?

@matevz matevz changed the title Matevz/docs/siwe tutorial docs: SIWE tutorial Nov 22, 2024
Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for oasisprotocol-sapphire-paratime canceled.

Name Link
🔨 Latest commit ff3722e
🔍 Latest deploy log https://app.netlify.com/sites/oasisprotocol-sapphire-paratime/deploys/679ce0052bb0a20009a60d91

@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch 4 times, most recently from 0c345f4 to 64b3602 Compare November 25, 2024 15:59
@matevz matevz marked this pull request as ready for review November 25, 2024 15:59
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch from 64b3602 to ea39756 Compare November 25, 2024 15:59
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch 2 times, most recently from ffd51aa to 6538060 Compare November 25, 2024 16:19
docs/authentication.md Outdated Show resolved Hide resolved
@matevz matevz requested a review from aefhm November 26, 2024 08:45
contracts/contracts/auth/A13e.sol Outdated Show resolved Hide resolved
contracts/contracts/auth/SiweAuth.sol Outdated Show resolved Hide resolved
contracts/contracts/auth/SiweAuth.sol Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
docs/authentication.md Outdated Show resolved Hide resolved
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch from 6538060 to a581f82 Compare January 7, 2025 16:35
contracts/contracts/auth/SiweAuth.sol Outdated Show resolved Hide resolved
contracts/contracts/auth/A13e.sol Outdated Show resolved Hide resolved
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch 3 times, most recently from 78f0b9d to 3daa8d0 Compare January 31, 2025 11:46
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch from 3daa8d0 to 50a1a75 Compare January 31, 2025 11:58
@matevz matevz requested a review from rube-de January 31, 2025 11:59
@matevz matevz changed the title docs: SIWE tutorial docs: SIWE tutorial and Solidity polishes Jan 31, 2025
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch from 50a1a75 to 1339038 Compare January 31, 2025 12:06
Copy link
Contributor

@rube-de rube-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Only small comment to prefix style.

contracts/contracts/auth/SiweAuth.sol Outdated Show resolved Hide resolved
@matevz matevz force-pushed the matevz/docs/siwe-tutorial branch from 1339038 to ff3722e Compare January 31, 2025 14:36
@matevz matevz merged commit 7b688e7 into main Jan 31, 2025
12 checks passed
@matevz matevz deleted the matevz/docs/siwe-tutorial branch January 31, 2025 14:51
github-actions bot added a commit that referenced this pull request Jan 31, 2025
…l/matevz/docs/siwe-tutorial

docs: SIWE tutorial and Solidity polishes 7b688e7
github-actions bot added a commit that referenced this pull request Jan 31, 2025
…atevz/docs/siwe-tutorial

docs: SIWE tutorial and Solidity polishes 7b688e7
github-actions bot added a commit that referenced this pull request Jan 31, 2025
…tevz/docs/siwe-tutorial

docs: SIWE tutorial and Solidity polishes 7b688e7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: SIWE tutorial and example
4 participants