ðWeb3å»çDAppãéçºããïŒð
çããããã«ã¡ã¯ïŒïŒ
ä»åã¯ãã¹ããŒãã³ã³ãã©ã¯ããå©çšããŠæ£è
ã®å»çããŒã¿ã管çããã¢ããªãéçºããã¢ããªã®äœæã«æãã§ã¿ãŸããã®ã§ãã®éçšçããŸãšããŠãããŸãïŒ
UNCHAINãšããWeb3ãšã³ãžãã¢ã³ãã¥ããã£ã«åå ãããŠããã ããŠããã®ã§ãããäžå®æ¡ä»¶ãæºãããšUNCHAIN STARãšãªãããšãã§ããŸãã
ãã®äžå®æ¡ä»¶ãšããã®ããUNCHAIN STARè©Šéšã«åæ Œãããšãããã®ã§ãïŒ
ç®æ¬¡
- éçºããã¢ããªã®æŠèŠ
- ç°¡åãªæ©èœäžèŠ§çã®èª¬æ
- ç»é¢ã®èª¬æ
- æåŸã«
éçºããã¢ããªã®æŠèŠ
ä»åææŠããè©Šéšã®æŠèŠã¯äžã®ãµã€ããã芧ãã ããïŒ
ãŸããverceläžã«ã¢ããªãå ¬éããŠãããŸãã®ã§ããŸãã¢ããªã«è§ŠããŠã¿ããïŒãšããæ¹ã¯äžã®URLããã¢ã¯ã»ã¹ããŠãã ããïŒ
ãã£ãããšèª¬æãããšæ£è ãšå»è ã®éã§ããåãããã«ã«ãæ å ±ã®ç®¡çãšæ²»çè²»ãšæ¯æããå»åž«ã®ç»é²ãå¯èœãšããWeb3ã¢ããªãšãªã£ãŠããŸãïŒç»é¢ã¯4ç»é¢ååšããŠäžèšã®éããšãªã£ãŠããŸãã
No. | ç»é¢å |
---|---|
1 | Connect Walletç»é¢ |
2 | Homeç»é¢ |
3 | Registç»é¢ |
4 | DoctorInfoç»é¢ |
å®éã«æ£è ãšå»è ã®éã§ãã®ã¢ããªã䜿çšããæã®æ³å®ã®ããåãããããŒå³ã«èµ·ããããã®ããããŸãã®ã§ãã¡ãã貌ãä»ããŸãã
ãããã€ããã¹ããŒãã³ã³ãã©ã¯ãã§ããgoreliãšmunbaiã®2ã€ã®ãããã¯ãŒã¯ã«ãããã€ããŸãããå 容ã«ã€ããŠã¯å·®ç°ã¯ãªãã®ã§ã奜ã¿ã®æ¹ãEtherScanãPolygonScanã§ã確èªãã ããã
No | ãããã¯ãŒã¯ | ã³ã³ãã©ã¯ãå | ã¢ãã¬ã¹ |
---|---|---|---|
1 | goreli | MedicalData | 0x177acf501eF7d2b090d94fd3bd2BE773736598E1 |
2 | munbai | MedicalData | 0x83f15ccdD1278908dF5bC646E903afE2f342deC1 |
ç°¡åãªæ©èœäžèŠ§çã®èª¬æ
ããã§ã¯æ©èœçã®è§£èª¬ã«ãªããŸãã
ä»åã®ã¢ããªãäœæããã«ããããäžçªæ žãšãªãMedicalDataã³ã³ãã©ã¯ãã«å®è£
ããæ©èœäžèŠ§ããŸãšããŸãã
æ©èœäžèŠ§è¡š
æ©èœå | 説æ |
---|---|
Connect Wallet æ©èœ | æ£è ãšå»çåŸäºè ã®äž¡æ¹ããèªåã®ãŠã©ã¬ãããã¢ããªã±ãŒã·ã§ã³ã«æ¥ç¶ã§ãã |
å»çããŒã¿é²èŠ§æ©èœ | æ£è ã¯ãã¢ããªã±ãŒã·ã§ã³ã®ããã·ã¥ããŒãã§ãèªåã®ç§å¯éµã䜿ã£ãŠãèªåã®å»çããŒã¿ãé²èŠ§ããããšãã§ãã |
å»çããŒã¿æ°èŠç»é²æ©èœ | æ£è ã®ããŒã¿ãå»è ãæ°èŠã«è¿œå ãã |
ã¢ã¯ã»ã¹èš±å¯æäŸæ©èœ | å»çæäŸè ã«èªåã®å»çããŒã¿ãžã®ã¢ã¯ã»ã¹ãæäŸããæ©èœ |
ç·šéæš©éæ¿èªèŠæ±æ©èœ | æ£è ã®å»çããŒã¿ãç·šéããéãæ£è ã«æ¿èªãæ±ããæ©èœ |
å»çããŒã¿ç·šéæ©èœ | å»çåŸäºè ã¯ãã®æ£è ã®å»çããŒã¿ãç·šéããæ©èœ |
é²èŠ§æš©éå€æŽæ©èœ | å»çããŒã¿ãžã®ã¢ã¯ã»ã¹æš©éãäžåºŠæ¿èªããå»çæäŸè ããå床å¶éã§ããæ©èœ |
å»åž«æ å ±ç»é²æ©èœ | å»è ã®æ å ±ãæ°ãã«ç»é²ã§ããæ©èœ |
å»åž«æ å ±ç¢ºèªæ©èœ | å»è åã¯æ£è ãå»åž«ã®æ å ±ã確èªã§ããæ©èœ |
æ²»çè²»æ¯æãæ©èœ | æ£è ãå»è ã«æ²»çè²»ãæ¯æãæ©èœ |
æ²»çè²»åãåãæ©èœ | å»è ãæ²»çè²»ãåãåãæ©èœ |
ãŸããã³ã³ãã©ã¯ãã«å®è£
ããå€æ°ãšã¡ãœããã®æŠèŠãè¡šã«ãŸãšããŸããã®ã§èšèŒããããŸãã
ååãšæŽæ°æ¥æãè¡æ¶²ããŒã¿ãšããå°ãªãããŒã¿ã ããããã®å®è£
ãããããŸãããããŒã¹éšåã¯ãã®èãæ¹ã§è¯ããšèããŠããŸãã
å€æ°äžèŠ§
å€æ°å | ã¿ã€ã | å 容 |
---|---|---|
owner | address | ã³ã³ãã©ã¯ãã®ç®¡çè |
patientName | String | æ£è ã®åå |
bloodYype | String | è¡æ¶²å |
lastUpdate | String | æçµæŽæ°æ¥æ(yyyy/mm/dd HH:mm:ss 圢åŒ) |
MedicalInsDatas | Struct | æçµæŽæ°æ¥æãæçµæŽæ°å»çæ©é¢ |
medicalData | Struct | æ£è ã®å»çããŒã¿çšã® Struct åã®å€æ° |
doctorInfo | Struct | æ£è ãæã€å»è ã«ã€ããŠã®ããŒã¿ãä¿ç®¡ãã Struct åã®å€æ° |
medicalMap | (address âš medicalData) | æ£è ã®ã¢ãã¬ã¹ãšå»çããŒã¿ãçŽä»ãã Map |
doctorMap | (address â String) | å»è ã®ã¢ãã¬ã¹ãšååãçŽã¥ãã Map |
doctorRoleMap | (address â bool) | ã¢ãã¬ã¹ãå»è ã§ããããšãçŽã¥ãã Map |
doctorBalanceMap | (address â uint256) | å»è ã®ã¢ãã¬ã¹ãšåãåãæ²»çè²»ãçŽã¥ãã Map |
doctors | [address] | å»çæ©é¢ã«æå±ããå»è ã®ã¢ãã¬ã¹ãæ ŒçŽãã |
approveMap | (address âš (address âš boolean)) | æ£è ã®ããŒã¿ã«å¯ŸããŠå»è åŽãé²èŠ§æš©éãææããŠãããä¿æããããã® Map |
requireMap | (address âš (address âš boolean)) | æ£è ã®ããŒã¿ã«å¯ŸããŠå»è åŽãé²èŠ§æš©éãèŠæ±ããŠããç¶æ ãä¿æããããã® Map |
ã¡ãœããäžèŠ§
ã¡ãœããå | å 容 |
---|---|
approve | å»è åŽã«é²èŠ§ã»ç·šéæš©éãä»äžããã¡ãœãã |
changeStatus | é²èŠ§ã»ç·šéæš©éãåæ¢ããã¡ãœãã |
createMedicalData | å»çããŒã¿ãæ°èŠã§ç»é²ããã¡ãœãã |
editMedicalData | å»çããŒã¿ãç·šéããã¡ãœãã |
deleteMedicalData | å»çããŒã¿ãåé€ããã¡ãœãã |
selectMedicalData | èªåã®å»çããŒã¿ãååŸããã¡ãœãã |
selectPatientMedicalData | æ£è ã®å»çããŒã¿ãååŸããã¡ãœãã |
registDoctor | å»åž«ã®ããŒã¿ãæ°ãã«ç»é²ããã¡ãœãã |
claimApprove | æ£è ã«å¯ŸããŠå»åž«ãé²èŠ§æš©éãèŠæ±ã§ããã¡ãœãã |
getDoctors | çŸåšç»é²äžã®å šãŠã®å»åž«ã®ã¢ãã¬ã¹ãååŸããã¡ãœãã |
getDoctorInfo | æ£è ã«çŽã¥ãå šãŠå»åž«ã®æ å ±ãååŸããã¡ãœãã |
pay | æ£è ãå»è ã«æ²»çè²»ãæ¯æãããã®ã¡ãœãã |
withdraw | å»è ãæ²»çè²»ãåãåãããã®ã¡ãœãã |
å»çããŒã¿ãšãã倧åãªããŒã¿ãåãæ±ãã¹ããŒãã³ã³ãã©ã¯ãã§ãã®ã§ãã¹ãã³ãŒãããã£ãããšæžããŸããïŒïŒ ããªãé·ããªã£ãŠããŸãã®ã§ã³ãŒãã®æ²èŒã¯å²æãããŠããã ããŸãããæ£åžžç³»ã¯ãã¡ããã®ããšãå»è ã®æš©éãæã€ã¢ãã¬ã¹ããã®åŒã³åºãããèš±ããªãã¡ãœãããæ£è ã®ã¢ãã¬ã¹ããåŒã³åºãããšããæã«ãšã©ãŒãçºçããããªã©ãç°åžžç³»ã®ãã¹ãã·ããªãªãèšèŒããŠããŸãã
ãã¹ãã®çµæã¯äžèšã®éãã§ãïŒ
Using network 'development'.
Compiling your contracts...
===========================
> Compiling ./contracts/MedicalData.sol
> Artifacts written to /var/folders/0c/vbkwk57s4lb21y1ts4ndr9zh0000gn/T/test--2339-yBPTyliYIpnH
> Compiled successfully using:
- solc: 0.8.0+commit.c7dfd78e.Emscripten.clang
Contract: MedicalData Contract tests!!
initialization
â confirm owner address
â confirm doctor's address (40ms)
â confirm doctor's name (116ms)
get doctor info tests
â get doctor info
add a new doctor
â confirm doctor's address and name (231ms)
â Should revert when contract is called from invalid address (421ms)
approve method tests
â approve (99ms)
â chageStatus (60ms)
â should revert when contract is called from invalid role address (135ms)
â should revert when contract is called from invalid role address (47ms)
claim approve method tests
â require approvement (88ms)
â should revert when contract is called from invalid role address (48ms)
create a new medical data!!
â create (289ms)
â should revert when contract is called from invalid role address
â get patient's medical data (318ms)
â should revert when contract is called from invalid role address (367ms)
â should revert when contract is called from invalid role address (143ms)
update a medical data!!
â edit (589ms)
â should revert when contract is called from invalid role address (420ms)
delete a medical data!!
â delete (528ms)
â should revert when contract is called from invalid role address (305ms)
test for paying Treatment costs!!
value: 10000000000000000
contractBalance: 20000000000000000
â pay !! (393ms)
value: 10000000000000000
â should revert when contract is called from invalid role address (57ms)
value: 10000000000000000
contractBalance: 20000000000000000
â should revert when contract is called from invalid role address (172ms)
24 passing (12s)
ç»é¢ã®èª¬æ
次ã«åç»é¢ã®èª¬æã«ãªããŸãã
ç»é¢ã®ã³ã³ããŒãã³ãèªäœã¯ããŒã¹ãšãªãindex.jsãšApp.jsãé€ããŠå€§ãã4ã€ã®ç»é¢çšã®ã³ã³ããŒãã³ãã§æ§æãããŠããŸããæš©éã«ãã衚瀺ãåãæ¿ãããªã©ããŠããŸãïŒ
1. Connect Wallet ç»é¢
ãŠã©ã¬ããã§æ¥ç¶ããåã®ç»é¢
å³äžã®ãã¿ã³ããæ¥ç¶ããã
2. Home ç»é¢
ãã®ç»é¢ã¯æ¥ç¶ãããŠã©ã¬ããã®ã¢ãã¬ã¹ã«ãã£ãŠæç»ãããå 容ãå€åããŸãã
No. | ãã¿ãŒã³ | æç»ãããå 容 |
---|---|---|
1 | æ£è ã§å»çããŒã¿ãæªç»é²ã®å Žå | ã¡ãã»ãŒãžãæç»ãããã ã |
2 | æ£è ã§å»çããŒã¿ãç»é²ãããŠããå Žå | å»çããŒã¿ãæç»ããã |
3 | å»è ã®å Žå | åæç¶æ ã§ã¯æ€çŽ¢ç»é¢ãæç»ãããã |
4 | å»è ã®å Žåã§æ€çŽ¢ããã¢ãã¬ã¹ããæ¿èªæš©éãä»äžãããŠããªãã£ãå Žå | æ¿èªæš©éãèŠæ±ãããã¿ã³ãæç»ããã |
5 | å»è ã®å Žåã§æ€çŽ¢ããã¢ãã¬ã¹ããæ¿èªæš©éãä»äžãããŠäžã€å»çããŒã¿ãç»é²ãããŠããªãã£ãå Žå | å»çããŒã¿å ¥åãã©ãŒã ãšæ°èŠç»é²ãã¿ã³ãæç»ããã |
6 | å»è ã®å Žåã§æ€çŽ¢ããã¢ãã¬ã¹ããæ¿èªæš©éãä»äžãããŠäžã€å»çããŒã¿ãç»é²ãããŠããå Žå | å»çããŒã¿å ¥åãã©ãŒã ãšæŽæ°ã»åé€ãã¿ã³ããæç»ããã |
Home ç»é¢ ãã¿ãŒã³ 1
Home ç»é¢ ãã¿ãŒã³ 2
Home ç»é¢ ãã¿ãŒã³ 3
Home ç»é¢ ãã¿ãŒã³ 4
Home ç»é¢ ãã¿ãŒã³ 5
Home ç»é¢ ãã¿ãŒã³ 6
3. Regist ç»é¢
ãã®ç»é¢ã¯ç®¡çè
æš©éå°çšã®ç»é¢ã§æ°èŠã«å»è
ãç»é²ããããšãã§ããç»é¢ã«ãªããŸãã
管çè
以å€ãã¢ã¯ã»ã¹ãããšå
¥åãã©ãŒã çã¯æç»ãããŸããã
Regist ç»é¢ 管çè ã®å Žå
Regist ç»é¢ 管çè 以å€ã®å Žå
4. DoctorInfo ç»é¢
ãã®ç»é¢ãæ£è
ãšå»è
ã§ç»é¢è¡šèšãå€åããŸãã
å»è
ã®å Žåã¯èªåã®ã¢ãã¬ã¹ãšååã衚瀺ãããŸãã
æ£è
ã®å Žåã¯ããã®ã³ã³ãã©ã¯ãã«ç»é²ãããŠããå»è
ã®æ
å ±ãšæ¿èªæš©éãä»äžãããã¿ã³ã»å¥å¥ªãããã¿ã³ãæç»ãããŸãã(å»è
ããæ¿èªæš©éãèŠæ±ãããŠããå Žåã«ã¯ãã®æšã®ã¡ãã»ãŒãžã衚瀺ãããŸãã)
DoctorInfo ç»é¢ å»è ã®å Žå
DoctorInfo ç»é¢ æ£è ã®å Žå
æåŸã«
æ®èª²é¡ãšããŠã¯ãå»çããŒã¿ãšãããã©ã€ããŒãããŒã¿ã以äžã«ããŠãªã³ãã§ãŒã³äžã§å®å šã«ç®¡çããããšããããšã§ããçããéå»ã®ãããã¯ããŒã¿ãå šãŠç¢ºèªã§ãããšãããããªãã¯ãããã¯ãã§ãŒã³ã䜿ã£ãŠããããããã®èª²é¡ãªã®ã§ããããããæãé£ããç¹ã ãšèããŠããŸãã
æå·åãããããŒã¿ã§ãã£ãŠããããã¯ã«äžåºŠç»é²ããŠããŸããšéå»ã«é¡ã£ãŠåç §ã§ããŠããŸãã®ã§ãéµã®æ å ±ãæŒæŽ©ããããæå·ã¢ã«ãŽãªãºã ã解èªãããããããšã¢ãŠããªã®ã§ããã¯ãããŒã¿æ¬äœã¯ãªããã§ãŒã³ã®ã»ããè¯ãããã§ãããããããã®ããŒã¿ãã©ãã«ç®¡çããã®ïŒïŒãšãã課é¡ãåºãŠããããã§é£ããã§ããç¬ã
EUã§é²ããŠãããšããããžã¿ã«IDãŠã©ã¬ããã®ä»çµã¿ãæ°ã«ãªããšããã§ã¯ãããŸãããSBTã Lit Protocolçã䜿ã£ãŠã¢ã¯ã»ã¹ã³ã³ãããŒã«ãããŸãå¶åŸ¡ã§ããã°é¢çœãããªã¢ããªãåºæ¥ããã§ãïŒïŒåŒãç¶ãã¢ããªãæ¹è¯ããŠãããããšæããŸãïŒ
èªãã§ããã ãããããšãããããŸããïŒïŒ
Discussion