Skip to content

Conversation

@chrismaree
Copy link
Member

No description provided.

chrismaree and others added 30 commits January 28, 2022 14:04
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>

// First, update fee counters and local accounting of finalized transfers from L2 -> L1.
_updateAccumulatedLpFees(l1Token); // Accumulate all allocated fees from the last time this method was called.
// _sync(); // Fetch any balance changes due to token bridging finalization and factor them in.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sync will be implemented in a later PR.

Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
);
}

function _exchangeRateCurrent(address l1Token) internal returns (uint256) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is very similar to that implemented in v1. main differences are we now consider all variables on the associated pooledToken l1Token and I cleaned up/simplified a small bit of the logic.

Signed-off-by: chrismaree <christopher.maree@gmail.com>
Comment on lines +521 to +534
function _updateAccumulatedLpFees(PooledToken storage pooledToken) internal {
uint256 accumulatedFees = _getAccumulatedFees(pooledToken.undistributedLpFees, pooledToken.lastLpFeeUpdate);
pooledToken.undistributedLpFees -= accumulatedFees;
pooledToken.lastLpFeeUpdate = uint32(getCurrentTime());
}

// Calculate the unallocated accumulatedFees from the last time the contract was called.
function _getAccumulatedFees(uint256 undistributedLpFees, uint256 lastLpFeeUpdate) internal view returns (uint256) {
// accumulatedFees := min(undistributedLpFees * lpFeeRatePerSecond * timeFromLastInteraction ,undistributedLpFees)
// The min acts to pay out all fees in the case the equation returns more than the remaining a fees.
uint256 timeFromLastInteraction = getCurrentTime() - lastLpFeeUpdate;
uint256 maxUndistributedLpFees = (undistributedLpFees * lpFeeRatePerSecond * timeFromLastInteraction) / (1e18);
return maxUndistributedLpFees < undistributedLpFees ? maxUndistributedLpFees : undistributedLpFees;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these methods are numerically equivalent to v1. I make small stylistic changes to be consistant with how code is written in this repo. Note that I am passing around a storage instance of the pooledToken, which is modified n the _updateAccumulatedLpFees method.


import "@uma/core/contracts/common/implementation/ExpandedERC20.sol";

contract LpTokenFactory is LpTokenFactoryInterface {
Copy link
Member Author

@chrismaree chrismaree Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bytecode saving.

@@ -0,0 +1,108 @@
import { expect } from "chai";
Copy link
Member Author

@chrismaree chrismaree Feb 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please read through this test file! the second test covers a full commented evaluation of fees over a smear period.

@chrismaree chrismaree marked this pull request as ready for review February 4, 2022 23:55
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
@chrismaree chrismaree changed the title Initial fees tracking implementation feat: Initial fees tracking implementation Feb 5, 2022
Comment on lines +11 to +12
_append("Across ", IERC20Metadata(l1Token).name(), " LP Token"), // LP Token Name
_append("Av2-", IERC20Metadata(l1Token).symbol(), "-LP"), // LP Token Symbol
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like that all these string constants, etc can sit here. As a side note, we should run these names by the rest of the team.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup! saves a fair bit. for now I think it's fine. I dont think it's super important, as long as it's diffrent to the other tokens.

Comment on lines +52 to +58
address lpToken;
bool isEnabled;
uint256 liquidReserves;
int256 utilizedReserves;
uint256 undistributedLpFees;
uint32 lastLpFeeUpdate;
bool isWeth;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we get gas savings (might not matter in the happy path) by moving the address, bools, and uint32 to all be next to one another?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup. will pack them more closely.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually did this in a follow on PR. will leave it for that PR to make the change.

uint256 destinationChainId
address destinationToken
) public onlyOwner {
whitelistedRoutes[originToken][destinationChainId] = destinationToken;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this function also call setEnableRoute cross-chain on the spoke pool? No need to do anything now but maybe worth adding a TODO comment to remind ourselves to implement in a separate PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! in the future, it will. will add a TODO.

uint256(amount), // amount
l1Tokens[i], // l1Token.
whitelistedRoutes[l1Tokens[i]][chainId], // l2Token.
uint256(netSendAmounts[i]), // amount.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is it safer or unneccessary to multiply a int256 by -1 before casting to uint256?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is safe. line 473 checks if (netSendAmounts[i] > 0) { so this will never cast a negative number.

// Update internal fee counters by adding in any accumulated fees from the last time this logic was called.
function _updateAccumulatedLpFees(PooledToken storage pooledToken) internal {
uint256 accumulatedFees = _getAccumulatedFees(pooledToken.undistributedLpFees, pooledToken.lastLpFeeUpdate);
pooledToken.undistributedLpFees -= accumulatedFees;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a += instead of a -=?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its weird that we fetch all accumulated fees in the contract and then subtract that amoutn from the undistributed LP fees. I would have instinctively guessed that "undistributed fees" are added to.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nooope. pooledToken.undistributedLpFees is decremented as fees are attributed to LPs.

ExchangeRate := (liquidReserves + utilizedReserves - undistributedLpFees) / lpTokenSupply

importantly, exchange rate grows as undistributedLpFees shrinks. once all undistributed fees have been distributed, undistributedLpFees is set to zero.

// Check that there is enough liquid reserves to withdraw the requested amount.
// require(liquidReserves >= (pendingReserves + l1TokensToReturn), "Utilization too high to remove"); // TODO: add this when we have liquid reserves variable implemented.
require(pooledTokens[l1Token].isWeth || !sendEth, "Cant send eth");
uint256 l1TokensToReturn = (lpTokenAmount * _exchangeRateCurrent(l1Token)) / 1e18;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can _exchangeRateCurrent be 0?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope. it should never be 0. it should start at 1 and grow over time as each LP token is redeemable for more underlying.

Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this is a lot of good work, it helps that most of the logic is copied from V1 but that statement is hard to verify itself. Looks good overall

Copy link
Contributor

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once mine and Nick's comments are resolved!

Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
Signed-off-by: chrismaree <christopher.maree@gmail.com>
@chrismaree chrismaree merged commit 5b71325 into master Feb 8, 2022
@chrismaree chrismaree deleted the chrismaree/fees-tracking branch February 8, 2022 19:10
pxrl pushed a commit that referenced this pull request Feb 7, 2024
pxrl added a commit that referenced this pull request Feb 8, 2024
… To HubPool (#21) (#423)

These chain-specific bridge events contained some subtle errors, but add
no marginal value over the TokensBridged event emitted in the parent
contract. Remove them because they're not currently used by any known
event consumers and have no identifiable benefit.

Authored-by Nick & cherry-picked by me.
pxrl pushed a commit that referenced this pull request Feb 8, 2024
grasphoper added a commit that referenced this pull request Dec 8, 2025
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: nicholaspai npai.nyc@gmail.com
Signed-off-by: nicholaspai <npai.nyc@gmail.com>
Signed-off-by: Taylor Webb <tbwebb22@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
Co-authored-by: Taylor Webb <84364476+tbwebb22@users.noreply.github.com>
Co-authored-by: Taylor Webb <tbwebb22@gmail.com>
grasphoper added a commit that referenced this pull request Dec 9, 2025
* feat: Hypercorelib (#1137)

* HyperCoreLib init commit

* add functions for submitting and canceling limit orders

* clean up function & variable naming

* add tokenInfo getter function

* split HyperCoreLib into two libraries

* rename helper library

* add function for bridging to self on Core

* Update natspec and naming

* fix natspec

* combine libraries into single library with MIT license

* make all function camelCase

* Make tif order types into enum

* check tif against tif.max

* feat: Hypercorelib - clean up decimal conversion functions (#1139)

* HyperCoreLib init commit

* add functions for submitting and canceling limit orders

* clean up function & variable naming

* add tokenInfo getter function

* split HyperCoreLib into two libraries

* rename helper library

* add function for bridging to self on Core

* Update natspec and naming

* fix natspec

* combine libraries into single library with MIT license

* make all function camelCase

* Make tif order types into enum

* check tif against tif.max

* add spotPx function

* add minimumCoreAmountsToAmounts

* clean up decimal conversion functions

* feat: OP Adapter update (#1132)

* feat: OP Adapter update

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Undo the branch logic

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* revert formatting

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added tests

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Fixed test

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* feat: eraVM Spoke Pool 7702 Handling (#1122)

* feat: eraVM Spoke Pool upgrade

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added tests

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* feat: add safe bridge check (#1140)

* Add function for checking if bridge amount is safe

* fix function natspec

* feat: Sponsored Bridging - CCTP (#1135)

* feat: SponsoredCCTPLib

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Updated stuct hash for sig validation

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added src/dst periphery contracts

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* updates const

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Updated event names and params

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Updated receive event

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added hypercore lib

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added safe guards

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added wip swap handler

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added missing calls

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added limit order queue

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* updated simple transfer flow

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added hyper core forwarder

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* init hyper core forwarder swap func

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* progress

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* complete _initiateSwapFlow2

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* Added finalize pending swaps function

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* removed finalTokenHCoreId

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* correct the limit price, size calculation, and send to SwapHandler logic

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* added access control

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* first draft of cancelLimitOrderByCloid + submitNewLimitOrder

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* complete the newMinCoreAmountFromLO calculation

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add a check to submitNewLimitOrder that safeguards new params against old calculated token amounts

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add fixes wrt new HyperCoreLib

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* adjust functionality using new HyperCoreLib fns

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add _executeFlow + multiple random improvements

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* some renamings for consistency

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* try to improve donationBox interactions

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* added bridge balance check before transfer

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* added fallback to send on evm

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Updated dst periphery to use executeflow func

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* unified fallback logic

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* updated account activation logic

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Removed ownable

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Removed maxBpsToSponsor from sig check

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* check for mint recipient in message validation

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* make the bridge safety buffer configurable; use new isCoreAmountSafeToBridge function

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve fallback to hyperevm emitted event and logic

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* added sweep functions

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Added min delay between finalizations

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* added commulative funcs

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* rewrite _initiateSwapFlow to support non-sponsored flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fallback flows and events

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* misc todos

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* misc improvements

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* misc todos and fixes

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* rough draft of correct size calculations

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* new calc functions, hook up to swap flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix math in submitUpdatedLimitOrder

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* correct the amt calc

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add updated comments

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* misc todos

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add _getSuggestedPriceX1e8 and comments

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* comments + misc fixes

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve fallback hyperEVM flow + fix donationBox interactions

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update account activation logic for SwapHandler

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add a comment

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add PX_D to _calcLOAmountsSell

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add maxUserSlippage for CCTP flow; add quote deadline buffer

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* feedback

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Stack too deep, amount less fee & removal of isFinalized

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fix incorrect calculation of non-sponsored token amount

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* internal => extrenal in HyperCoreLib

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fix incorrect bridge safety check

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* change from time-based buffer between fund pulls to block-based buffer

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* Update quote lib

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* use safeErc20 in src

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Co-authored-by: Ihor Farion <ihor@umaproject.org>

* feat: sponsored bridging -- OFT track (#1134)

* commit before too late

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* remove lz deps; reimplement minimal lz options functionality

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* some polish and comments

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* polish

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* move things around

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add event for sponsored sends tracking

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* polish

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add barebones DstOFTHandler

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve  lib quality

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* added OFTComposeMsgCodec

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* progress .. Flow implementaions left

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* rough first draft of transfer-only flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add AccessControl

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* pull account creation funds from donationbox

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* remove HyperCoreLib

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* first ROUGHEST draft of swap flow implementation

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* a more complete implementation

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* copy Forwarder + misc helper contracts into this branch

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* adjust DstOFTHandler to use HyperCoreForwarder-implemented flows, instead of implementing flows from Handler direcly

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update error messageas

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* updates

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* added gas limits and max slippage bps

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* polish

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update HyperCoreForwarder import

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add maxUserSlippageBps to emitted event

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* polish

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix typechain oddness

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update HyperCoreFlowExecutor

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* Deploy script

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* idk. fixing typechain :)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* deploy + test scripts + fix bugs

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update .gitignore and script

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fix: add fixes for issues that codex found (#1142)

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* fix account activation flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* use CREATE2 for deterministic SwapHandler addresses. Check for HyperCore account existence before allowing to set a final token or deploy a HyperCoreFlowExecutor contract

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve events

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* misc

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* feat: add arbitrary actions execution to sponsored bridging (#1143)

* feat: add arbitrary actions execution to sponsored bridging

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* fix the MIN_COMPOSE_MSG_BYTE_LENGTH

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

---------

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Co-authored-by: Ihor Farion <ihor@umaproject.org>

* Update contracts/periphery/mintburn/HyperCoreFlowExecutor.sol

Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>

* Update contracts/periphery/mintburn/HyperCoreFlowExecutor.sol

Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>

* fix typo

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* moved nonce setting before external calls

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Fix: Remvoed token info setting on deploy

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Undo commented out require

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Remove unused constructor args

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* move LayerZero libs to `external/` (#1151)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* feat: add swapsProcessed return values to finalizePendingsSwaps (#1145)

* add swapsProcessed return values to finalizePendingsSwaps

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* return finalized swap amount & number of swaps remaining

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* update var name process to finalize

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

---------

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* fix: arbitrary actions flow (#1149)

* fix

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* a few renames

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* remove dedundant maxBpsToSponsor enforcement

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* save 1 stack depth.

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add _calcFinalExtraFees

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* comment

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* chore: Added NatSpec to CCTP contracts (#1144)

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: Ihor Farion <65650773+grasphoper@users.noreply.github.com>

* add reentrancy guards and follow the CEI pattern where possible (#1148)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* improve: Move BytesLib to external folder (#1153)

* improve: Move BytesLib to external folder

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Undo var scoping

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fix: HyperCoreFlowExecutor stack too deep (#1154)

* fix stack too deep - need to verify equivalance

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* update comment

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* remove confusing comment

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* use CommonFlowParams struct

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* use CommonFlowParams struct in _executeFlow

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* remove confusing comment

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>

* move things around

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* remove remappings.txt

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* chore: Update solidity and OZ versions (#1156)

* chore: Update solidity and OZ versions

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* Upgrade hardhat as well

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* downgrade to 0.8.24

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Taylor Webb <tbwebb22@gmail.com>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: Ihor Farion <ihor@umaproject.org>
Co-authored-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* feat: remove swap calcs form contracts (#1158)

* remove

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* polish

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add _finalizeSwapFlows

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* complete finalization flow

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add a comment

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* add

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* Update events (#1159)

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* WIP

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

---------

Signed-off-by: Matt Rice <matthewcrice32@gmail.com>

* fix cumulativeSponsoredAmount + add event

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* update comment

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* Update contracts/periphery/mintburn/HyperCoreFlowExecutor.sol

Co-authored-by: Matt Rice <matthewcrice32@gmail.com>

---------

Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>

* add Bytes from OZ (#1160)

* fix: Set version to cancun (#1162)

* fix: Set version to cancun

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* remove evmVersion on overrides

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>

* fix: contract sizes (#13)

Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: Taylor Webb <tbwebb22@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: Taylor Webb <84364476+tbwebb22@users.noreply.github.com>
Co-authored-by: Taylor Webb <tbwebb22@gmail.com>

* chore: common branch (#21)

Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: nicholaspai npai.nyc@gmail.com
Signed-off-by: nicholaspai <npai.nyc@gmail.com>
Signed-off-by: Taylor Webb <tbwebb22@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
Co-authored-by: Taylor Webb <84364476+tbwebb22@users.noreply.github.com>
Co-authored-by: Taylor Webb <tbwebb22@gmail.com>

* improve: update verify bytecode script to work with `foundry` deployments  (#82)

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* fix duplicate foundry flag

Signed-off-by: Ihor Farion <ihor@umaproject.org>

* conditional compilation when testing w/ hardhat

Signed-off-by: Ihor Farion <ihor@umaproject.org>

---------

Signed-off-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Signed-off-by: Ihor Farion <ihor@umaproject.org>
Signed-off-by: Matt Rice <matthewcrice32@gmail.com>
Signed-off-by: Taylor Webb <tbwebb22@gmail.com>
Signed-off-by: nicholaspai npai.nyc@gmail.com
Signed-off-by: nicholaspai <npai.nyc@gmail.com>
Co-authored-by: Taylor Webb <84364476+tbwebb22@users.noreply.github.com>
Co-authored-by: Faisal Usmani <faisal.of.usmani@gmail.com>
Co-authored-by: Matt Rice <matthewcrice32@gmail.com>
Co-authored-by: nicholaspai <9457025+nicholaspai@users.noreply.github.com>
Co-authored-by: Taylor Webb <tbwebb22@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants