Skip to content

Commit c0041f0

Browse files
committed
merge: pull latest main into moet-redemption
2 parents 8c250f1 + 95fe23c commit c0041f0

9 files changed

Lines changed: 339 additions & 21 deletions

File tree

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@
1616
[submodule "lib/FlowALP"]
1717
path = lib/FlowALP
1818
url = git@github.com:onflow/FlowALP.git
19+
[submodule "solidity/lib/v2-core"]
20+
path = solidity/lib/v2-core
21+
url = https://github.com/uniswap/v2-core
22+
[submodule "solidity/lib/v2-periphery"]
23+
path = solidity/lib/v2-periphery
24+
url = https://github.com/uniswap/v2-periphery

cadence/tests/test_helpers.cdc

Lines changed: 200 additions & 16 deletions
Large diffs are not rendered by default.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import "EVM"
2+
3+
/// Runs a raw, signed EVM transaction (RLP bytes) inside Flow EVM.
4+
transaction(rawHex: String, coinbaseHex: String) {
5+
prepare(_: auth(BorrowValue) &Account) {
6+
// 1) Decode raw tx
7+
let rawTx: [UInt8] = rawHex.decodeHex()
8+
9+
// 2) Parse coinbase (fee receiver) as EVM address
10+
// Use the EVM address of a CadenceOwnedAccount you control,
11+
// or "000...0000" to send fees to the zero address (not recommended).
12+
let coinbase: EVM.EVMAddress = EVM.addressFromString(coinbaseHex)
13+
14+
// 3) Execute (fails early if status is unknown/invalid)
15+
let res: EVM.Result = EVM.mustRun(tx: rawTx, coinbase: coinbase)
16+
17+
log("⛽ gasUsed: ".concat(res.gasUsed.toString()))
18+
log("📦 status: ".concat(res.status.rawValue.toString())) // 0=unknown,1=invalid,2=failed,3=successful
19+
log("❗ errorCode: ".concat(res.errorCode.toString()))
20+
if res.errorMessage.length > 0 {
21+
log("📝 errorMessage: ".concat(res.errorMessage))
22+
}
23+
24+
// Returned data (e.g. contract code on deploy, or revert data)
25+
if res.data.length > 0 {
26+
log("🔙 returnedData (hex): ".concat(String.encodeHex(res.data)))
27+
}
28+
29+
// If this tx deployed a contract, show its address
30+
if let deployed = res.deployedContract {
31+
log("🏠 deployed at: ".concat(deployed.toString()))
32+
}
33+
}
34+
}

flow.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,30 @@
764764
"resourceID": "projects/dl-flow-devex-staging/locations/us-central1/keyRings/tidal-keyring/cryptoKeys/tidal_admin_pk/cryptoKeyVersions/1"
765765
}
766766
},
767+
"mainnet-admin": {
768+
"address": "b1d63873c3cc9f79",
769+
"key": {
770+
"type": "google-kms",
771+
"hashAlgorithm": "SHA2_256",
772+
"resourceID": "projects/dl-flow-devex-production/locations/us-central1/keyRings/tidal-keyring/cryptoKeys/tidal_admin_pk/cryptoKeyVersions/1"
773+
}
774+
},
775+
"mainnet-flow-alp-deployer": {
776+
"address": "6b00ff876c299c61",
777+
"key": {
778+
"type": "google-kms",
779+
"hashAlgorithm": "SHA2_256",
780+
"resourceID": "projects/dl-flow-devex-production/locations/us-central1/keyRings/tidal-keyring/cryptoKeys/tidal_admin_pk/cryptoKeyVersions/1"
781+
}
782+
},
783+
"mainnet-uniswapV3-connectors-deployer": {
784+
"address": "a7825d405ac89518",
785+
"key": {
786+
"type": "google-kms",
787+
"hashAlgorithm": "SHA2_256",
788+
"resourceID": "projects/dl-flow-devex-production/locations/us-central1/keyRings/tidal-keyring/cryptoKeys/tidal_admin_pk/cryptoKeyVersions/1"
789+
}
790+
},
767791
"tidal": {
768792
"address": "045a1763c93006ca",
769793
"key": {
@@ -1016,6 +1040,48 @@
10161040
"EVMAbiHelpers",
10171041
"UniswapV3SwapConnectors"
10181042
]
1019-
}
1043+
},
1044+
"mainnet": {
1045+
"mainnet-admin": [
1046+
{
1047+
"name": "MockOracle",
1048+
"args": [
1049+
{
1050+
"value": "A.6b00ff876c299c61.MOET.Vault",
1051+
"type": "String"
1052+
}
1053+
]
1054+
},
1055+
"MockSwapper",
1056+
"FlowVaultsAutoBalancers",
1057+
"FlowVaultsClosedBeta",
1058+
"FlowVaults",
1059+
{
1060+
"name": "FlowVaultsStrategies",
1061+
"args": [
1062+
{
1063+
"value": "0xca6d7Bb03334bBf135902e1d919a5feccb461632",
1064+
"type": "String"
1065+
},
1066+
{
1067+
"value": "0xeEDC6Ff75e1b10B903D9013c358e446a73d35341",
1068+
"type": "String"
1069+
},
1070+
{
1071+
"value": "0x370A8DF17742867a44e56223EC20D82092242C85",
1072+
"type": "String"
1073+
},
1074+
{
1075+
"value": "0xYIELDTOKEN_ERC4626",
1076+
"type": "String"
1077+
}
1078+
]
1079+
}
1080+
],
1081+
"mainnet-uniswapV3-connectors-deployer": [
1082+
"EVMAbiHelpers",
1083+
"UniswapV3SwapConnectors"
1084+
]
1085+
}
10201086
}
10211087
}

