Skip to content

Instantly share code, notes, and snippets.

View wissalHaji's full-sized avatar

Wissal Haji wissalHaji

View GitHub Profile
@wissalHaji
wissalHaji / address.sol
Last active October 27, 2020 09:08
address payable to address conversion
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
contract HelloWorldContract {
function transferFund(address payable receiver, uint amount) payable external {
address newAddress = receiver;
receiver.transfer(amount); // OK
@wissalHaji
wissalHaji / HelloWorld.sol
Last active October 26, 2020 19:56
State and local variables in solidity
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.7.0;
contract HelloWorldContract {
address owner; // state variable
function helloWorld() external pure returns(string memory){