Solidity
ä»åã¯ãSolidityã®v0.6.5ã§è¿½å ãããImmutable keywordã«ã¤ãã¦ç´¹ä»ãã¾ãã ãªããv0.6.5ã¯2020/04/06ã«ãªãªã¼ã¹ããã¦ããã¾ããå·çæç¹ã§ã®ææ°ãã¼ã¸ã§ã³ã¯v0.6.8ã¨ãªã£ã¦ãã¾ããImmutable keywordã«ã¤ãã¦ã®å ¬å¼ã®èª¬æã¯ãã¡ãã®ããã°ãåç §ãã ãâ¦
ä»åã®è¨äºã¯Solidity Assemblyå ¥éã¨ããé£è¼è¨äºã®ç¬¬5åç®ã§ãããã®é£è¼ã§ã¯Solidityã®ã³ã¼ããã³ã³ãã¤ã«ããæã«çæãããopcodeã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ãããããã°ããã®ã«å¿ è¦ãªç¥èãå¾ããããã¨ãç®çã¨ãã¦ãã¾â¦
y-nakajo.hatenablog.com ä»åã¯ä¸è¨ã®ä»¥åã®è¨äºã§è§¦ãããEthereumã®debugæ©æ§ã«ã¤ãã¦èª¿ã¹ããã¨ãã¾ã¨ãã¦ããã¾ãã Ethereumã§ã¯ä»»æã®txãdebugããããã®æ©è½ããã¾ãSolidityã§ã¯byte codeã¨ã½ã¼ã¹ãã¡ã¤ã«ãmappingããããã®æ å ±ãæä¾ããã¦ãã¾â¦
ä»åã¯ã¿ããªãå¾ ã¡æãã§ããã¨æãããé常ã«ä¾¿å©ãªãã¼ã«ãç´¹ä»ãã¾ãã ããããã¡ããsol-traceã§ãï¼ github.comReadme.mdãè¦ã¦åããéããtruffleã®testã«çµã¿è¾¼ããã¨ã§revertãçºçããæã«ãã¨ã©ã¼ã®å¯¾è±¡ã®ã½ã¼ã¹ãã¡ã¤ã«ã¨è¡æ°ã表示ãã¦ããã¾â¦
ä»åã¯ãã¡ãã®è¨äºãèªãã§æãã¤ããSmartContractã®ç´¹ä»è¨äºã§ãã btcnews.jpä»åãBancorã¯Pausableãç¶æ¿ããSmartContractãä½æãã¦ãããã¨ã§ãBNTã«é¢ãã¦ã¯ããã«pausedç¶æ ã«ãã¦æµåºãé²ããã¨ãã§ãã¾ããã ãããããã®å¦ç½®ã«é¢ãã¦ã¯ä¸è¨ã®â¦
ä»åã®è¨äºã¯Solidity Assemblyå ¥éã¨ããé£è¼è¨äºã®ç¬¬4åç®ã§ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ããã³ã³ãã¤ã«ããæã«çæãããopcodeã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ãããããã°ããã®ã«å¿ è¦ãªç¥èãå¾ããããã¨ãç®çã¨ãã¦ãâ¦
æè¿ã¯æãããã°casper FFGã®Smart ContractãvyperããSolidityã«å¤æãã¦ãã¾ãã github.comä½æ¥ããã¦ããã«ããããvyperã®ã³ã¼ãããSolidityã®ã³ã¼ãã¸å¤æããéã®tipsãæã£ããããæºã¾ã£ã¦ããã®ã§ãå¿ããªããã¡ã«è¨äºã«ãã¦ã¾ã¨ãã¦ããã¾ããâ¦
ä»åã®è¨äºã¯Solidity Assemblyå ¥éã¨ããé£è¼è¨äºã®ç¬¬ï¼åç®ã§ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ããã³ã³ãã¤ã«ããæã«çæãããopcodeã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ãããããã°ããã®ã«å¿ è¦ãªç¥èãå¾ããããã¨ãç®çã¨ãã¦ãâ¦
ä»åã®è¨äºã¯Solidity Assemblyå ¥éã¨ããé£è¼è¨äºã®ç¬¬ï¼åç®ã§ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ããã³ã³ãã¤ã«ããæã«çæãããopcodeã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ãããããã°ããã®ã«å¿ è¦ãªç¥èãå¾ããããã¨ãç®çã¨ãã¦ãâ¦
ä»åã®è¨äºã¯Solidity Assemblyå ¥éã¨ããé£è¼è¨äºã®ç¬¬ï¼åç®ã§ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ããã³ã³ãã¤ã«ããæã«çæãããopcodeã«ã¤ãã¦è§£èª¬ãã¦ããã¾ãã ãã®é£è¼ã§ã¯Solidityã®ã³ã¼ãããããã°ããã®ã«å¿ è¦ãªç¥èãå¾ããããã¨ãç®çã¨ãã¦ãâ¦
Solidityãã³ã³ãã¤ã«ãã¦çæãããopcodes=SmartContractããContract Creationã®ã¨ãã«Ethereumã®StateDBã«ä¿åãããã¾ã§ã®ä»çµã¿ãã©ããªã£ã¦ããã®ãèå³ã湧ããã®ã§èª¿ã¹ã¦ã¿ã¾ãããã¨ããããã§ãä»åã®è¨äºã¯Contract Creationã®ä»çµã¿ã«ã¤ãã¦ã¾â¦
èªåãEthereumãå¦ç¿ããã¨ãã®çµé¨ãå ã«ã¼ãããEthereumãåå¼·ããããã®ãã¼ãããããã¾ã¨ãã¦ã¿ã¾ããã å 人ãã¡ã¯å¤§ä½ãã®æµãã§å¦ç¿ãé²ãã¦ãã£ãã¨æãã¾ãã
å æ¥ã»ãã¥ãªãã£ã¼ã¢ã©ã¼ããä¸ãããå¤ãã®åå¼æãä¸æERC20æºæ ãã¼ã¯ã³ã®åå¼ãåæ¢ããã¨ããå ±éã¨ã¨ãã«è©±é¡ã«ãªã£ããBatchOverFlowã«ã¤ãã¦ä»æ´ãªæãã§ããèªåãªãã«ã¾ã¨ãã¦ã¿ã¾ããä»åã®åé¡ã«ã¤ãã¦ã¯Gunosyã®@yamarkzããããã¡æ©ãã¾ã¨ãâ¦
Ethereumã§ã¯storageã«ãã¼ã¿ãæ ¼ç´ããå ´åã32byteãã¨ã«gas代ããããã¾ãããã®32byteã®å¢çãæèãããã¨ã§ã¬ã¹ä»£ãç¯ç´ã§ãã¾ãã ã¨ãã話ããã¾ã«èãã®ã§ãããå®ä½é¨ã¨ãã¦çµé¨ãããã¨ããªãã£ãã®ã§å®éã«è©¦ãã¦ã¿ã¾ããã ä»åã¯è©¦ãã¦ã¿ããâ¦
brew upgrade solidityãã¦ã0.4.19ãè½ã¡ã¦ããªãã¦ãªãã§ã ããï¼ã£ã¦ãã£ã¨æã£ãããhomeberwç¨ã®é å¸ãã¡ã¤ã«ï¼ã«ãªãã®ããªï¼ï¼ã®solidity.rbã«è¨è¼ãã¦ãããã¼ã¸ã§ã³çªå·ãæ¸ãæãå¿ãã¦ããã®ãåå ã ã£ãããã§ãã github.comPRåºã¦ãã®ã§ãã¡ãâ¦
æ°ããææ¡ããã¦ããERCã§ã¯ä»ã®ERCãå©ç¨ãã¦ãããã®ãå¤ããªã£ã¦ãã¾ãããä»åã¯ãã®ä¸ã§ãå人çã«ããç®ã«ã¤ãã¦æ°ã«ãªã£ã¦ããERC-165ã¨ERC-820ã«ã¤ãã¦èª¿ã¹ããã¨ãã¾ã¨ãã¾ããERC-165ã¨ERC-820ã¯åºæ¬çã«ã¯ã©ã¡ããStandard Interface Detectionâ¦
ERC-223 tokenã¯ç»æçãªé¨åãããã¾ãããå®å ¨ã«tokenã®åªå¤±ãé²ããããã§ã¯ç¡ãã§ãã ä¾ãã°ãfallbacké¢æ°ãå®ç¾©æ¸ã¿ã®Contractã«å¯¾ãã¦ã¯ééå¯è½ã ãã0x00000000000000000000000000000000000001234ã«ééãããå¤åprivate keyãæã£ã¦ãã人ãããªâ¦
ethereumã³ãã¥ããã£ã¼ã§ãé åã®éä¸ã®ãã¼ã¿ãåé¤ãã¦ãå ¨ä½ãè©°ãããã®ã§ããSolidityã§ã©ããã£ããããã®ã§ããï¼ã£ã¦ãã質åããã£ãã®ã§ãããããã¨èª¿ã¹ã¦ã¿ã¾ãããçµè«ã¨ãã¦ã¯ãSolidityã§ã¯é åã®è¦ç´ ãåé¤ã§ãã¾ãããçç±ã¨ãã¦ã¯gas代ãâ¦
ãããã¯ãã§ã¼ã³ãå©ç¨ããå ´åãã¹ã±ã¼ãªã³ã°çã®åé¡ããä½ããããªããã§ã¼ã³ã§æ¿èªãè¡ããæå¾ã®çµæããããã¯ãã§ã¼ã³ã«ç»é²ãããã¨ãããã®ãå®è£ ããããªããã¨ãå¤ã ããã¾ããä»åã¯Ethereumã§ãªããã§ã¼ã³ã§ã®ããåããä¿è¨¼ããããã®ç½²åæ¤â¦
Solidityã§ã¯å¼æ°ãªã©ã®å¤ã®å¦¥å½æ§ãæ¤è¨¼ããããã«assertã¨requireé¢æ°ãç¨æããã¦ãã¾ããã¾ããã³ã¼ãã®å®è¡ãã¹ããããããããã®revert()é¢æ°ãããã¾ããä»åã¯ãããã®é¢æ°ã®æåã«ã¤ãã¦ã¾ã¨ãã¦ã¿ã¾ããã assert(condition) asserté¢æ°ã¯conditiâ¦
Contractã®ã»ãã¥ãªãã£ã¼ãæ ä¿ããä¸ã§ããã¹ãã®ã«ãã¬ãã¸ç100%ãç®æãã®ã¯çµæ§éè¦ã§ããä»åã¯ããã¹ãã®ã«ãã¬ãã¸çãåºãæ¹æ³ã«ã¤ãã¦ã¾ã¨ãã¾ããä»å使ããã¼ã«ã¯solidity-coverageã§ãã github.com
qiita.com ãã¡ãã®è¨äºã«ç´¹ä»ããã¦ããCTFå½¢å¼ï¼ï¼ï¼ãªãå±éºãªContractãhackããåé¡ã解ãã¦ã¿ã¾ããã å¾è¼©ã®å©ããåããªãããªãã¨ãå ¨åã¯ãªã¢ã§ãã¾ãããContractãå®è£ ããä¸ã§ã®ã»ãã¥ãªãã£ã¼ã®ãã¹ããã©ã¯ãã£ã¹ã¯ æ¨å¥¨ããå®è£ æ¹æ³ - Etherâ¦
Solidityã§ããããããªããã¼ãªãã¨ã試ãæã«assemblyã³ã¼ããæ¸ãã®ã§ãããæ¯åããã£ã¦ã©ãæ¸ããã ã£ãï¼ã£ã¦ãªãã®ã§èªåããã使ãassemblyã³ã¼ããã¾ã¨ãã¦ããã¾ãã
Ethereumã®Byzantiumããrevert使ãã¨ã¨ã©ã¼ã¡ãã»ã¼ã¸ããããªã«ã§ãããããã§ããï¼ã£ã¦ããã®ãå 輪ã§è©±é¡ã«ãªã£ãã®ã§å®éã«ã©ããã風ã«å©ç¨ã§ããã®ãã調ã¹ã¦ã¿ã¾ãããbyzantiumã®ãªãªã¼ã¹ãã¼ãã¯ãã¡ãã blog.ethereum.org
ä»åã¯Solidityã§æ¸ããContractã®ããã¥ã¡ã³ããèªåçæãããã¼ã«ã®ç´¹ä»ã¨ãã®ä½¿ãæ¹ã®ã¾ã¨ãã§ãã å®æ¥åãèããã¨ãã£ã±ããä½ã£ãããã°ã©ã ã®APIãªãã¡ã¬ã³ã¹ã¯èªåçæã§ããããã«ãã¦ãããã»ããä½ãã¨ä¾¿å©ã§ããããä»åå©ç¨ãããã¼ã«ã¯ãã¡â¦
ã¨ããEthereumã°ã«ã¼ãã§ã¡ãã£ã¨è©±é¡ã«ãªã£ãERC223Tokenãå®éã«è©¦ãã¦ã¿ã¾ããã ERC223Tokenã«ã¤ãã¦ã¯ãã¡ãã®æ¹ããããããã説æããã¦ããã®ã§åç §ãã ããã qiita.comERC223ã®ãªãã¸ããªã¯ãã¡ãã GitHub - Dexaran/ERC223-token-standard
Contractã®Eventã®ä»çµã¿ - ã¢ã«ã´ãªãºã ã¨ããªã¼ãã¼ã¨ãã«å¼ãç¶ãContractã®Eventé¢é£ã®ã話ã§ãã Eventãå®ç¾©ããæã«parameterã«indexedã¨ããmodifierãä»ä¸ããäºãã§ãã¾ããä»åã¯ãã®indexedã®ä»çµã¿ã«ã¤ãã¦ã¾ã¨ãã¦ã¿ã¾ããã
ä»åã¯Contractã®Eventããã¹ãããæã®æ³¨æç¹ãæãã¤ããtipsãªã©ãã¾ã¨ãã¾ããã çµå±ã¯éåæã§åãã¦ãããã¨ãæèãã¦ãªãã£ãã®ãåå ã§ã¯ããã®ã§ãããnodeåãããªãã試ãã¦ããã¨ããã®ã¾ã¾ãã¹ãã«æ¸ãã¦ããã¾ããããªãã¨ããããä¾ã®ä¸ã¤â¦
Ethereum Advent Calendar 2017 ã® 7 æ¥ç®ã®è¨äºã§ãã Contractã«Eventãå®ç¾©ããã¨ãContractã®ç¶æ ãå¤æ´ãããæãªã©ã«å¿ è¦ãªäººãéç¥ãåãåããããã«ãªãã¾ãã ããããgetterç³»ã®functionã«ã¯Eventãè¨å®ã§ããªãã£ãããã¾ãã ä»åã¯ãã®Eventã®â¦
æ´æ° ãã®è¨äºã®å 容ã¯å¤ãããã20180417ç¾å¨ã§ã¯ä½¿ãã¾ãããææ°ã§ã®å°å ¥æ¹æ³ã«ã¤ãã¦ã¯ãã¡ãã«ã¾ã¨ãã¦ãã¾ãã y-nakajo.hatenablog.com OpenZeppelin(zeppelin-solidity)ã¯Ethereumã®Contractä½ããªã使ããªãã¨æã ãï¼ã£ã¦ããã便å©ãªContractã®ã©â¦