forked from AL0YSI0US/scaffold-eth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
turn on network check with auto switch button, clean up contract so i…
…t is super simple, updates s3 script
- Loading branch information
Austin Griffith
committed
Jul 8, 2021
1 parent
1e4793d
commit 74ea431
Showing
4 changed files
with
90 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,22 @@ | ||
pragma solidity >=0.8.0 <0.9.0; | ||
//SPDX-License-Identifier: MIT | ||
|
||
import "hardhat/console.sol"; | ||
//import "hardhat/console.sol"; | ||
//import "@openzeppelin/contracts/access/Ownable.sol"; //https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol | ||
|
||
contract YourContract { | ||
|
||
event SetPurpose(address sender, string purpose); | ||
//event SetPurpose(address sender, string purpose); | ||
|
||
string public purpose = "Building Unstoppable Apps"; | ||
|
||
error EmptyPurposeError(uint code, string message); | ||
|
||
constructor() { | ||
// what should we do on deploy? | ||
} | ||
|
||
function setPurpose(string memory newPurpose) public { | ||
if(bytes(newPurpose).length == 0){ | ||
revert EmptyPurposeError({ | ||
code: 1, | ||
message: "Purpose can not be empty" | ||
}); | ||
} | ||
|
||
purpose = newPurpose; | ||
console.log(msg.sender,"set purpose to",purpose); | ||
emit SetPurpose(msg.sender, purpose); | ||
//console.log(msg.sender,"set purpose to",purpose); | ||
//emit SetPurpose(msg.sender, purpose); | ||
} | ||
} |
This file contains 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
This file contains 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