This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.22; | |
| contract calledContract { | |
| event callEvent(address sender, address origin, address from); | |
| function calledFunction() public { | |
| emit callEvent(msg.sender, tx.origin, this); | |
| } | |
| } | |
| library calledLibrary { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Version of Solidity compiler this program was written for | |
| pragma solidity ^0.4.22; | |
| contract owned { | |
| address owner; | |
| // Contract constructor: set owner | |
| constructor() public{ | |
| owner = msg.sender; | |
| } | |
| // Access control modifier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.22; | |
| contract Faucet2{ | |
| address owner; | |
| // Initialize Faucet contract: set owner | |
| constructor() public { | |
| owner = msg.sender; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.4; | |
| // Our first contract is a faucet! | |
| contract Faucet { | |
| // Accept any incoming amount | |
| receive() external payable {} | |
| // Give out ether to anyone who asks | |
| function withdraw(uint withdraw_amount) public { | |
| // Limit withdrawal amount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: CC-BY-SA-4.0 | |
| pragma solidity ^0.8.9; | |
| contract Faucet5{ | |
| address payable owner; | |
| // Initialize Faucet contract: set owner | |
| constructor() { | |
| owner = payable(msg.sender); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: CC-BY-SA-4.0 | |
| pragma solidity ^0.8.9; | |
| contract Faucet4{ | |
| address payable owner; | |
| // Initialize Faucet contract: set owner | |
| constructor() { | |
| owner = payable(msg.sender); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: CC-BY-SA-4.0 | |
| pragma solidity ^0.4.19; | |
| contract Faucet6{ | |
| // Give out ether to anyone who asks | |
| function withdraw(uint withdraw_amount) public { | |
| // Limit withdrawal amount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: CC-BY-SA-4.0 | |
| pragma solidity ^0.8.9; | |
| contract Faucet7{ | |
| address payable owner; | |
| // Initialize Faucet contract: set owner | |
| constructor() { | |
| owner = payable(msg.sender); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from lark import Lark | |
| tree_grammar = r""" | |
| IDENTIFIER: ( LETTER | DIGIT | ".") + | |
| string : ( WORD | expr | logic ) * | |
| expr : "${" TARGETS ":" IDENTIFIER "}" | |
| simple : expr OPERATIONS SIGNED_NUMBER | |
| composed : "(" (expr | OPERATIONS | simple | composed)+ ")" //logical operations which can be composed from 'expr', 'OPERATIONS' ,'simple' ,'composed' expressions, which should occure at least once | |
| logic : "$(" (expr | OPERATIONS | simple | composed)+ ")" //logical operations which can be composed from 'expr', 'OPERATIONS' ,'simple' ,'composed' expressions, which should occure at least once |