How to read the proxy_target of a proxy contract in a specific block height for example 23000000?

Hello, I have a question related to how to read proxy_target of a proxy contract in a specific block height for example 23000000

Supposed that I have a proxy contract at address 0xe2815fb200736f50838bf1579cbdb1b591c39985b75442c8f91963760dc445b9 (this is an example address).

This is a proxy contract of Src14OwnedProxy type. I can read the proxy_target to know the current implementation address of this contract.

The below typescript will help me to know the current proxy_target at latest block. But I want to know the proxy_target address at the specific block height, for example 23000000 that is 2 days ago. How to query that data?

I just want to know how to get that data. It can be done by typescript, Rust SDK or GraphQL still be ok. please help.

I am interested to know for Mainet.

beforeEach(async () => {
        const provider = await Provider.create("https://mainnet.fuel.network/v1/graphql")

        let privateKey = process.env.FUEL_PRIVATE_KEY       

        const wallet_0 = Wallet.fromPrivateKey(privateKey, provider)
              
        const Proxy_ID = "0xe2815fb200736f50838bf1579cbdb1b591c39985b75442c8f91963760dc445b9"

        const proxyContract = new Src14OwnedProxy(Proxy_ID, wallet_0)             

        let tx = await proxyContract.functions.proxy_target().simulate()
        console.log("proxy_target: ", tx) 
        

    })

Thank you for your help.

1 Like

Hey @perseverance, team has already implemented it. It will be available in the fuel-core v0.42, and the next step up SDKs to support this feature. though, you can try this feature by using the fuel-core from master, sync with state rewind enabled, and dry run any transaction in the past, using custom SDK

Thank you @naz3eh . It is nice feature to dryRun with past block. It is what I was looking for.

I was trying to try this feature with the Master branch.

But today I got a weird error:

The error blocked me to try the feature. Please help also. Thank you very much.

1 Like

Hi @naz3eh when the version fuel-core v0.42 will be available ?

Also I saw that there is the nightly version. I saw that it is still v0.41.6. Does the nightly include the merged pull-request?

1 Like

Thank you very much. I was able to resolve the problem. Now I can try this feature.

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.