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

[WIP] feat/chainlink staking adapter tsl #6

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

freeslugs
Copy link
Contributor

Configure stake.link libraries logic inside of liquifier contracts.

@drewstone
Copy link
Contributor

What's remaining here @freeslugs ?

@freeslugs
Copy link
Contributor Author

I am currently debugging an issue with the chainlink staking contract incorrectly being set to null address instead of 0x3feB1e09b4bb0E7f0387CeE092a52e85797ab889. This is causing the deposit to fail. Once I fix this I'll push some updated code.

I have been testing using my scripts against tenderly testnet deployment. snapshot_and_revert.sh, chainlink_mainnet.sh , and stake_link.sh

The relevent line is: 0x0000000000000000000000000000000000000000::getStake(0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0) [staticcall]

Traces:
  [686620] → new XYZ_Stake@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
    └─ ← [Return] 3319 bytes of code

  [130333] XYZ_Stake::run()
    ├─ [0] VM::envUint("PRIVATE_KEY") [staticcall]
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::startBroadcast(<pk>)
    │   └─ ← [Return]
    ├─ [0] VM::envAddress("TOKEN") [staticcall]
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::envAddress("LIQUIFIER") [staticcall]
    │   └─ ← [Return] <env var value>
    ├─ [0] VM::addr(<pk>) [staticcall]
    │   └─ ← [Return] 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
    ├─ [2655] 0x514910771AF9Ca656af840dff83E8264EcF986CA::balanceOf(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266) [staticcall]
    │   └─ ← [Return] 1000000000000000000000 [1e21]
    ├─ [0] console::log("Initial LPT Token balance", 1000000000000000000000 [1e21]) [staticcall]
    │   └─ ← [Stop]
    ├─ [7721] 0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0::balanceOf(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266) [staticcall]
    │   ├─ [5023] 0x6997285deF9363D37C5eBBC04542078B21f7cE6a::balanceOf(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266) [delegatecall]
    │   │   └─ ← [Return] 0
    │   └─ ← [Return] 0
    ├─ [0] console::log("Initial tgLPT Token balance", 0) [staticcall]
    │   └─ ← [Stop]
    ├─ [24115] 0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0::symbol() [staticcall]
    │   ├─ [23908] 0x6997285deF9363D37C5eBBC04542078B21f7cE6a::symbol() [delegatecall]
    │   │   ├─ [744] 0x514910771AF9Ca656af840dff83E8264EcF986CA::symbol() [staticcall]
    │   │   │   └─ ← [Return] "LINK"
    │   │   └─ ← [Return] "tgLINK-0xe1ab8145f7e55dc933d51a18c793f901a3a0b276"
    │   └─ ← [Return] "tgLINK-0xe1ab8145f7e55dc933d51a18c793f901a3a0b276"
    ├─ [0] console::log("Liquifier Symbol", "tgLINK-0xe1ab8145f7e55dc933d51a18c793f901a3a0b276") [staticcall]
    │   └─ ← [Stop]
    ├─ [24094] 0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0::name() [staticcall]
    │   ├─ [23887] 0x6997285deF9363D37C5eBBC04542078B21f7cE6a::name() [delegatecall]
    │   │   ├─ [744] 0x514910771AF9Ca656af840dff83E8264EcF986CA::symbol() [staticcall]
    │   │   │   └─ ← [Return] "LINK"
    │   │   └─ ← [Return] "liquid LINK-0xe1ab8145f7e55dc933d51a18c793f901a3a0b276"
    │   └─ ← [Return] "liquid LINK-0xe1ab8145f7e55dc933d51a18c793f901a3a0b276"
    ├─ [0] console::log("Liquifier Name", "liquid LINK-0xe1ab8145f7e55dc933d51a18c793f901a3a0b276") [staticcall]
    │   └─ ← [Stop]
    ├─ [0] console::log("Liquifier Rebase Output") [staticcall]
    │   └─ ← [Stop]
    ├─ [52410] 0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0::rebase()
    │   ├─ [52210] 0x6997285deF9363D37C5eBBC04542078B21f7cE6a::rebase() [delegatecall]
    │   │   ├─ [7707] 0x1C5ffc48077AbdFC8EbbE605Ab011Eb3b218B054::adapter(0x514910771AF9Ca656af840dff83E8264EcF986CA) [staticcall]
    │   │   │   ├─ [2809] 0x0A65d94635EE2F1573258980b40B3Fe48aC762bC::adapter(0x514910771AF9Ca656af840dff83E8264EcF986CA) [delegatecall]
    │   │   │   │   └─ ← [Return] 0x16a7B0014B9a7c5b7DB6E68C7EA389dA1bE42858
    │   │   │   └─ ← [Return] 0x16a7B0014B9a7c5b7DB6E68C7EA389dA1bE42858
    │   │   ├─ [1207] 0x1C5ffc48077AbdFC8EbbE605Ab011Eb3b218B054::adapter(0x514910771AF9Ca656af840dff83E8264EcF986CA) [staticcall]
    │   │   │   ├─ [809] 0x0A65d94635EE2F1573258980b40B3Fe48aC762bC::adapter(0x514910771AF9Ca656af840dff83E8264EcF986CA) [delegatecall]
    │   │   │   │   └─ ← [Return] 0x16a7B0014B9a7c5b7DB6E68C7EA389dA1bE42858
    │   │   │   └─ ← [Return] 0x16a7B0014B9a7c5b7DB6E68C7EA389dA1bE42858
    │   │   ├─ [33309] 0x16a7B0014B9a7c5b7DB6E68C7EA389dA1bE42858::rebase(0xe1AB8145F7E55DC933d51a18c793F901A3A0b276, 0) [delegatecall]
    │   │   │   ├─ [0] console::log("Calling rebase on chainlink adapter") [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log("Validator") [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log(0xe1AB8145F7E55DC933d51a18c793F901A3A0b276) [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log("Current stake") [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log(0) [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log("Loading storage for rebase operation.") [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log("Updating last rebase timestamp.") [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log("I should be able to get the stake.") [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] console::log(0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0) [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   ├─ [0] 0x0000000000000000000000000000000000000000::getStake(0x2871DafDB3b0047D06bBdb42f865DeD2514Dd9b0) [staticcall]
    │   │   │   │   └─ ← [Stop]
    │   │   │   └─ ← [Revert] EvmError: Revert
    │   │   └─ ← [Revert] AdapterDelegateCallFailed("")
    │   └─ ← [Revert] AdapterDelegateCallFailed("")
    └─ ← [Revert] AdapterDelegateCallFailed("")

@freeslugs freeslugs changed the title WIP DO NOT MERGE Freeslugs/feat/chainlink staking adapter tsl [WIP] Freeslugs/feat/chainlink staking adapter tsl Aug 27, 2024
@freeslugs freeslugs changed the title [WIP] Freeslugs/feat/chainlink staking adapter tsl [WIP] feat/chainlink staking adapter tsl Aug 27, 2024
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.

2 participants