Solidity - First Application

BlockChain,NFT,Web3.0/Solidity 2022. 1. 14. 18:13
반응형

https://www.tutorialspoint.com/solidity/solidity_first_application.htm

 

Solidity - First Application

Solidity - First Application We're using Remix IDE to Compile and Run our Solidity Code base. Step 1 − Copy the given code in Remix IDE Code Section. Example pragma solidity ^0.5.0; contract SolidityTest { constructor() public{ } function getResult() pub

www.tutorialspoint.com

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;
   }
}

https://docs.soliditylang.org/en/v0.6.8/layout-of-source-files.html

  • 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.

https://forum.openzeppelin.com/t/visibility-for-constructor-is-ignored-error-migrating-a-simple-erc20-constructor/5052

 

//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 

 

Solidity Tutorial

 

www.youtube.com

 

반응형

'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
: