Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ethereum 演習 III / Ethereum Exercise III

Kenji Saito
September 13, 2023

Ethereum 演習 III / Ethereum Exercise III

2023年9月13日(水)、ブロックチェーンハブ主催のブロックチェーンアカデミーにて使用したスライドです。

Kenji Saito

September 13, 2023
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. ( ) SFC ( ) CSO (Chief Science Officer) 1993

    ( ) 2006 ( ) SFC 22 P2P (Peer-to-Peer) 2011 ( ) 2018 2019 VR 2021.9 & VR 2022.3 2023 AI VR&RPG 2023.5 “Don’t Be So Serious” VOXEL 2023.7 DAZE 2023 → ( ) — 4 Ethereum III — 2023-09-13 – p.3/28
  2. 1. NFT DAO 2. : NFT 3. : DAO 4.

    — 4 Ethereum III — 2023-09-13 – p.5/28
  3. ( ) = = : . . . ( :

    ) ( ) . . . . . . . . . . . . — 4 Ethereum III — 2023-09-13 – p.7/28
  4. ⇒ ( ) . . . . . . —

    4 Ethereum III — 2023-09-13 – p.8/28
  5. DeFi ( ) DeFi : Decentralized Finace . . .

    ( ) DeFi DAO — 4 Ethereum III — 2023-09-13 – p.9/28
  6. NFT ( ) NFT : Non-Fungible Token ( ) (1

    ) → fungible token ( ) → NFT — 4 Ethereum III — 2023-09-13 – p.10/28
  7. ERC-721 ERC (Ethereum Request for Comments) 721 EIP (Ethereum Improvement

    Proposal) https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md interface ERC721 { function balanceOf(address _owner) external view returns (uint256); function ownerOf(uint256 _tokenId) external view returns (address); function safeTransferFrom(address _from, address _to, uint256 _tokenId, . . .) external payable; : } interface ERC721TokenReceiver { function onERC721Received(.. ., uint256 _tokenId, . . .) external returns(bytes4); } interface ERC721Metadata { function name() external view returns (string _name); function symbol() external view returns (string _symbol); function tokenURI(uint256 _tokenId) external view returns (string); } tokenURI URL ( ) ( ) — 4 Ethereum III — 2023-09-13 – p.11/28
  8. ERC-721 NFT τʔΫϯ *% ൪߸ 63- ΞυϨε 63- /'5 Ұҙ

    Ұҙʁ Ұҙʁ Ұҙ ࣄ্࣮ Ұҙ ެ։伴ͷ μΠδΣετ ϝλσʔλ ίϯτϥΫτͱ͍͏ఆٛҬ ˞ͦͷίϯτϥΫτͱ͍͏ఆٛҬͷதͰ ࣮ઢ໼ҹͰࣔͨ͠ҰҙੑΛอূ͢Δʹա͗ͳ͍ ˞ഁઢ໼ҹͰࣔͨ͠Ұҙੑ͸ ࣮૷ɾӡ༻ͷ޻෉࣍ୈͰอূͰ͖Δ ɹྫ͑͹ 63- ʹͦΕ͕ࢦ͢Ϧιʔεͷ҉߸ֶతμΠδΣετΛؚΊΔ͜ͱ ྫ *1'4 ͷར༻ ʹΑΓ ɹ ʮ63-ˠσʔλʯͷҰҙੑΛอͯΔ ͦͷ৔߹Ͱ΋ʮσʔλˠ63-ʯͷҰҙੑ͸ແ͍ ର৅σʔλ ը૾౳ ॴ༗ऀ ϝλσʔλ 63- ର৅σʔλ 63- ൿີ伴 Ұҙ Ұҙʁ Ϣʔβ Ұҙʁ — 4 Ethereum III — 2023-09-13 – p.12/28
  9. NFT NFT URL Marlinspike, M.: My first impressions of web3

    (2022) Web3 . . . URL ↑ NFT → → NFT NFT ↔ NFT — 4 Ethereum III — 2023-09-13 – p.13/28
  10. DAO ( ) DAO : Decentralized Autonomous Organization Vitalik Buterin

    (Ethereum ) https://blog.ethereum.org/2014/05/06/daos-dacs-das-and-more-an-incomplete-terminology-guide/ (1) (2) ( ) (3) DAO . . . / — 4 Ethereum III — 2023-09-13 – p.14/28
  11. NFT Linux (Ubuntu 22.04) Python3 + eth-brownie 1.19.3 (Python Ethereum

    ) $ brownie bake nft nft ( ) contracts SimpleCollectible.sol ERC-721 — 4 Ethereum III — 2023-09-13 – p.16/28
  12. NFT (1) NFT NFT $ cd nft # nft $

    brownie console # eth-brownie (Python ) # ↓ Python >>> network.disconnect() # ( ) >>> network.connect(’mainnet’) # Ethereum >>> collectible = SimpleCollectible.at(’ ’) # >>> collectible.ownerOf(OpenSea NFT ID) # >>> collectible.tokenURI(OpenSea NFT ID) # URL URL URL ( ) — 4 Ethereum III — 2023-09-13 – p.17/28
  13. NFT (2) NFT(?) NFT >>> collectible.ownerOf( NFT ID) # >>>

    collectible.ownerOf( NFT ID) # NFT Ethereum Ethereum NFT NFT Ethereum Lazy Minting (?) ( ) ( ) NFT — 4 Ethereum III — 2023-09-13 – p.18/28
  14. NFT < , ID> ERC-721 OK NFT . . .

    ID → NFT ID NFT NFT URL . . . URL . . . →NFT — 4 Ethereum III — 2023-09-13 – p.19/28
  15. NFT σʔλ " ϒϩοΫνΣʔϯ #⒩ ʜ ʜ ϒϩοΫνΣʔϯ #⒪ ʜ

    ʜ εϚʔτίϯτϥΫτ $⒩ εϚʔτίϯτϥΫτ $⒪ ಛఆͷετϨʔδ ˞Ͳ͜ʹஔ͔ΕΑ͏ͱ΋ ɹ౳͍͠σʔλ͸ಉ͡΋ͷ ϒϩοΫνΣʔϯ͕ಉ͡Ͱ΋ҟͳͬͯ ͍ͯ΋ εϚʔτίϯτϥΫτ͕ҟͳ ΔΠϯελϯεͳΒఆٛҬ͸ผͱͳΔ ଟ͘ͷ৔߹ ې͡ΒΕͳ͍ ېࢭͰ͖ͳ͍ ˞/'5 ͕σʔλΛࢦ͢ํࣜͱσʔλΛ֨ೲ͢Δํࣜ͸ σʔλͷՄ༻ੑ͸ҟͳΔͱͯ͠΋ҰҙੑʹؔΘΔੑ࣭͸มΘΒͳ͍ ಉҰ εϚʔτίϯτϥΫτ $⒫ εϚʔτίϯτϥΫτ $⒬ /'5⒩ /'5⒪ /'5⒫ /'5⒬ /'5⒮ /'5⒭ σʔλ "  ېͣΔΑ͏ͳ ઃܭ͸ίετߴ ېࢭͰ͖ͳ͍ — 4 Ethereum III — 2023-09-13 – p.20/28
  16. NFT NFT . . . NFT ( ) ↑ ID

    . . . — 4 Ethereum III — 2023-09-13 – p.21/28
  17. NFT NFT >>> network.disconnect() # >>> network.connect(’goerli’) # Ethereum >>>

    accounts.add( ) # >>> collectible = SimpleCollectible.deploy({’from’: accounts[0]}) # NFT >>> collectible.createCollectible( ) # NFT goerli / ( ) “Gas used” Gas Gwei ERC-721a ID 1 — 4 Ethereum III — 2023-09-13 – p.22/28
  18. NFT : ERC-721 NFT NFT (ID) NFT → URI NFT

    ( NFT ) (ID) (URI) → NFT ( ) URI → ( ) → ( ) NFT NFT NFT — 4 Ethereum III — 2023-09-13 – p.23/28
  19. DAO (1) ( ) (2) (3) . . . (a)

    ( ) (b) ( ) https://medium.com/coinmonks/beanstalk-exploit-a-simplified-post-mortem-analysis-92e6cdb17ace — 4 Ethereum III — 2023-09-13 – p.25/28
  20. MakerDAO https://docs.makerdao.com/smart-contract-modules/governance-module plot ( ) drop ( ) plot eta

    ( ) exec ( ) https://github.com/dapphub/ds-chief/blob/master/src/chief.sol https://github.com/dapphub/ds-auth/blob/master/src/auth.sol https://github.com/dapphub/ds-pause/blob/master/src/pause.sol — 4 Ethereum III — 2023-09-13 – p.26/28