S Price: $0.411857 (+4.21%)

Contract

0xc93AA3F4135443100E586fF4661d07E26c80CFae

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakeProcessor

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at SonicScan.org on 2025-01-28
*/

/**
 *Submitted for verification at basescan.org on 2025-01-23
*/

/**
 *Submitted for verification at BscScan.com on 2025-01-14
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

// Import necessary interfaces
interface IPacaFinance {
    struct Stake {
        uint256 amount;
        uint256 lastClaimed;
        uint256 dailyRewardRate;
        uint256 unlockTime;
        bool complete;
    }

    function stakes(address user, uint256 index) external view returns (
        uint256 amount,
        uint256 lastClaimed,
        uint256 dailyRewardRate,
        uint256 unlockTime,
        bool complete
    );
}

contract StakeProcessor {
    // Address of the PacaFinanceWithBoostAndSchedule contract
    address public pacaFinanceContract;

    constructor(address _pacaFinanceContract) {
        pacaFinanceContract = _pacaFinanceContract;
    }

    // Struct for the processed stake
    struct ProcessedStake {
        uint256 amount;
        uint256 lastClaimed;
        uint256 dailyRewardRate;
        uint256 unlockTime; // Original unlock time (block timestamp)
        uint256 unlockTimeInSeconds; // Remaining time until unlock in seconds
        bool complete;
    }

    // Function to read and process a specific stake for a user
    function getProcessedStake(address user, uint256 index) external view returns (ProcessedStake memory) {
        // Fetch the stake details from the original contract
        (
            uint256 amount,
            uint256 lastClaimed,
            uint256 dailyRewardRate,
            uint256 unlockTime,
            bool complete
        ) = IPacaFinance(pacaFinanceContract).stakes(user, index);

        // Calculate the remaining time in seconds until unlock
        uint256 currentTime = block.timestamp;
        uint256 unlockTimeInSeconds = unlockTime > currentTime ? unlockTime - currentTime : 0;

        // Create a processed stake struct
        ProcessedStake memory processedStake = ProcessedStake({
            amount: amount,
            lastClaimed: lastClaimed,
            dailyRewardRate: dailyRewardRate,
            unlockTime: unlockTime, // Original block timestamp
            unlockTimeInSeconds: unlockTimeInSeconds, // Time remaining until unlock
            complete: complete
        });

        return processedStake;
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_pacaFinanceContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getProcessedStake","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"lastClaimed","type":"uint256"},{"internalType":"uint256","name":"dailyRewardRate","type":"uint256"},{"internalType":"uint256","name":"unlockTime","type":"uint256"},{"internalType":"uint256","name":"unlockTimeInSeconds","type":"uint256"},{"internalType":"bool","name":"complete","type":"bool"}],"internalType":"struct StakeProcessor.ProcessedStake","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pacaFinanceContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561000f575f80fd5b5060405161062f38038061062f833981810160405281019061003191906100d4565b805f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506100ff565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100a38261007a565b9050919050565b6100b381610099565b81146100bd575f80fd5b50565b5f815190506100ce816100aa565b92915050565b5f602082840312156100e9576100e8610076565b5b5f6100f6848285016100c0565b91505092915050565b6105238061010c5f395ff3fe608060405234801561000f575f80fd5b5060043610610034575f3560e01c80630f121a2f14610038578063ccfce41714610068575b5f80fd5b610052600480360381019061004d9190610281565b610086565b60405161005f9190610361565b60405180910390f35b61007061019b565b60405161007d9190610389565b60405180910390f35b61008e6101be565b5f805f805f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663584b62a189896040518363ffffffff1660e01b81526004016100ee9291906103b1565b60a060405180830381865afa158015610109573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061012d9190610416565b945094509450945094505f4290505f818411610149575f610156565b818461015591906104ba565b5b90505f6040518060c001604052808981526020018881526020018781526020018681526020018381526020018515158152509050809850505050505050505092915050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f151581525090565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61021d826101f4565b9050919050565b61022d81610213565b8114610237575f80fd5b50565b5f8135905061024881610224565b92915050565b5f819050919050565b6102608161024e565b811461026a575f80fd5b50565b5f8135905061027b81610257565b92915050565b5f8060408385031215610297576102966101f0565b5b5f6102a48582860161023a565b92505060206102b58582860161026d565b9150509250929050565b6102c88161024e565b82525050565b5f8115159050919050565b6102e2816102ce565b82525050565b60c082015f8201516102fc5f8501826102bf565b50602082015161030f60208501826102bf565b50604082015161032260408501826102bf565b50606082015161033560608501826102bf565b50608082015161034860808501826102bf565b5060a082015161035b60a08501826102d9565b50505050565b5f60c0820190506103745f8301846102e8565b92915050565b61038381610213565b82525050565b5f60208201905061039c5f83018461037a565b92915050565b6103ab8161024e565b82525050565b5f6040820190506103c45f83018561037a565b6103d160208301846103a2565b9392505050565b5f815190506103e681610257565b92915050565b6103f5816102ce565b81146103ff575f80fd5b50565b5f81519050610410816103ec565b92915050565b5f805f805f60a0868803121561042f5761042e6101f0565b5b5f61043c888289016103d8565b955050602061044d888289016103d8565b945050604061045e888289016103d8565b935050606061046f888289016103d8565b925050608061048088828901610402565b9150509295509295909350565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6104c48261024e565b91506104cf8361024e565b92508282039050818111156104e7576104e661048d565b5b9291505056fea2646970667358221220d74a3490b444064d6247cdc56472bc57eac44a12a6eee22c312c93e6eb2e2dab64736f6c63430008140033000000000000000000000000a26f8128ecb2ff2fc5618498758cc82cf1fdad5f

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610034575f3560e01c80630f121a2f14610038578063ccfce41714610068575b5f80fd5b610052600480360381019061004d9190610281565b610086565b60405161005f9190610361565b60405180910390f35b61007061019b565b60405161007d9190610389565b60405180910390f35b61008e6101be565b5f805f805f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663584b62a189896040518363ffffffff1660e01b81526004016100ee9291906103b1565b60a060405180830381865afa158015610109573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061012d9190610416565b945094509450945094505f4290505f818411610149575f610156565b818461015591906104ba565b5b90505f6040518060c001604052808981526020018881526020018781526020018681526020018381526020018515158152509050809850505050505050505092915050565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060c001604052805f81526020015f81526020015f81526020015f81526020015f81526020015f151581525090565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61021d826101f4565b9050919050565b61022d81610213565b8114610237575f80fd5b50565b5f8135905061024881610224565b92915050565b5f819050919050565b6102608161024e565b811461026a575f80fd5b50565b5f8135905061027b81610257565b92915050565b5f8060408385031215610297576102966101f0565b5b5f6102a48582860161023a565b92505060206102b58582860161026d565b9150509250929050565b6102c88161024e565b82525050565b5f8115159050919050565b6102e2816102ce565b82525050565b60c082015f8201516102fc5f8501826102bf565b50602082015161030f60208501826102bf565b50604082015161032260408501826102bf565b50606082015161033560608501826102bf565b50608082015161034860808501826102bf565b5060a082015161035b60a08501826102d9565b50505050565b5f60c0820190506103745f8301846102e8565b92915050565b61038381610213565b82525050565b5f60208201905061039c5f83018461037a565b92915050565b6103ab8161024e565b82525050565b5f6040820190506103c45f83018561037a565b6103d160208301846103a2565b9392505050565b5f815190506103e681610257565b92915050565b6103f5816102ce565b81146103ff575f80fd5b50565b5f81519050610410816103ec565b92915050565b5f805f805f60a0868803121561042f5761042e6101f0565b5b5f61043c888289016103d8565b955050602061044d888289016103d8565b945050604061045e888289016103d8565b935050606061046f888289016103d8565b925050608061048088828901610402565b9150509295509295909350565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6104c48261024e565b91506104cf8361024e565b92508282039050818111156104e7576104e661048d565b5b9291505056fea2646970667358221220d74a3490b444064d6247cdc56472bc57eac44a12a6eee22c312c93e6eb2e2dab64736f6c63430008140033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a26f8128ecb2ff2fc5618498758cc82cf1fdad5f

-----Decoded View---------------
Arg [0] : _pacaFinanceContract (address): 0xa26F8128Ecb2FF2FC5618498758cC82Cf1FDad5F

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000a26f8128ecb2ff2fc5618498758cc82cf1fdad5f


Deployed Bytecode Sourcemap

659:1738:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1314:1080;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;754:34;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1314:1080;1393:21;;:::i;:::-;1505:14;1534:19;1568:23;1606:18;1639:13;1679:19;;;;;;;;;;;1666:40;;;1707:4;1713:5;1666:53;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1490:229;;;;;;;;;;1797:19;1819:15;1797:37;;1845:27;1888:11;1875:10;:24;:55;;1929:1;1875:55;;;1915:11;1902:10;:24;;;;:::i;:::-;1875:55;1845:85;;1987:36;2026:326;;;;;;;;2064:6;2026:326;;;;2098:11;2026:326;;;;2141:15;2026:326;;;;2183:10;2026:326;;;;2257:19;2026:326;;;;2332:8;2026:326;;;;;1987:365;;2372:14;2365:21;;;;;;;;;;1314:1080;;;;:::o;754:34::-;;;;;;;;;;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;88:117:1:-;197:1;194;187:12;334:126;371:7;411:42;404:5;400:54;389:65;;334:126;;;:::o;466:96::-;503:7;532:24;550:5;532:24;:::i;:::-;521:35;;466:96;;;:::o;568:122::-;641:24;659:5;641:24;:::i;:::-;634:5;631:35;621:63;;680:1;677;670:12;621:63;568:122;:::o;696:139::-;742:5;780:6;767:20;758:29;;796:33;823:5;796:33;:::i;:::-;696:139;;;;:::o;841:77::-;878:7;907:5;896:16;;841:77;;;:::o;924:122::-;997:24;1015:5;997:24;:::i;:::-;990:5;987:35;977:63;;1036:1;1033;1026:12;977:63;924:122;:::o;1052:139::-;1098:5;1136:6;1123:20;1114:29;;1152:33;1179:5;1152:33;:::i;:::-;1052:139;;;;:::o;1197:474::-;1265:6;1273;1322:2;1310:9;1301:7;1297:23;1293:32;1290:119;;;1328:79;;:::i;:::-;1290:119;1448:1;1473:53;1518:7;1509:6;1498:9;1494:22;1473:53;:::i;:::-;1463:63;;1419:117;1575:2;1601:53;1646:7;1637:6;1626:9;1622:22;1601:53;:::i;:::-;1591:63;;1546:118;1197:474;;;;;:::o;1677:108::-;1754:24;1772:5;1754:24;:::i;:::-;1749:3;1742:37;1677:108;;:::o;1791:90::-;1825:7;1868:5;1861:13;1854:21;1843:32;;1791:90;;;:::o;1887:99::-;1958:21;1973:5;1958:21;:::i;:::-;1953:3;1946:34;1887:99;;:::o;2076:1252::-;2233:4;2228:3;2224:14;2322:4;2315:5;2311:16;2305:23;2341:63;2398:4;2393:3;2389:14;2375:12;2341:63;:::i;:::-;2248:166;2503:4;2496:5;2492:16;2486:23;2522:63;2579:4;2574:3;2570:14;2556:12;2522:63;:::i;:::-;2424:171;2688:4;2681:5;2677:16;2671:23;2707:63;2764:4;2759:3;2755:14;2741:12;2707:63;:::i;:::-;2605:175;2868:4;2861:5;2857:16;2851:23;2887:63;2944:4;2939:3;2935:14;2921:12;2887:63;:::i;:::-;2790:170;3057:4;3050:5;3046:16;3040:23;3076:63;3133:4;3128:3;3124:14;3110:12;3076:63;:::i;:::-;2970:179;3235:4;3228:5;3224:16;3218:23;3254:57;3305:4;3300:3;3296:14;3282:12;3254:57;:::i;:::-;3159:162;2202:1126;2076:1252;;:::o;3334:343::-;3487:4;3525:3;3514:9;3510:19;3502:27;;3539:131;3667:1;3656:9;3652:17;3643:6;3539:131;:::i;:::-;3334:343;;;;:::o;3683:118::-;3770:24;3788:5;3770:24;:::i;:::-;3765:3;3758:37;3683:118;;:::o;3807:222::-;3900:4;3938:2;3927:9;3923:18;3915:26;;3951:71;4019:1;4008:9;4004:17;3995:6;3951:71;:::i;:::-;3807:222;;;;:::o;4035:118::-;4122:24;4140:5;4122:24;:::i;:::-;4117:3;4110:37;4035:118;;:::o;4159:332::-;4280:4;4318:2;4307:9;4303:18;4295:26;;4331:71;4399:1;4388:9;4384:17;4375:6;4331:71;:::i;:::-;4412:72;4480:2;4469:9;4465:18;4456:6;4412:72;:::i;:::-;4159:332;;;;;:::o;4497:143::-;4554:5;4585:6;4579:13;4570:22;;4601:33;4628:5;4601:33;:::i;:::-;4497:143;;;;:::o;4646:116::-;4716:21;4731:5;4716:21;:::i;:::-;4709:5;4706:32;4696:60;;4752:1;4749;4742:12;4696:60;4646:116;:::o;4768:137::-;4822:5;4853:6;4847:13;4838:22;;4869:30;4893:5;4869:30;:::i;:::-;4768:137;;;;:::o;4911:971::-;5014:6;5022;5030;5038;5046;5095:3;5083:9;5074:7;5070:23;5066:33;5063:120;;;5102:79;;:::i;:::-;5063:120;5222:1;5247:64;5303:7;5294:6;5283:9;5279:22;5247:64;:::i;:::-;5237:74;;5193:128;5360:2;5386:64;5442:7;5433:6;5422:9;5418:22;5386:64;:::i;:::-;5376:74;;5331:129;5499:2;5525:64;5581:7;5572:6;5561:9;5557:22;5525:64;:::i;:::-;5515:74;;5470:129;5638:2;5664:64;5720:7;5711:6;5700:9;5696:22;5664:64;:::i;:::-;5654:74;;5609:129;5777:3;5804:61;5857:7;5848:6;5837:9;5833:22;5804:61;:::i;:::-;5794:71;;5748:127;4911:971;;;;;;;;:::o;5888:180::-;5936:77;5933:1;5926:88;6033:4;6030:1;6023:15;6057:4;6054:1;6047:15;6074:194;6114:4;6134:20;6152:1;6134:20;:::i;:::-;6129:25;;6168:20;6186:1;6168:20;:::i;:::-;6163:25;;6212:1;6209;6205:9;6197:17;;6236:1;6230:4;6227:11;6224:37;;;6241:18;;:::i;:::-;6224:37;6074:194;;;;:::o

Swarm Source

ipfs://d74a3490b444064d6247cdc56472bc57eac44a12a6eee22c312c93e6eb2e2dab

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.