An experimental fallbackHandler to add the did:dis
DID prototype to Safe Smart Wallets.
Why?
The did:pkh
DID standard isn't scalable, because you can't update the underlying DID document. It's static. And that's bad because you're stuck with one signing/verifying key. Very (very) bad UX in the land of Web3.
The proposed did:dis
DID standard overcomes these limits, while minimizing the cost of generation. Using EIP-3886 the smart contract can communicate with an offchain service, which hosts the DID document and thus not requiring any onchain transactions to update.
![overview](https://private-user-images.githubusercontent.com/3408362/278606899-0e467a87-7e03-4ed0-aa0f-9498558a73d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTIzMDA0OTAsIm5iZiI6MTcxMjMwMDE5MCwicGF0aCI6Ii8zNDA4MzYyLzI3ODYwNjg5OS0wZTQ2N2E4Ny03ZTAzLTRlZDAtYWEwZi05NDk4NTU4YTczZDkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDQwNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA0MDVUMDY1NjMwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MWI5MjMzNjhjN2RlMjlkZTQxODljYWM2NWM0YzkxY2I5NTZjNjViMDc3NjljMzRlY2UzODRkMGZmMDI1ZWNhYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.RH4GYnL2wHPTSOjz9KP8Uvt5PcHavaKNEEEeA2Q3LVo)
This is a list of the most frequently needed commands.
Build the contracts:
$ forge build
Delete the build artifacts and cache directories:
$ forge clean
Compile the contracts:
$ forge build
Get a test coverage report:
$ forge coverage
Deploy to Anvil:
$ forge script script/Deploy.s.sol --broadcast --fork-url http://localhost:8545
For this script to work, you need to have a MNEMONIC
environment variable set to a valid
BIP39 mnemonic.
For instructions on how to deploy to a testnet or mainnet, check out the Solidity Scripting tutorial.
Format the contracts:
$ forge fmt
Get a gas report:
$ forge test --gas-report
Lint the contracts:
$ pnpm lint
Run the tests:
$ forge test
Generate test coverage and output result to the terminal:
$ pnpm test:coverage
Generate test coverage with lcov report (you'll have to open the ./coverage/index.html
file in your browser, to do so
simply copy paste the path):
$ pnpm test:coverage:report
- Foundry uses git submodules to manage dependencies. For detailed instructions on working with dependencies, please refer to the guide in the book
- You don't have to create a
.env
file, but filling in the environment variables may be useful when debugging and testing against a fork.
- abigger87/femplate
- cleanunicorn/ethereum-smartcontract-template
- foundry-rs/forge-template
- FrankieIsLost/forge-template
This project is licensed under MIT.