local/punchswap/punchswap.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ TOKENS_OWNER=0xC31A5268a1d311d992D637E8cE925bfdcCEB4310
3030
USDC_MINT=2000000000000
3131
WBTC_MINT=100000000000000
3232

33-
USDC_ADDR=0xaCCF0c4EeD4438Ad31Cd340548f4211a465B6528
34-
WBTC_ADDR=0x374BF2423c6b67694c068C3519b3eD14d3B0C5d1
33+
USDC_ADDR=0x102A7ed67858cF757CBBeA3390eaB72fcc60237E
34+
WBTC_ADDR=0x6Ce75363856e46B42bf0c933E01A4Eec17eE963B
3535

3636
# how much to fund the helper (base units)
3737
# USDC_FUND=600000000 # 600k * 1e6

local/setup_bridged_tokens.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
source ./local/punchswap/punchswap.env
22

33
echo "bridge USDC to Cadence"
4-
flow transactions send ./lib/flow-evm-bridge/cadence/transactions/bridge/onboarding/onboard_by_evm_address.cdc 0xaCCF0c4EeD4438Ad31Cd340548f4211a465B6528 --gas-limit 9999 --signer tidal
4+
flow transactions send ./lib/flow-evm-bridge/cadence/transactions/bridge/onboarding/onboard_by_evm_address.cdc $USDC_ADDR --gas-limit 9999 --signer tidal
55

66
echo "set USDC token price"
77
flow transactions send ./cadence/transactions/mocks/oracle/set_price.cdc 'A.f8d6e0586b0a20c7.EVMVMBridgedToken_accf0c4eed4438ad31cd340548f4211a465b6528.Vault' 1.0 --signer tidal
88

99
echo "bridge WBTC to Cadence"
10-
flow transactions send ./lib/flow-evm-bridge/cadence/transactions/bridge/onboarding/onboard_by_evm_address.cdc 0x374BF2423c6b67694c068C3519b3eD14d3B0C5d1 --gas-limit 9999 --signer tidal
10+
flow transactions send ./lib/flow-evm-bridge/cadence/transactions/bridge/onboarding/onboard_by_evm_address.cdc $WBTC_ADDR --gas-limit 9999 --signer tidal
1111

1212
# this step is done earlier
1313
# echo "bridge MOET to EVM"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// copy to ./punch-swap-v3-contracts/src/periphery/
2+
3+
// SPDX-License-Identifier: GPL-2.0-or-later
4+
pragma solidity =0.7.6;
5+
pragma abicoder v2;
6+
7+
import '../core/interfaces/IPunchSwapV3Pool.sol';
8+
import '@uniswap/lib/contracts/libraries/SafeERC20Namer.sol';
9+
10+
import './libraries/ChainId.sol';
11+
import './interfaces/INonfungiblePositionManager.sol';
12+
import './interfaces/INonfungibleTokenPositionDescriptor.sol';
13+
import './interfaces/IERC20Metadata.sol';
14+
import './libraries/PoolAddress.sol';
15+
import './libraries/NFTDescriptor.sol';
16+
import './libraries/TokenRatioSortOrder.sol';
17+
import './NonfungibleTokenPositionDescriptorBase.sol';
18+
19+
/// @title Describes NFT token positions
20+
/// @notice Produces a string containing the data URI for a JSON metadata string
21+
contract EmulatorNonfungibleTokenPositionDescriptor is NonfungibleTokenPositionDescriptorBase {
22+
constructor(address WFLOW_ADDRESS, bytes32 _nativeCurrencyLabelBytes) NonfungibleTokenPositionDescriptorBase(WFLOW_ADDRESS, _nativeCurrencyLabelBytes) {}
23+
24+
function _initializePriorities() override internal {
25+
}
26+
}

solidity/lib/v2-core

Submodule v2-core added at ee547b1

solidity/lib/v2-periphery

Submodule v2-periphery added at 0335e8f

0 commit comments

Comments
 (0)