Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formatter Update #116

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions contracts/EthStorageUpgradeableProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ pragma solidity ^0.8.20;
import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

contract EthStorageUpgradeableProxy is TransparentUpgradeableProxy {
constructor(
address _logic,
address initialOwner,
bytes memory _data
) payable TransparentUpgradeableProxy(_logic, initialOwner, _data) {}
constructor(address _logic, address initialOwner, bytes memory _data)
payable
TransparentUpgradeableProxy(_logic, initialOwner, _data)
{}

function admin() public view virtual returns (address) {
return ERC1967Utils.getAdmin();
Expand Down
8 changes: 3 additions & 5 deletions contracts/Interfaces/IProxyAdmin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ pragma solidity ^0.8.20;
import {ITransparentUpgradeableProxy} from "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

interface IProxyAdmin {
function upgradeAndCall(
ITransparentUpgradeableProxy proxy,
address implementation,
bytes memory data
) external payable;
function upgradeAndCall(ITransparentUpgradeableProxy proxy, address implementation, bytes memory data)
external
payable;
}
2 changes: 1 addition & 1 deletion contracts/StorageContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ abstract contract StorageContract is DecentralizedKV {
/// @notice Fund tracker for prepaid
uint256 public accPrepaidAmount;

/// @notice Reentrancy lock
/// @notice Reentrancy lock
bool private transient locked;

// TODO: Reserve extra slots (to a total of 50?) in the storage layout for future upgrades
Expand Down
32 changes: 15 additions & 17 deletions contracts/libraries/MerkleLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,11 @@ library MerkleLib {
}

// Verify the if the hash of a chunk data is in the chunks
function verify(
bytes32 dataHash,
uint256 chunkIdx,
bytes32 root,
bytes32[] memory proofs
) internal pure returns (bool) {
function verify(bytes32 dataHash, uint256 chunkIdx, bytes32 root, bytes32[] memory proofs)
internal
pure
returns (bool)
{
bytes32 hash = dataHash;
uint256 nChunkBits = proofs.length;
require(chunkIdx < (1 << nChunkBits), "chunkId overflows");
Expand All @@ -95,11 +94,11 @@ library MerkleLib {
return hash == root;
}

function calculateRootWithProof(
bytes32 dataHash,
uint256 chunkIdx,
bytes32[] memory proofs
) internal pure returns (bytes32) {
function calculateRootWithProof(bytes32 dataHash, uint256 chunkIdx, bytes32[] memory proofs)
internal
pure
returns (bytes32)
{
bytes32 hash = dataHash;
uint256 nChunkBits = proofs.length;
require(chunkIdx < (1 << nChunkBits), "chunkId overflows");
Expand All @@ -115,12 +114,11 @@ library MerkleLib {
return hash;
}

function getProof(
bytes memory data,
uint256 chunkSize,
uint256 nChunkBits,
uint256 chunkIdx
) internal pure returns (bytes32[] memory) {
function getProof(bytes memory data, uint256 chunkSize, uint256 nChunkBits, uint256 chunkIdx)
internal
pure
returns (bytes32[] memory)
{
uint256 nChunks = 1 << nChunkBits;
require(chunkIdx < nChunks, "index out of scope");
bytes32[] memory nodes = new bytes32[](nChunks);
Expand Down
Loading
Loading