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

Stringをどうにかする / Managing Solidity String

Ryo Manzoku
November 29, 2019

Stringをどうにかする / Managing Solidity String

2019-11-29 blockchain.tokyo#23 Dapp開発Special
https://blockchain-tokyo.connpass.com/event/154664/

Ryo Manzoku

November 29, 2019
Tweet

More Decks by Ryo Manzoku

Other Decks in Programming

Transcript

  1. 4USJOHΛͲ͏ʹ͔͢Δ
    CMPDLDIBJOUPLZP
    EPVCMFKVNQUPLZPגࣜձࣾ
    ϦʔυΤϯδχΞຬ଍྄

    View full-size slide

  2. w 3FCVJMEJOHUIFGVUVSFPGHBNJOH

    XJUICMPDLDIBJOUFDIOPMPHZ
    w ೥݄૑ۀ
    w ϒϩοΫνΣʔϯήʔϜઐۀ։ൃձࣾ
    w ैۀһਓʢۀ຿ҕୗΛؚΉʣ
    w ϒϩοΫνΣʔϯʹ೤ҙͷ͋ΔΤϯδχΞΛੵۃ࠾༻தͰ͢ʂ
    EPVCMFKVNQUPLZPגࣜձࣾ

    View full-size slide

  3. w ຬ଍྄ʢ.BO[PLV3ZPʣ
    w EPVCMFKVNQUPLZPϦʔυΤϯδχΞ
    w ೥݄ΑΓΠϯϑϥઃܭӡ༻ɺαʔόαΠυ։ൃɺ
    4NBSU$POUSBDU։ൃɺϒϩοΫνΣʔϯٕज़ௐࠪͳͲΛ୲౰
    w աڈʹ͸ιʔγϟϧήʔϜձࣾɺ&E5FDIΞϓϦձࣾͰΠϯϑ
    ϥΤϯδχΞͱͯ͠"84Λத৺ͱͨ͠Ϋϥ΢υΠϯϑϥ͔ΒΞ
    ϓϦ·ͰͷશମઃܭɺߏஙɺվળΛܦݧ
    ࣗݾ঺հ

    View full-size slide

  4. 4PMJEJUZॻ͍ͯ·͔͢ʁ

    View full-size slide

  5. 4USJOHܕ࢖͍·͔͢ʁ

    View full-size slide

  6. )FMMP8PSMEҎ֎Ͱ࢖͏͜ͱ͋Δͷʁ

    View full-size slide

  7. &UISFVN͔Β֎ͷੈքΛࢀর͢Δ
    ৔߹ʹ࢖͏

    View full-size slide

  8. 4PMJEJUZEPFTOPUIBWFTUSJOHNBOJQVMBUJPOGVODUJPOT
    CVUUIFSFBSFUIJSEQBSUZTUSJOHMJCSBSJFT
    https://solidity.readthedocs.io/en/v0.5.13/types.html#bytes-and-strings-as-arrays

    View full-size slide

  9. Ͳ͏ʹ͔͍͖ͯ͠·͠ΐ͏

    View full-size slide

  10. w MFO TUS

    w TUSMFOHUI
    w CZUFT TUS
    MFOHUI
    2จࣈྻͷ௕͞

    View full-size slide

  11. w MFO TUS

    w 4PMJEJUZʹ૊ΈࠐΈͷMFO
    ͸ଘࡏ͠ͳ͍
    w TUSMFOHUI
    w .FNCFSMFOHUIOPUGPVOEPSOPUWJTJCMFBGUFS
    BSHVNFOUEFQFOEFOUMPPLVQJOMJUFSBM@TUSJOH
    w CZUFT TUS
    MFOHUI
    w ˓
    "จࣈྻͷ௕͞

    View full-size slide

  12. TUSJOHJTFRVBMUPCZUFTCVUEPFT
    OPUBMMPXMFOHUIPSJOEFYBDDFTT
    https://solidity.readthedocs.io/en/v0.5.13/
    types.html#bytes-and-strings-as-arrays

    View full-size slide

  13. w TUSTUS

    w LFDDBL TUS
    LFDDBL TUS

    w LFDDBL BCJFODPEF1BDLFE T

    LFDDBL BCJFOD
    PEF1BDLFE T


    2จࣈྻͷൺֱ

    View full-size slide

  14. w TUSTUS

    w ඇਪ঑
    w LFDDBL TUS
    LFDDBL TUS

    w ͪΐͬͱલ·Ͱ͜Ε͕ਪ঑͞Ε͍ͯͨ
    w LFDDBL BCJFODPEF1BDLFE T

    LFDDBL BCJFOD
    PEF1BDLFE T


    w ˓W͔ΒυΩϡϝϯτʹొ৔
    "จࣈྻͷൺֱ

    View full-size slide

  15. w TUSTUS
    w CZUFT TUS
    CZUFT TUS

    w BCJFODPEF1BDLFE TUS TUS

    w Ͳ͏ʹ͔͢Δ
    2จࣈྻͷ࿈݁

    View full-size slide

  16. w TUSTUS
    w TUSJOH͸"SSBZͳͷͰ͸࢖͑·ͤΜ
    w CZUFT TUS
    CZUFT TUS

    w CZUFT͸"SSBZͳͷͰ͸࢖͑·ͤΜ
    w BCJFODPEF1BDLFE TUS TUS

    w ˓W͔ΒυΩϡϝϯτʹొ৔
    w Ͳ͏ʹ͔͢Δ
    "จࣈྻͷ࿈݁

    View full-size slide

  17. BCJFODPEF1BDLFEΛ஌Βͳ͔ͬͨࠒ

    View full-size slide

  18. w TUS<>
    w CZUFT<>
    w Ͳ͏ʹ͔͢Δ
    2จࣈྻͷ੾ΓऔΓ

    View full-size slide

  19. w TUS<>
    w TUSJOHJTFRVBMUPCZUFTCVUEPFTOPUBMMPXMFOHUIPS
    JOEFYBDDFTT
    w CZUFT<>
    w Έ͍ͨͳΞΫηε͸Ͱ͖ͳ͍ɻจࣈ͚ͩͳΒ͜ΕͰ΋Մ
    w Ͳ͏ʹ͔͢Δ
    w ˓
    "จࣈྻͷ੾ΓऔΓ

    View full-size slide

  20. Ͳ͏ʹ͔͢Δ

    View full-size slide

  21. w TUSJOH J

    w TUSJOH BCJFODPEF1BDLFE J


    w Ͳ͏ʹ͔͢Δ
    2VJOUͷจࣈྻԽ

    View full-size slide

  22. w TUSJOH J

    w ͦΜͳ؁͘ͳ͍
    w TUSJOH BCJFODPEF1BDLFE J


    w Ͱ͖Δ͔ͳͱࢥ͚ͬͨͲͦΜͳ؁͘ͳ͍
    w Ͳ͏ʹ͔͢Δ
    w ˓
    "VJOUͷจࣈྻԽ

    View full-size slide

  23. Ͳ͏ʹ͔͢Δ

    View full-size slide

  24. w BEESTUSJOH

    w TUSJOH BEES

    w TUSJOH BCJFODPEF1BDLFE BEES


    w Ͳ͏ʹ͔͢Δ
    2BEESFTTͷจࣈྻԽ

    View full-size slide

  25. w BEESTUSJOH

    w ͦΜͳ؁͘ͳ͍
    w TUSJOH BEES

    w &YQMJDJUUZQFDPOWFSTJPOOPUBMMPXFE
    w TUSJOH BCJFODPEF1BDLFE BEES


    w &YQMJDJUUZQFDPOWFSTJPOOPUBMMPXFE
    w Ͳ͏ʹ͔͢Δˠ˓
    "BEESFTTͷจࣈྻԽ

    View full-size slide

  26. Ͳ͏ʹ͔͢Δ

    View full-size slide

  27. w Ͳ͏ʹ͔͢Δ
    2จࣈྻͷ4QMJU

    View full-size slide

  28. ΄Μͱʹ͜ΕΛ΍Δͷʁ

    View full-size slide

  29. 4PMJEJUZEPFTOPUIBWFTUSJOHNBOJQVMBUJPOGVODUJPOT
    CVUUIFSFBSFUIJSEQBSUZTUSJOHMJCSBSJFT

    View full-size slide

  30. 044Ͱެ։ͯ͠·͢ʂ
    IUUQTHJUIVCDPN
    EPVCMFKVNQUPLZPNDIQMVTDPOUSBDUT

    View full-size slide

  31. ϚΠΫϦΛ࢝ΊΑ͏ʂ
    https://mch.gg/start
    ট଴ίʔυ͸
    ʮTHA4ʯ

    Λೖྗʂ

    View full-size slide