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

HL-Report コントラクト開発裏話 / Developing Contracts of HL-Report

Roadagain
December 17, 2018

HL-Report コントラクト開発裏話 / Developing Contracts of HL-Report

blockchain.tokyo#15で発表した資料です。
HL-Reportのコントラクトを開発するに当たり、注意した点やつまづいた点をまとめました。

Roadagain

December 17, 2018
Tweet

More Decks by Roadagain

Other Decks in Programming

Transcript

  1. )-3FQPSU
    ίϯτϥΫτ։ൃཪ࿩
    גࣜձࣾϞόΠϧϑΝΫτϦʔ
    ΤϯδχΞࢁ৓ڹ

    View full-size slide

  2. ࣗݾ঺հ
    ࢁ৓ڹ
    גࣜձࣾϞόΠϧϑΝΫτϦʔ
    ΤϯδχΞ ৽ଔ

    5XJUUFS!SJOHPI
    (JU)VC3PBEBHBJO

    View full-size slide

  3. ໨࣍
    w)-3FQPSUͱ͸
    w)-3FQPSUͷಛ௃
    wνϡʔχϯά
    w݁Ռ
    w͓·͚

    View full-size slide

  4. )-3FQPSUͱ͸

    View full-size slide

  5. )-3FQPSUͱ͸
    ฐࣾͰӡӦ͍ͯͨ͠ҐஔήʔϜ
    ʮϨΩγτίωΫτʯͷࢿ࢈Λ
    ׆༻ͨ͠%"QQT

    View full-size slide

  6. )-3FQPSUͱ͸
    ϓϨΠϠʔͷࢿ࢈ΛϒϩοΫνΣʔϯʹ

    Ҡ২ͯ͠ɺαʔϏεऴྃޙ΋ҭͯͨ

    ΩϟϥΫλʔͨͪʹձ͑ΔαʔϏε

    View full-size slide

  7. )-3FQPSUͷಛ௃

    View full-size slide

  8. )-3FQPSUͷಛ௃
    τʔΫϯΛҰؾʹൃߦ഑෍
    HBT୅ΛαʔϏεఏڙऀ͕ෛ୲
    τʔΫϯΛചങͰ͖ͳ͍

    View full-size slide

  9. )-3FQPSUͷಛ௃
    ࣮࣭తʹ΍͍ͬͯΔͷ͸%#ͷҠ؅
    τʔΫϯൃߦ˺&UIFSFVN΁ͷอଘ

    View full-size slide

  10. )-3FQPSUͷಛ௃
    HBT୅ͱτʔΫϯചങʹ͍ͭͯ͸๏తͳ໰୊
    ৄ͘͠͸աڈެ։ͨ͠6OJRZT1SPKFDUͷ
    εϥΠυ΁
    IUUQTTQFBLFSEFDLDPNSF@OLZNEBQQTHBNFEFTJHOBOEOPUFT

    View full-size slide

  11. νϡʔχϯά

    View full-size slide

  12. HBT୅અ໿͍ͨ͠
    νϡʔχϯά

    View full-size slide

  13. νϡʔχϯά
    ύϥϝʔλΛݶք·Ͱ࡟Δ
    wը૾
    w໊લ
    wઆ໌จ
    wϨϕϧࢉग़εςʔλε

    View full-size slide

  14. νϡʔχϯά
    ίϯτϥΫτ΋εϦϜԽ
    &OVNFSBCMF࡟ͬͨΓͱ͔
    NBQQJOHΛ഑ྻʹͨ͠Γͱ͔

    View full-size slide

  15. νϡʔχϯά
    ίενϡʔϜ͸'VOHJCMF5PLFO
    ˠݸ΋ίϯτϥΫτ؅ཧͰ͖ͳ͍
    &3$Λ࢖ͬͯҰׅ؅ཧ

    View full-size slide

  16. νϡʔχϯά
    τϥϯβΫγϣϯ΋εϦϜԽ
    ෳ਺ͷτʔΫϯΛ·ͱΊͯ഑෍͢Δ
    ֤ύϥϝʔλΛͦΕͧΕ഑ྻͰ౤͛Δ
    &3$͸ݩ͔ΒͰ͖ΔΑ͏ʹͳ͍ͬͯͨ

    View full-size slide

  17. νϡʔχϯά
    ࣮ࡍͷίʔυ

    View full-size slide

  18. ݁Ռ
    ൃߦτʔΫϯ
    ΩϟϥΫλʔମ
    ணͤସ͑ҥ૷छྨ
    ແࣄʹ഑෍׬ྃɺϛε΋ͳ͠

    View full-size slide

  19. ݁Ռ
    τϥϯβΫγϣϯ૯਺
    ແࣄʹ͓Ҿӽ͠׬ྃ͠·ͨ͠

    View full-size slide

  20. ·ͱΊ
    طଘσʔλͷτʔΫϯԽ͸Ωπ͍
    ྗෆ଍ͳ෦෼΋ଟ͋ͬͨ͘
    Ͱ΋ָ͍͠
    τʔΫϯԽ·ͨ΍Γ͍ͨ

    View full-size slide

  21. ͓·͚
    ͱ͍͏໊ͷۤ࿑࿩

    View full-size slide

  22. 0QFO;FQQFMJO
    0QFO;FQQFMJOͷίʔυ͕(JU)VCͱOQN
    Ͱҧͬͨ
    (JU)VC3$
    OQN

    View full-size slide

  23. 0QFO;FQQFMJO
    ओʹӨڹ͕͋ͬͨͷ͸͜Ε
    4FQBSBUFE&3$JOUPUIFEJGGFSFOU
    PQUJPOBMJOUFSGBDFT BOE
    JOUSPEVDFE&3$'VMMXIJDI
    JNQMFNFOUTBMM

    View full-size slide

  24. 0QFO;FQQFMJO
    ղܾࡦ

    View full-size slide

  25. τʔΫϯ໊ͱTZNCPM
    τʔΫϯͷ໊લͱTZNCPMͰ೰Ή
    ΞϓϦ಺දݱͷྲྀ༻΋ߟ͕͑ͨʜ
    $SZQUP,JUUJFTˠ$,Έ͍ͨʹ΍Γ͍ͨ

    View full-size slide

  26. τʔΫϯ໊ͱTZNCPM
    ͪΐ͏Ͳ͜ͷ࣌ظʹ.$)͕ϓϨηʔϧ
    ίʔυެ։͞Ε͍ͯͨͷͰ໊લͷࢀߟʹ
    MyCryptoHeroes:HeroˠHL-Report:Ijin
    TZNCPM͸͍Ζ͍Ζߟ͑ͨ݁ՌIJINʹ
    ΩϟϥΫλʔͰ͋Δ͜ͱ͕͙͢ʹ෼͔Δ
    ଞͱ͔ͿΓʹ͍͘

    View full-size slide

  27. τʔΫϯ໊ͱTZNCPM
    ணͤସ͑ҥ૷ͷτʔΫϯ໊͸ήʔϜͱಉ͡
    TZNCPM͸COSͰ౷Ұ
    छྨ΋TZNCPMߟ͍͑ͯΔ༨༟͕ͳ͍
    ίενϡʔϜˠ$PTUVNFˠ$04

    View full-size slide

  28. ςετωοτͰͷࢼݧൃߦ
    ͍͖ͳΓຊ൪͸ා͍͔ΒςετωοτͰ

    ͓ࢼ͍ͨ͠͠
    3JOLFCZͰ͓ࢼ͠ɺ͍͔ͭ͘ൃݟ͕͋ͬͨ

    View full-size slide

  29. ςετωοτͰͷࢼݧൃߦ
    ςετωοτ༻ͷ໊લΛ༻ҙ͢΂͠

    View full-size slide

  30. ςετωοτͰͷࢼݧൃߦ
    ଞͷൃݟ
    HBOBDIFΑΓऔΓࠐΈ͕஗͍
    UPUBM4VQQMZ͕ͳ͍

    View full-size slide

  31. ຊ൪ൃߦ
    ϝΠϯωοτ͸USVGqFDPOTPMF͕λΠϜ
    Ξ΢τ͢Δ
    ͪΌΜͱൃߦͰ͖͍ͯΔ͜ͱΛفͬͯؼ୐

    View full-size slide

  32. ຊ൪ൃߦ
    5Yࢭ·ͬͯ௥Ճൃߦ͠·ͨ͠

    View full-size slide

  33. ίʔυQVCMJTI
    ίʔυQVCMJTI͠·ͨ͠
    ΩϟϥΫλʔ &3$ϕʔε

    IUUQTFUIFSTDBOJPUPLFOYCCDGEECEFBCGFE
    ͖͔ͤ͑ҥ૷ &3$ϕʔε

    IUUQTFUIFSTDBOJPBEESFTTYCCDEFGFC

    View full-size slide

  34. ίʔυQVCMJTI
    ʮ͜ͷίʔυTPMIJOU௨Βͳ͍ʯ
    externalΛpublicͷޙΖʹஔ͘ͱ͍͏SVMF

    View full-size slide

  35. ͓·͚ͷ͓·͚

    View full-size slide

  36. ϦϦʔε௚લ
    τʔΫϯ഑෍͸ϑϩϯτͷެ։લ
    ϦϦʔεલʹόϨͳ͍͔ෆ҆ͩͬͨ
    ˠ࣮ࡍ͸શવͦͷؾ഑͕ͳ͔ͬͨ
    ϒϩοΫνΣʔϯΛ஌Βͳ͍ਓ΋

    Ҿ͖ࠐΉ͜ͱ͕Ͱ͖ͨͱղऍ͢Δ

    View full-size slide

  37. ϦϦʔεޙ
    ͻͨ͢ΒΤΰα
    Ϣʔβʔ͕تΜͰ͍Δɺٽ͍͍ͯΔ
    ਓੜͰҰ൪ָ͍͠೔

    View full-size slide