Skip to content

Commit

Permalink
Slidity Truffle Dev Structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Noor Mohammed committed Dec 11, 2021
0 parents commit a5f080f
Show file tree
Hide file tree
Showing 12 changed files with 2,084 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
build/contracts
14 changes: 14 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 2,
"useTabs": true,
"singleQuote": false,
"bracketSpacing": true
}
}
]
}
19 changes: 19 additions & 0 deletions contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10 <0.9.0;

contract Migrations {
address public owner = msg.sender;
uint256 public last_completed_migration;

modifier restricted() {
require(
msg.sender == owner,
"This function is restricted to the contract's owner"
);
_;
}

function setCompleted(uint256 completed) public restricted {
last_completed_migration = completed;
}
}
12 changes: 12 additions & 0 deletions contracts/whistlerblower.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.10 <0.9.0;

contract whistlerblower {
constructor() {
callMe();
}

function callMe() public pure returns (string memory) {
return "Hello World!";
}
}
5 changes: 5 additions & 0 deletions migrations/1_initial_migration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const Migrations = artifacts.require("Migrations");

module.exports = function (deployer) {
deployer.deploy(Migrations);
};
5 changes: 5 additions & 0 deletions migrations/2_whistlerblower_migration .js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const WhistlerBlower = artifacts.require("whistlerblower");

module.exports = function (deployer) {
deployer.deploy(WhistlerBlower);
};
Loading

0 comments on commit a5f080f

Please sign in to comment.