Skip to content

Commit

Permalink
chore: Boring names (#9725)
Browse files Browse the repository at this point in the history
Fixes #8328 by using boring names. 

Ends up with a lot of tiny changes in the form of paths and variable
names etc. Some of the environment variable names are changed.



![The Big Lebowski Goodnight Sweet Prince
GIF](https://media1.giphy.com/media/jtUiNaYnqZZlu/giphy.gif)

---------

Co-authored-by: just-mitch <[email protected]>
  • Loading branch information
LHerskind and just-mitch authored Nov 7, 2024
1 parent d5e9a98 commit 2509e2f
Show file tree
Hide file tree
Showing 131 changed files with 1,246 additions and 1,083 deletions.
9 changes: 2 additions & 7 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"acvm",
"addrs",
"alphanet",
"Apella",
"Governance",
"archiver",
"assignement",
"asyncify",
Expand Down Expand Up @@ -102,7 +102,6 @@
"fullpath",
"fuzzer",
"fuzzers",
"Gerousia",
"gitmodules",
"gitrepo",
"Gossipable",
Expand Down Expand Up @@ -169,7 +168,6 @@
"nodebuffer",
"noirc",
"noirup",
"Nomismatokopio",
"nullifer",
"offchain",
"onchain",
Expand Down Expand Up @@ -250,7 +248,6 @@
"subrepo",
"subroot",
"suyash",
"Sysstia",
"templating",
"tldr",
"toplevel",
Expand Down Expand Up @@ -316,7 +313,5 @@
"lib",
"*.cmake"
],
"flagWords": [
"anonymous"
]
"flagWords": ["anonymous"]
}
2 changes: 1 addition & 1 deletion l1-contracts/.rebuild_patterns
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
^l1-contracts/src/.*\.sol$
^l1-contracts/test/governance/scenario/NewGerousiaPayload.sol$
^l1-contracts/test/governance/scenario/NewGovernanceProposerPayload.sol$
22 changes: 11 additions & 11 deletions l1-contracts/src/core/Rollup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {TxsDecoder} from "@aztec/core/libraries/TxsDecoder.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
import {ProofCommitmentEscrow} from "@aztec/core/ProofCommitmentEscrow.sol";
import {ISysstia} from "@aztec/governance/interfaces/ISysstia.sol";
import {IRewardDistributor} from "@aztec/governance/interfaces/IRewardDistributor.sol";
import {MockVerifier} from "@aztec/mock/MockVerifier.sol";
import {IERC20} from "@oz/token/ERC20/IERC20.sol";
import {SafeERC20} from "@oz/token/ERC20/utils/SafeERC20.sol";
Expand Down Expand Up @@ -64,7 +64,7 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Leonidas, IRollup, ITestRollup {
IProofCommitmentEscrow public immutable PROOF_COMMITMENT_ESCROW;
uint256 public immutable VERSION;
IFeeJuicePortal public immutable FEE_JUICE_PORTAL;
ISysstia public immutable SYSSTIA;
IRewardDistributor public immutable REWARD_DISTRIBUTOR;
IERC20 public immutable ASSET;
IVerifier public epochProofVerifier;

Expand All @@ -87,15 +87,15 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Leonidas, IRollup, ITestRollup {

constructor(
IFeeJuicePortal _fpcJuicePortal,
ISysstia _sysstia,
IRewardDistributor _rewardDistributor,
bytes32 _vkTreeRoot,
bytes32 _protocolContractTreeRoot,
address _ares,
address[] memory _validators
) Leonidas(_ares) {
epochProofVerifier = new MockVerifier();
FEE_JUICE_PORTAL = _fpcJuicePortal;
SYSSTIA = _sysstia;
REWARD_DISTRIBUTOR = _rewardDistributor;
ASSET = _fpcJuicePortal.UNDERLYING();
PROOF_COMMITMENT_ESCROW = new ProofCommitmentEscrow(ASSET, address(this));
INBOX = IInbox(address(new Inbox(address(this), Constants.L1_TO_L2_MSG_SUBTREE_HEIGHT)));
Expand Down Expand Up @@ -240,11 +240,11 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Leonidas, IRollup, ITestRollup {
// @note Only if the rollup is the canonical will it be able to meaningfully claim fees
// Otherwise, the fees are unbacked #7938.
bool isFeeCanonical = address(this) == FEE_JUICE_PORTAL.canonicalRollup();
bool isSysstiaCanonical = address(this) == SYSSTIA.canonicalRollup();
bool isRewardDistributorCanonical = address(this) == REWARD_DISTRIBUTOR.canonicalRollup();

uint256 totalProverReward = 0;

if (isFeeCanonical || isSysstiaCanonical) {
if (isFeeCanonical || isRewardDistributorCanonical) {
for (uint256 i = 0; i < _epochSize; i++) {
address coinbase = address(uint160(uint256(publicInputs[9 + i * 2])));
uint256 reward = 0;
Expand All @@ -258,8 +258,8 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Leonidas, IRollup, ITestRollup {
}
}

if (isSysstiaCanonical) {
reward += SYSSTIA.claim(address(this));
if (isRewardDistributorCanonical) {
reward += REWARD_DISTRIBUTOR.claim(address(this));
}

if (coinbase == address(0)) {
Expand Down Expand Up @@ -498,16 +498,16 @@ contract Rollup is EIP712("Aztec Rollup", "1"), Leonidas, IRollup, ITestRollup {
_fakeBlockNumberAsProven(blockNumber);

bool isFeeCanonical = address(this) == FEE_JUICE_PORTAL.canonicalRollup();
bool isSysstiaCanonical = address(this) == SYSSTIA.canonicalRollup();
bool isRewardDistributorCanonical = address(this) == REWARD_DISTRIBUTOR.canonicalRollup();

if (isFeeCanonical && header.globalVariables.coinbase != address(0) && header.totalFees > 0) {
// @note This will currently fail if there are insufficient funds in the bridge
// which WILL happen for the old version after an upgrade where the bridge follow.
// Consider allowing a failure. See #7938.
FEE_JUICE_PORTAL.distributeFees(header.globalVariables.coinbase, header.totalFees);
}
if (isSysstiaCanonical && header.globalVariables.coinbase != address(0)) {
SYSSTIA.claim(header.globalVariables.coinbase);
if (isRewardDistributorCanonical && header.globalVariables.coinbase != address(0)) {
REWARD_DISTRIBUTOR.claim(header.globalVariables.coinbase);
}

emit L2ProofVerified(blockNumber, "CHEAT");
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/interfaces/IRollup.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/interfaces/IVerifier.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

interface IVerifier {
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/interfaces/messagebridge/IInbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {DataStructures} from "../../libraries/DataStructures.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants in circuits.js
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

/**
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/Errors.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {Timestamp, Slot, Epoch} from "@aztec/core/libraries/TimeMath.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/HeaderLib.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {Constants} from "@aztec/core/libraries/ConstantsGen.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/TxsDecoder.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {Constants} from "@aztec/core/libraries/ConstantsGen.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/crypto/FrontierLib.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {Hash} from "@aztec/core/libraries/crypto/Hash.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/libraries/crypto/Hash.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/messagebridge/Inbox.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2023 Aztec Labs.
// Copyright 2024 Aztec Labs.
pragma solidity >=0.8.27;

import {ICoinIssuer} from "@aztec/governance/interfaces/ICoinIssuer.sol";
import {IMintableERC20} from "@aztec/governance/interfaces/IMintableERC20.sol";
import {INomismatokopio} from "@aztec/governance/interfaces/INomismatokopio.sol";
import {Errors} from "@aztec/governance/libraries/Errors.sol";
import {Ownable} from "@oz/access/Ownable.sol";

contract Nomismatokopio is INomismatokopio, Ownable {
/**
* @title CoinIssuer
* @author Aztec Labs
* @notice A contract that allows minting of coins at a maximum fixed rate
*/
contract CoinIssuer is ICoinIssuer, Ownable {
IMintableERC20 public immutable ASSET;
uint256 public immutable RATE;
uint256 public timeOfLastMint;
Expand All @@ -26,9 +31,9 @@ contract Nomismatokopio is INomismatokopio, Ownable {
* @param _to - The address to receive the funds
* @param _amount - The amount to mint
*/
function mint(address _to, uint256 _amount) external override(INomismatokopio) onlyOwner {
function mint(address _to, uint256 _amount) external override(ICoinIssuer) onlyOwner {
uint256 maxMint = mintAvailable();
require(_amount <= maxMint, Errors.Nomismatokopio__InssuficientMintAvailable(maxMint, _amount));
require(_amount <= maxMint, Errors.CoinIssuer__InssuficientMintAvailable(maxMint, _amount));
timeOfLastMint = block.timestamp;
ASSET.mint(_to, _amount);
}
Expand All @@ -38,7 +43,7 @@ contract Nomismatokopio is INomismatokopio, Ownable {
*
* @return The amount mintable
*/
function mintAvailable() public view override(INomismatokopio) returns (uint256) {
function mintAvailable() public view override(ICoinIssuer) returns (uint256) {
return RATE * (block.timestamp - timeOfLastMint);
}
}
Loading

0 comments on commit 2509e2f

Please sign in to comment.