Solidity - First Application
BlockChain,NFT,Web3.0/Solidity 2022. 1. 14. 18:13https://www.tutorialspoint.com/solidity/solidity_first_application.htm
pragma solidity ^0.5.0;
contract SolidityTest {
constructor() public{
}
function getResult() public view returns(uint){
uint a = 1;
uint b = 2;
uint result = a + b;
return result;
}
}
- Visibility ( public / external ) is not needed for constructors anymore: To prevent a contract from being created, it can be marked abstract . This makes the visibility concept for constructors obsolete.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract SolidityTest {
function getResult() public pure returns(uint){
uint a = 1;
uint b = 2;
uint result = a + b;
return result;
}
}
solidity tutorial
https://youtube.com/playlist?list=PLbbtODcOYIoE0D6fschNU4rqtGFRpk3ea
'BlockChain,NFT,Web3.0 > Solidity' 카테고리의 다른 글
solidity 05. 변수 스코프 (0) | 2022.01.15 |
---|---|
solidity 04. 변수 및 데이터 타입 (0) | 2022.01.15 |
solidity 02. 기본 문법 (0) | 2022.01.15 |
solidity 01. 개요 (0) | 2022.01.14 |
Study01. Hello, Solidity (0) | 2022.01.08 |