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-1.0 | |
| // Creative Commons Attribution 1.0 Generic | |
| // Contract will be compiled on version 0.7.0 or greater | |
| pragma solidity ^0.8.0; | |
| // A smart contract to model an Id Card | |
| contract IdCard { | |
| string public constant CONTRACT_AUTHOR = 'Marco Amadei'; | |
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 <0.9.0; | |
| contract Oracle { | |
| struct Request { | |
| bytes data; | |
| function(uint) external callback; | |
| } | |
| Request[] requests; | |
| event NewRequest(uint index); | |
| function query(bytes memory data, function(uint) external callback) public { | |
| requests.push(Request(data, callback)); |
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: GPL-3.0 | |
| pragma solidity ^0.8.7; | |
| import "hardhat/console.sol"; | |
| contract ReceiveEther { | |
| /*ppp */ | |
| event Called(string fun); | |
| /* | |
| Which function is called, fallback() or receive()? | |
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: GPL-3.0 | |
| pragma solidity ^0.8.7; | |
| import "hardhat/console.sol"; | |
| contract ReceiveEther { | |
| /*ppp */ | |
| event Called(string fun); | |
| /* | |
| Which function is called, fallback() or receive()? | |
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: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.9.0; | |
| import "hardhat/console.sol"; | |
| /** | |
| * @title Owner | |
| * @dev Set & change owner | |
| */ |
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-1.0 | |
| // Creative Commons Attribution 1.0 Generic | |
| // Contract will be compiled on version 0.7.0 or greater | |
| pragma solidity ^0.8.0; | |
| // A smart contract to model an Id Card | |
| contract IdCard { | |
| string public constant CONTRACT_AUTHOR = 'Marco Amadei'; | |
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-1.0 | |
| // Creative Commons Attribution 1.0 Generic | |
| pragma solidity >=0.8.0 <0.9.0; | |
| abstract contract Parent1 { | |
| enum Answer {A,B,C,D} | |
| uint[] public results ; | |
| constructor (uint[3] |
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: GPL-3.0 | |
| pragma solidity >=0.4.22 <0.9.0; | |
| contract Oracle { | |
| struct Request { | |
| bytes data; | |
| function(uint) external callback; | |
| } | |
| Request[] private requests; | |
| event NewRequest(uint); | |
| function query(bytes memory data, function(uint) external callback) public { |
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-1.0 | |
| // Creative Commons Attribution 1.0 Generic | |
| // Contract will be compiled on version 0.7.0 or greater | |
| pragma solidity ^0.8.0; | |
| contract Utility { | |
| // The owner of the current instance of this smart contract | |
| address owner; | |
| // Event which will be raised anytime the current id information is updated. |
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-1.0 | |
| // Creative Commons Attribution 1.0 Generic | |
| // Contract will be compiled on version 0.7.0 or greater | |
| pragma solidity ^0.8.0; | |
| contract Utility { | |
| // The owner of the current instance of this smart contract | |
| address owner; | |
| // Event which will be raised anytime the current id information is updated. |
NewerOlder