Tags
- 좋은 개발자
- postman session
- postman csv
- postman excel
- MFC
- postman collection
- oracle
- postman
- postman html parse
- Front-end developer
- Java
- UI/UX Engineer
- C++
- 다빈치 리졸브
- Interaction developer
- 우수한 프런트 개발자
- LSL_Script
- postman collection variables
- Unity
- postman tests
- solidity
- Android
- Intellij
- web developer
- 프런트엔드
- emplace_back
- Android/iOS Developer
- c#
- postman pre-request
- postman automations
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Archives
- Today
- Total
david's daily developer note
[Solidity] 3.Event 본문
728x90
솔리디티는 연결된 앱에서 특정 이벤트가 발생할때, 그 결과를 받을 수 있도록 할 수 있다.
// define Event
event SuccessRegister(string id);
contract AccountProcess {
function register(string id, string password) {
SuccessRegister(id); // execute event
}
}
예제는 register함수에서 새로운 사용자가 등록되면,
등록된 SuccessRegister 이벤트를 Send하는 스마트 컨트랙트 코드이다.
스마트 컨트랙트가 이벤트를 보내면, DApp의 클라이언트에서 SuccessRegister 이벤트를 Listen하는 방식이다.
다음은 스마트 컨트랙트의 SuccessRegister 이벤트에 대한 자바 스크립트로 예시이다.
MyContract.SuccessRegister(function(error,result) {
})
728x90
'[Blockchain] > develop' 카테고리의 다른 글
[Solidity] 5.Error handling : Assert, Require, Revert (0) | 2022.08.16 |
---|---|
[Solidity] 4.Mapping (0) | 2022.08.15 |
[Solidity] 2.Function (0) | 2022.08.14 |
[Solidity] 1.Basics & Language description (0) | 2022.08.13 |