-
Notifications
You must be signed in to change notification settings - Fork 0
Nialexsan/wbtc weth #108
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
Open
nialexsan
wants to merge
23
commits into
main
Choose a base branch
from
nialexsan/wbtc-weth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Nialexsan/wbtc weth #108
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
a978f9b
strategy
nialexsan 5bb42a8
switch strategy
nialexsan ccebb8a
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan cbea629
setup scripts
nialexsan bd95ca8
fix typo
nialexsan 961f187
fix typo
nialexsan 12b4805
fix contract
nialexsan d2ece22
Update cadence/contracts/FlowYieldVaultsStrategies.cdc
nialexsan 1745eb1
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 818450f
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 836530c
add config
nialexsan 440221c
fix typo
nialexsan 6a3c102
fix config
nialexsan 3291272
Merge branch 'main' into nialexsan/wbtc-weth
nialexsan 0dc3ae9
Update flow.json
nialexsan d9ee846
add mainnet setup
nialexsan 7d6c2bb
temporarily delete strategy
nialexsan 2d4e129
fix schedule time
nialexsan 976fee8
Revert "temporarily delete strategy"
nialexsan d201f91
update env vars
nialexsan 244209a
add missing files
nialexsan c9691a2
tweak nil checks
nialexsan b9ba3be
bump
nialexsan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
cadence/transactions/flow-yield-vaults/admin/upsert_musdf_config.cdc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| import "FungibleToken" | ||
| import "EVM" | ||
| import "FlowYieldVaultsStrategiesV1_1" | ||
|
|
||
| /// Admin tx to (re)configure Uniswap paths for the mUSDFStrategy | ||
| /// | ||
| /// NOTE: | ||
| /// - Must be signed by the account that deployed FlowYieldVaultsStrategies | ||
| /// - You can omit some collaterals by passing empty arrays and guarding in prepare{} | ||
| transaction( | ||
| tokenTypeIdentifier: String, | ||
| yieldTokenEVMAddress: String, | ||
|
|
||
| // collateral path/fees: [YIELD, ..., <COLLATERAL>] | ||
| swapPath: [String], | ||
| fees: [UInt32] | ||
| ) { | ||
|
|
||
| prepare(acct: auth(Storage, Capabilities, BorrowValue) &Account) { | ||
| let tokenType = CompositeType(tokenTypeIdentifier) | ||
| ?? panic("Invalid tokenTypeIdentifier \(tokenTypeIdentifier)") | ||
| // This tx must run on the same account that stores the issuer | ||
| // otherwise this borrow will fail. | ||
| let issuer = acct.storage.borrow< | ||
| auth(FlowYieldVaultsStrategiesV1_1.Configure) &FlowYieldVaultsStrategiesV1_1.StrategyComposerIssuer | ||
| >(from: FlowYieldVaultsStrategiesV1_1.IssuerStoragePath) | ||
| ?? panic("Missing StrategyComposerIssuer at IssuerStoragePath") | ||
|
|
||
| let yieldEVM = EVM.addressFromString(yieldTokenEVMAddress) | ||
|
|
||
| // helper to map [String] -> [EVM.EVMAddress] | ||
| fun toEVM(_ hexes: [String]): [EVM.EVMAddress] { | ||
| let out: [EVM.EVMAddress] = [] | ||
| for h in hexes { | ||
| out.append(EVM.addressFromString(h)) | ||
| } | ||
| return out | ||
| } | ||
|
|
||
| let composerType = Type<@FlowYieldVaultsStrategiesV1_1.mUSDFStrategyComposer>() | ||
| let strategyType = Type<@FlowYieldVaultsStrategiesV1_1.mUSDFStrategy>() | ||
|
|
||
| //issuer.purgeConfig() | ||
|
|
||
| // === FLOW collateral === | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?? only flow? |
||
| if swapPath.length > 0 { | ||
| issuer.addOrUpdateCollateralConfig( | ||
| composer: composerType, | ||
| strategyType: strategyType, | ||
| collateralVaultType: tokenType, | ||
| yieldTokenEVMAddress: yieldEVM, | ||
| yieldToCollateralAddressPath: toEVM(swapPath), | ||
| yieldToCollateralFeePath: fees | ||
| ) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not, if not needed, let's removed, if leaving, mentioned why with additional comments