26
Dapple is Pretty Neat Let me show you!

Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Dapple is Pretty NeatLet me show you!

Page 2: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

What?• It’s an EVM Dev Multitool

• Collection of utilities centered around common data model

Page 3: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Key Innovations• `Dappfile`: package/dapp descriptor format

• Chain Forks (local)

• EVM extensions

Page 4: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

• `Dappfile`: package/dapp descriptor format

• Shared global runtime environment blurs line between code packages and deployed code-objects

Key Innovations

Page 5: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)
Page 6: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Key Innovations• Chain Forks (local)

Page 7: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Key Innovations• Chain Forks (local)

Page 8: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

• EVM extensions

• Break the rules… privately

Key Innovations

Page 9: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

The Workflow

Page 10: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

1) Find some Dependencies• Hint hint: github.com/nexusdev/dappsys

• Auth, proxy actors, tokens, governance, datastores, utils…

• Contract system building blocks

• Top candidate for formal verification!

Page 11: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

2) Build/Link (yawn)• Problem: Solidity has no namespaces

• maker-core has objects from 4 different dappsys versions

• Solution: Custom Linker

Page 12: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

3) Test• Dapple perspective: Primary consumer of a contract

is other contracts

• Magic `Test` contract, harness knows test definition conventions

Page 13: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

3) Test

Page 14: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

3) Test

setUp testSomething

testSomethingElse

Page 15: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

• Now add chain forking: Test against live chain

3) Test

setUp testSomething

testSomethingElse

Page 16: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

• Now add chain forking: Test against live chain

3) Test

Page 17: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

• Now add chain forking: Test against live chain

3) Test

Page 18: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

• Magic `Script` contract

• Hijacks `CREATE` and `CALL` opcodes - makes a cross-chain transaction instead of message call and blocks execution until confirmed

• combine with chain forking to simulate deployments and perform consistency checks on result of live system

4) Deploy: Wallet-side Scripting

Page 19: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

“nikolai: Please confirm proposal 66 ASAP, it is a critical bugfix!”

4) Deploy: Wallet-side Scripting

Page 20: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

4) Deploy: Wallet-side Scripting

Page 21: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

4) Deploy: Wallet-side ScriptingNotice the hoisted `env` object

Page 22: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Rinse and Repeat

5) Publish your Dappfile

Page 23: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Sneak Peek• On-chain registry and power user block explorer

• dapphub.io

• GUI for chain forks, dry runs, simulations, etc

Page 24: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Sneak Peek• More wallet-side EVM extensions:

• Thin clients - DIY sharding

• Consensus in VM

• System calls: Private Sidechains bridge old web and EVM proofs

Page 25: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Sneak Peek

Page 26: Dapple is Pretty Neat - EthFansupyun-assets.ethfans.org/uploads/doc/file/442223cf02194effb75f27d30… · • Magic `Test` contract, harness knows test definition conventions. 3)

Thank you!

nexusdev.us

github.com/nexusdev/dapple

github.com/nexusdev/dappsys