BNB Chain

0x06f424f8bca18421db31ed9a1eec2c88f8be7180

Decompiled Solidity recovered from this contract's runtime bytecode. Best-effort reconstruction — confirm behaviour against on-chain state.

Decompilation outputBNB Chain · 0x06f424f8…f8be718022.7 KB6.6 s
Share
883 lines · Click a variable or keyword to highlight its references · Click a line number to copy its link; Shift-click to copy a block link
//decompiled by exvvul decompiler tool contact@exvul.com https://x.com/exvulsec// SPDX-License-Identifier: MIT  >=0.8.0;  {        = 800000000000000000;        = 1000000000;        = 1000000000;        = 0;        = 0;        = 1000000000000000000;        = 1;        = 4100;         ; // STORAGE[0x0]     ; // STORAGE[0x1]      ; // STORAGE[0x2] bytes 0 to 19      ; // STORAGE[0x3] bytes 0 to 19      ; // STORAGE[0x4] bytes 0 to 19      ; // STORAGE[0x5] bytes 0 to 19      ; // STORAGE[0x6] bytes 0 to 19      ; // STORAGE[0x7] bytes 0 to 19      ; // STORAGE[0x8] bytes 0 to 19      ; // STORAGE[0x9] bytes 0 to 19      ; // STORAGE[0x9] bytes 20 to 20      ; // STORAGE[0xa]      ; // STORAGE[0xb]    ( => )  ; // STORAGE[0xd]      ; // STORAGE[0xe]      ; // STORAGE[0xf]      ; // STORAGE[0x10]      ; // STORAGE[0x11]      ; // STORAGE[0x12]      ; // STORAGE[0x13]      ; // STORAGE[0x14]     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;     ;         ( , , );     (, );     ( , , , );     ( , , );     ();     ( );     (, );     ( );     (, , );     ();    ()   {         (., .);    }             ()  {        (. == , "acceptAdmin: Call must come from pendingAdmin.");         = .;         = (0);         ();    }         ( )    ( ) {         .(( / 0x01), , );    }         ()    () {         ;         (!((. % 0x015180) > 0x0258)) {              = 0x01;             = 0;             = ;        }  {              = 0x01;             ((. % 0x015180) > 0x014cd0) {                 = 0;            }             = ;        }         ();    }         ( )   () {        ();         ;    }         ( )  {        (. == , "only admin is allowed");         = ;    }         ()  {        (. == , "only admin is allowed");        (, "Pausable: not paused");         = ;         (.);    }         ( )  {        (. == , "setPendingAdmin: Call must come from admin.");         = ;         ();    }         ( ,  ,  )   () {        (!( == 0x02), "ReentrancyGuard: reentrant call");         = 0x02;        (!, "Pausable: paused");        (0 != 0x0, "");        ( > 0x0, "accelerate steps must be greater than zero");        ( <= , "SafeMath: subtraction overflow");        (( -  >=  &&  < ), "unstakeIndex is out of valid accelerate range");         ;         = 0x60 + ;         = 0x60 + ;        (() == (.), "only staker can accelerate itself");        (0x15180 > 0x0, "SafeMath: modulo by zero");        (!(( % 0x015180) > ), "SafeMath: subtraction overflow");          =  * ;         (!( == 0)) {            (( * ) /  == , "SafeMath: multiplication overflow");        }  {             = 0;        }          =  * ;         ( != 0x0) {            ((( * ) / ) == , "SafeMath: multiplication overflow");        }  {             = 0;        }        (0x1 <= , "SafeMath: subtraction overflow");          =  - 0x01;          = ;         () {            ( <= , "SafeMath: subtraction overflow");             ( - 0x1 <  - ) {                (0x3b9aca00 > 0x0, "SafeMath: division by zero");                ( <= , "SafeMath: subtraction overflow");                  = 0;                 ;                 () {                     = (() * 0x01) | (0xffffffffffffffffffffffff0000000000000000000000000000000000000000 & );                     = ;                     = ;                     = 0;                     ( >= [.]) {                        ;                    }                     ( >= [.]) {                        ;                    }                     ( == ) {                        ( <= , "SafeMath: subtraction overflow");                         ( < [.]) {                             =  - ;                        }                        ;                    }                     = 0x01 + ;                     = 0x01;                }                ( != 0x0, "failed to find matched unstake sequence");                ( / 0x3b9aca00 <= , "cost too much SBF");                 = 0x20 + (0x20 + (0x20 + (0x24 + )));                 = 0x40 + ;                (!((). < 0), "Address: insufficient balance for call");                (.. > 0x0, "Address: call to non-contract");                  = 0x20 + ;                  = ;                  = ;                 () {                      = ;                      = ;                      = ;                     ( < 0x20) {                        ;                    }                     ( - 0x20 < 0x20) {                        ;                    }                     = ( + 0x20) + 0x20;                     = ( + 0x20) + 0x20;                     = ( - 0x20) - 0x20;                     =  + 0x20;                     =  + 0x20;                     =  - 0x20;                }                ( ,   ) = ().{ : 0 }(, , ); // call                  = 0x60;                 (. != 0) {                     =  + ((. + 0x3f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));                     = ;                }                 (!) {                    (!( > 0));                      = 0;                     () {                          = ;                         (!( < )) {                            ;                        }                         (!(( + 0x20) < )) {                            ;                        }                         = ( + 0x20) + 0x20;                         =  + 0x20;                    }                     (0x1f & ) {                    }                    ("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00");                }                 ( > 0) {                    (!( < 0x20));                    ( != 0x0, "SafeERC20: ERC20 operation did not succeed");                }                (.. != 0x0);                ( ,   ) = .( / 0x3b9aca00); // call                ();                (!(. < 0x20));                 (., );                 = 0x01;                ;            }             = 0x60 + ;            (!( < ( - ( % 0x015180))), "forbid to exceed unstake in prior day");             = (() * 0x01) | (0xffffffffffffffffffffffff0000000000000000000000000000000000000000 & );             = ;             = ;              =  * ;             (!( == 0)) {                (( * ) /  == , "SafeMath: multiplication overflow");            }  {                 = 0;            }            ( +  >= , "SafeMath: addition overflow");              = 0;             ;             () {                 = 0;                 ( >= [()]) {                    ;                }                 ( >= [()]) {                    ;                }                 ( == ( - 0x01)) {                     ( < [()]) {                         = ( - 0x01) + 0x01;                    }                    ;                }                 = 0x01 + ;                 = 0x01;            }            ( != 0x0, "failed to find matched unstake sequence");             = ( - 0x01) - 0x01;             =  + ;             ;        }    }         ( ,  )  {        (. == , "only admin is allowed");        ( > 0x0, "stakeFeeDenominator must be positive");         ( > 0) {            ( > 0x0, "SafeMath: division by zero");            ( /  > 0xc8, "stake fee rate must be less than 0.5%");        }         = ;         = ;    }         ( ,  )    ( ) {        (, );         .(0, );    }         ( )    () {        ();         ;    }         ( )  {        (. == , "only admin is allowed");         = ;    }         ()  {        (. == , "only admin is allowed");        (!, "Pausable: paused");         = ;         (.);    }         ( ,  ,  ,  ,  ,  ,  ,  )  {          = ( / 0x0100);         (!(( / 0x0100))) {             = (!(().. > 0)) ? 1 : 0;        }        (( != 0x0 || (0xff &  / 0x1) == 0x0), "Initializable: contract is already initialized");         (!(( / 0x0100))) {             = (0x01 * 0x0100) | (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff & );             = (0x01 * 0x01) | (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00 & );        }         = ;         = 0x3b9aca00;         = ;         = ;         = ;         = ;         = ;         = ;         = ;         = 0x01;         = 0x03e8;         = 0x01;         = 0x03e8;         (!(( / 0x0100))) {             = (0 * 0x0100) | (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff & );        }    }         ( ,  )    () {         ( < []) {             ;        }    }         ()   () {        ();         ;    }         ( ,  )  {        (. == , "only admin is allowed");        ( > 0x0, "unstakeFeeDenominator must be positive");         ( > 0) {            ( > 0x0, "SafeMath: division by zero");            ( /  > 0xc8, "unstake fee rate must be less than 0.5%");        }         = ;         = ;    }         ( )  {        (. == , "only admin is allowed");        (.. != 0x0);        ( ,   ) = .(, .); // call        ();        (!(. < 0x20));    }         ( )    () {        ();         ;    }         ( ,  )    () {         ( < []) {             ;        }    }         ( )  {        ();    }         ( )  {        (. == , "only admin is allowed");        (.. != 0x0);        ( ,   ) = .(., ); // call        ();        (!(. < 0x20));    }         ( )    () {         ;          = (!(. < )) ? 1 : 0;         (!( <  ||  >= )) {              = ;             = 0;             () {                 ( > ) {                    ;                }                (!(( + ) < ), "SafeMath: addition overflow");                 = 0x01 + ;                 =  + ;            }        }  {             = 0;        }         ;    }         ( )  {        // Decompilation incomplete: helper effect provenance is conservative.        (!( == 0x02), "ReentrancyGuard: reentrant call");         = 0x02;         ;         (!((. % 0x015180) > 0x0258)) {              = 0x01;             = 0;             = ;        }  {              = 0x01;             ((. % 0x015180) > 0x014cd0) {                 = 0;            }             = ;        }        ((0xff & ) == 0x1, "Wrong period");        (... <= 0x0, "contract is not allowed");        (. == ., "no proxy contract is allowed");        (!, "Pausable: paused");        (0 != 0x0, "");        ( >= 0xb1a2bc2ec500000, "unstake amount must be more than 0.8:LBNB");          =  * ;         ( != 0x0) {            ((( * ) / ) == , "SafeMath: multiplication overflow");        }  {             = 0;        }        ( > 0, "SafeMath: division by zero");         ;         = 0x20 + (0x20 + (0x20 + (0x24 + )));         = 0x40 + ;        (!((). < 0), "Address: insufficient balance for call");        (.. > 0x0, "Address: call to non-contract");          = 0x20 + ;          = ;          = ;         () {              = ;              = ;              = ;             ( < 0x20) {                ;            }             ( - 0x20 < 0x20) {                ;            }             = ( + 0x20) + 0x20;             = ( + 0x20) + 0x20;             = ( - 0x20) - 0x20;             =  + 0x20;             =  + 0x20;             =  - 0x20;        }        ( ,   ) = ().{ : 0 }(, , ); // call          = 0x60;         (. != 0) {             =  + ((. + 0x3f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));             = ;        }         (!) {            (!( > 0));              = 0;             () {                  = ;                 (!( < )) {                    ;                }                 (!(( + 0x20) < )) {                    ;                }                 = ( + 0x20) + 0x20;                 =  + 0x20;            }            ("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00");        }         ( > 0) {            (!( < 0x20));            ( != 0x0, "SafeERC20: ERC20 operation did not succeed");        }        (!(( / ) > ), "SafeMath: subtraction overflow");         = 0x20 + (0x20 + (0x20 + (0x24 + )));         = 0x40 + ;        (!((). < 0), "Address: insufficient balance for call");        (.. > 0x0, "Address: call to non-contract");          = 0x20 + ;          = ;          = ;         () {              = ;              = ;              = ;             ( < 0x20) {                ;            }             ( - 0x20 < 0x20) {                ;            }             = ( + 0x20) + 0x20;             = ( + 0x20) + 0x20;             = ( - 0x20) - 0x20;             =  + 0x20;             =  + 0x20;             =  - 0x20;        }        ( ,   ) = ().{ : 0 }(, , ); // call          = 0x60;         (. != 0) {             =  + ((. + 0x3f) & (0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0));             = ;        }         (!) {            (!( > 0));              = 0;             () {                  = ;                 (!( < )) {                    ;                }                 (!(( + 0x20) < )) {                    ;                }                 = ( + 0x20) + 0x20;                 =  + 0x20;            }            ("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00");        }         ( > 0) {            (!( < 0x20));            ( != 0x0, "SafeERC20: ERC20 operation did not succeed");        }        (.. != 0x0);        ( ,   ) = .( - ( / )); // call        ();        (!(. < 0x20));          = ( - ( / )) * ;         (!(( - ( / )) == 0)) {            ((( - ( / )) * ) / ( - ( / )) == , "SafeMath: multiplication overflow");        }  {             = 0;        }        (0x3b9aca00 > 0x0, "SafeMath: division by zero");        (0x2540be400 > 0x0, "SafeMath: modulo by zero");        ( / 0x3b9aca00 % 0x2540be400 <=  / 0x3b9aca00, "SafeMath: subtraction overflow");        (!(( / 0x3b9aca00) - (( / 0x3b9aca00) % 0x02540be400) > ), "SafeMath: subtraction overflow");         =  - (( / 0x3b9aca00) - (( / 0x3b9aca00) % 0x02540be400));         = (() * 0x01) | (0xffffffffffffffffffffffff0000000000000000000000000000000000000000 & );         = ;         = ;        [.] = [.] + 0x01;         = ;         (.,  - ( / ), ( / 0x3b9aca00) - (( / 0x3b9aca00) % 0x02540be400), );         = 0x01 + ;         = 0x01;    }         ( ,  )  {        // Decompilation incomplete: helper effect provenance is conservative.         ;         ( != 0x0) {             ;             ( >= ) {                ( <= , "SafeMath: subtraction overflow");                 ;                 (!( -  <  ||  >= )) {                    (0x15180 > 0x0, "SafeMath: modulo by zero");                    (!(( % 0x015180) > ), "SafeMath: subtraction overflow");                    (0x1 <= , "SafeMath: subtraction overflow");                      =  - 0x01;                      = ;                      = 0;                     () {                        ( <= , "SafeMath: subtraction overflow");                         ( - 0x1 <  - ) {                            ;                        }                         ( < ( - ( % 0x015180))) {                            ;                        }                          =  * ;                         (!( == 0)) {                            (( * ) /  == , "SafeMath: multiplication overflow");                        }  {                             = 0;                        }                        (0x0 +  >= 0x0, "SafeMath: addition overflow");                         = ( - 0x01) - 0x01;                         = ;                         = 0 + ;                    }                      =  * 0;                     (!( == 0)) {                        (( * 0) /  == 0, "SafeMath: multiplication overflow");                    }  {                         = 0;                    }                      =  * ;                     ( != 0x0) {                        ((( * ) / ) == , "SafeMath: multiplication overflow");                    }  {                         = 0;                    }                    (0x0 +  >= 0x0, "SafeMath: addition overflow");                    (0x3b9aca00 > 0x0, "SafeMath: division by zero");                     = (0 + ) / 0x3b9aca00;                }  {                     = 0;                }                 = ;            }  {                 = 0;            }             = ;        }  {             = 0;        }    }         ( )  {        // Decompilation incomplete: helper effect provenance is conservative.         ;         (!((. % 0x015180) > 0x0258)) {              = 0x01;             = 0;             = ;        }  {              = 0x01;             ((. % 0x015180) > 0x014cd0) {                 = 0;            }             = ;        }        ((0xff & ) == 0x1, "Wrong period");        (!, "Pausable: paused");        (0 != 0x0, "");        ((0x1004).. != 0x0);        ( ,   ) = (0x1004).(); // staticcall        ();        (!(. < 0x20));        (. == ., "msg.value must equal to miniRelayFee");        (!((). < ), "BNB balance is not enough");        ( % 0x2540be400 == 0x0, "amount must be N * 1e10");        ( +  >= , "SafeMath: addition overflow");        ((0x1004).. != 0x0);        ( ,   ) = (0x1004).{ : . +  }(0, , , (. + 0x0e10)); // call        ();        (!(. < 0x20));    }         ()  {        // Decompilation incomplete: helper effect provenance is conservative.        (!, "Pausable: paused");        (0 != 0x0, "");        (. > 0, "stakingRewardVault has no BNB");        (.. != 0x0);        ( ,   ) = .(., ); // call        ();        (!(. < 0x20));        (. == ., "reward amount mismatch");        (.. != 0x0);        ( ,   ) = .(.((0x18160ddd))); // staticcall totalSupply        ();        (!(. < 0x20));          = .(, ());        (!(( + (.)) < ), "SafeMath: addition overflow");         =  + (.);         (!( == 0)) {              =  * 0x3b9aca00;             (!( == 0)) {                ((( * 0x3b9aca00) / ) == 0x3b9aca00, "SafeMath: multiplication overflow");            }  {                 = 0;            }            ( > 0, "SafeMath: division by zero");             =  / ;        }  {             = 0x3b9aca00;        }         (, , );    }         ( )  {        // Decompilation incomplete: helper effect provenance is conservative.        (!( == 0x02), "ReentrancyGuard: reentrant call");         = 0x02;         ;         (!((. % 0x015180) > 0x0258)) {              = 0x01;             = 0;             = ;        }  {              = 0x01;             ((. % 0x015180) > 0x014cd0) {                 = 0;            }             = ;        }        ((0xff & ) == 0x1, "Wrong period");        (... <= 0x0, "contract is not allowed");        (. == ., "no proxy contract is allowed");        (!, "Pausable: paused");        (0 != 0x0, "");        ((0x1004).. != 0x0);        ( ,   ) = (0x1004).(); // staticcall        ();        (!(. < 0x20));        ( +  >= , "SafeMath: addition overflow");        (. == ( + .), "msg.value must equal to amount + miniRelayFee");        (( % 0x2540be400 == 0x0 &&  >= 0xde0b6b3a7640000), "stake amount must be N * 1e10 and more than 1:BNB");          =  * ;         ( != 0x0) {            ((( * ) / ) == , "SafeMath: multiplication overflow");        }  {             = 0;        }        ( > 0, "SafeMath: division by zero");        ( ,   ) = .{ : (!( / )) * 0x08fc, :  /  }(""); // call        ();        (!(( / ) > ), "SafeMath: subtraction overflow");        (!(( + ( - ( / ))) < ), "SafeMath: addition overflow");         =  + ( - ( / ));          = ( - ( / )) * 0x3b9aca00;         (!(( - ( / )) == 0)) {            ((( - ( / )) * 0x3b9aca00) / ( - ( / )) == 0x3b9aca00, "SafeMath: multiplication overflow");        }  {             = 0;        }        ( > 0, "SafeMath: division by zero");        (0x2540be400 > 0x0, "SafeMath: modulo by zero");          =  - ( / );         (!((( - ( / )) % 0x02540be400) == 0)) {            ( ,   ) = .{ : (!(( - ( / )) % 0x02540be400)) * 0x08fc, : ( - ( / )) % 0x02540be400 }(""); // call            ();            (!((( - ( / )) % 0x02540be400) > ( - ( / ))), "SafeMath: subtraction overflow");             = ( - ( / )) - (( - ( / )) % 0x02540be400);        }        ( +  >= , "SafeMath: addition overflow");        ((0x1004).. != 0x0);        ( ,   ) = (0x1004).{ : . +  }(0, , , (. + 0x0e10)); // call        ();        (!(. < 0x20));        (.. != 0x0);        ( ,   ) = .(.,  / ); // call        ();        (!(. < 0x20));         (.,  / , );         = 0x01;    }         ( )  {        // Decompilation incomplete: helper effect provenance is conservative.        (!( == 0x02), "ReentrancyGuard: reentrant call");         = 0x02;        (!, "Pausable: paused");        (0 != 0x0, "");          = 0x0 < ;          = 0;         () {             (!( &&  < )) {                 = 0x01;                ;                ;            }             ;             = 0x60 + ;             = 0x60 + ;             (. < ) {                 = 0x01;                ;                ;            }             = (0xffffffffffffffffffffffff0000000000000000000000000000000000000000) & ;             = 0;             = 0;            (.. != 0x0);            ( ,   ) = .(, ()); // call            ();            (!(. < 0x20));            (. == , "amount mismatch");             ((), , );             (([()] - 0x01) >= [()]) {                ;            }             ( != ) {                  = 0;                 ;                 () {                     = 0;                     ( >= [()]) {                        ;                    }                     ( >= [()]) {                        ;                    }                     ( == ) {                         ( < [()]) {                             = ;                        }                        ;                    }                     = 0x01 + ;                     = 0x01;                }                ( != 0x0, "failed to find matched unstake sequence");            }             ([()] == 0) {                ;            }             = 0;            [()] = [()] - 0x01;             = 0x01 + ;             = (0x01 + ) < ;             = 0x01 + ;        }    }        // Note: This selector table is synthetic and is not part of the original Solidity source.    // It records the recovered selector-to-signature mapping without executable behavior.        // 0x07066e9e => MINIMUM_UNSTAKE_AMOUNT()    // 0x0e18b681 => acceptAdmin()    // 0x1904c11d => unstakesMap(uint256)    // 0x1ed24195 => getPeriod()    // 0x26782247 => pendingAdmin()    // 0x2c18071e => getUnstakeSeqsLength(address)    // 0x2e17de78 => unstake(uint256)    // 0x35e66ace => setPriceToAccelerateUnstake(uint256)    // 0x36828a62 => unstakeVault()    // 0x3a01b964 => EXCHANGE_RATE_PRECISION()    // 0x3e10e49f => unstakeFeeDenominator()    // 0x3e91f3b9 => tailIdx()    // 0x3f4ba83a => unpause()    // 0x4dd18bf5 => setPendingAdmin(address)    // 0x54dd18d6 => unstakeFeeMolecular()    // 0x5596928c => lbnbMarketCapacityCountByBNB()    // 0x5a1f7ae5 => accelerateUnstakedMature(uint256,uint256,uint256)    // 0x5b188db4 => PRICE_TO_ACCELERATE_UNSTAKE_PRECISION()    // 0x5c975abb => paused()    // 0x61a35bb1 => communityTaxVault()    // 0x62928748 => stakingRewardVault()    // 0x63731080 => ZERO_ADDR()    // 0x64aeb9de => setStakeFeeRate(uint256,uint256)    // 0x6619b182 => estimateSBFCostForAccelerate(uint256,uint256)    // 0x6908aa24 => headerIdx()    // 0x6b61f1f0 => BREATHE_PERIOD()    // 0x76936f64 => stakeFeeMolecular()    // 0x7c7bd59e => resendBNBToBCStakingTSS(uint256)    // 0x7da61eec => SBF()    // 0x80b82eb9 => setCommunityTaxVault(address)    // 0x8456cb59 => pause()    // 0x84d804be => MINIMUM_STAKE_AMOUNT()    // 0x88301911 => initialize(address,address,address,address,address,address,address,uint256)    // 0x886d88e1 => getUnstakeSequence(address,uint256)    // 0x8cf7d0bb => rebaseLBNBToBNB()    // 0x92095174 => NORMAL_PERIOD()    // 0x9e9d5a80 => setUnstakeFeeRate(uint256,uint256)    // 0xa4178287 => claimVault(uint256)    // 0xa694fc3a => stake(uint256)    // 0xaee215da => priceToAccelerateUnstake()    // 0xb4d552bd => TOKENHUB_ADDR()    // 0xbfffc91d => bcStakingTSS()    // 0xc78c3069 => accountUnstakeSeqsMap(address,uint256)    // 0xcc9b6ec4 => lbnbToBNBExchangeRate()    // 0xd6a5d167 => batchClaimPendingUnstake(uint256)    // 0xda0660f5 => mintLBNB(uint256)    // 0xda0d1959 => isUnstakeClaimable(uint256)    // 0xdcf3a7c7 => LBNB()    // 0xeb7a75d7 => stakeFeeDenominator()    // 0xf851a440 => admin()}