Skip to content

Commit

Permalink
fix spacing in smart contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDedominici committed Feb 13, 2024
1 parent d30753f commit 2a0dc90
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 76 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ pragma solidity ^0.8.24;
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);
event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);
constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}
unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);
emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
owner.transfer(address(this).balance);
}
}
38 changes: 19 additions & 19 deletions packages/hardhat-core/sample-projects/javascript/contracts/Lock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ pragma solidity ^0.8.24;
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);
event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);
constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}
unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);
emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
owner.transfer(address(this).balance);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ pragma solidity ^0.8.24;
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);
event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);
constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}
unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);
emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
owner.transfer(address(this).balance);
}
}
38 changes: 19 additions & 19 deletions packages/hardhat-core/sample-projects/typescript/contracts/Lock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ pragma solidity ^0.8.24;
// import "hardhat/console.sol";

contract Lock {
uint public unlockTime;
address payable public owner;
uint public unlockTime;
address payable public owner;

event Withdrawal(uint amount, uint when);
event Withdrawal(uint amount, uint when);

constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);
constructor(uint _unlockTime) payable {
require(
block.timestamp < _unlockTime,
"Unlock time should be in the future"
);

unlockTime = _unlockTime;
owner = payable(msg.sender);
}
unlockTime = _unlockTime;
owner = payable(msg.sender);
}

function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
function withdraw() public {
// Uncomment this line, and the import of "hardhat/console.sol", to print a log in your terminal
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);

require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");
require(block.timestamp >= unlockTime, "You can't withdraw yet");
require(msg.sender == owner, "You aren't the owner");

emit Withdrawal(address(this).balance, block.timestamp);
emit Withdrawal(address(this).balance, block.timestamp);

owner.transfer(address(this).balance);
}
owner.transfer(address(this).balance);
}
}

0 comments on commit 2a0dc90

Please sign in to comment.