Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 16448

Sign signature buyTokenByTokenWithPermission ETH BSC memory _signature bytes _signature

$
0
0

I am currently writing a python script to interact with a BSC contract.

I don't know how to generate the bytes_signature for this function for the below txhash. It must be something simple that I am missing.

[8]:  3deec388befec448046d583d65e15cd77aa9c74ba8c534305089f5869ffe9208[9]:  7f29af0ba8d129018f19a520a8b342b0ea90df02aed99a4b28f8db2dc61df072

https://bscscan.com/tx/0x94e9df05600e46ae0ef5fd7dc890a44d514e8dd08283a4e909410fac6220efe5

Function: buyTokenByTokenWithPermission(address _beneficiary, address _token, uint256 _amount, address _candidate, uint256 _maxAmount, uint256 _minAmount, bytes _signature) ***

MethodID: 0xa1491efc[0]:  0000000000000000000000002cff6fb5a463735d65c29d933ce7f1c45350cb33[1]:  000000000000000000000000e9e7cea3dedca5984780bafc599bd69add087d56[2]:  000000000000000000000000000000000000000000000005e74a8505e80a0000[3]:  0000000000000000000000002cff6fb5a463735d65c29d933ce7f1c45350cb33[4]:  000000000000000000000000000000000000000000000094f138d51f01ba2f70[5]:  0000000000000000000000000000000000000000000000000000000000000000[6]:  00000000000000000000000000000000000000000000000000000000000000e0[7]:  0000000000000000000000000000000000000000000000000000000000000041[8]:  3deec388befec448046d583d65e15cd77aa9c74ba8c534305089f5869ffe9208[9]:  7f29af0ba8d129018f19a520a8b342b0ea90df02aed99a4b28f8db2dc61df072[10]: 1c00000000000000000000000000000000000000000000000000000000000000

See more info below

function buyTokenByTokenWithPermission(address _beneficiary,address _token,uint256 _amount,address _candidate,uint256 _maxAmount,uint256 _minAmount,bytes memory _signature) public whenNotPaused nonReentrant {require(offeredCurrencies[_token].rate != 0, "POOL::PURCHASE_METHOD_NOT_ALLOWED");require(_validPurchase(), "POOL::ENDED");require(_verifyWhitelist(_candidate, _maxAmount, _minAmount, _signature), "POOL:INVALID_SIGNATURE");_preValidatePurchase(_beneficiary, _amount);uint256 tokens = _getOfferedCurrencyToTokenAmount(_token, _amount);require(getAvailableTokensForSale() >= tokens, "POOL::NOT_ENOUGHT_TOKENS_FOR_SALE");require(tokens >= _minAmount || userPurchased[_candidate].add(tokens) >= _minAmount, "POOL::MIN_AMOUNT_UNREACHED");require(userPurchased[_candidate].add(tokens) <= _maxAmount, "POOL:PURCHASE_AMOUNT_EXCEED_ALLOWANCE");_forwardTokenFunds(_token, _amount);_updatePurchasingState(_amount, tokens);investedAmountOf[_token][_candidate] = investedAmountOf[address(0)][_candidate].add(_amount);emit TokenPurchaseByToken(msg.sender,_beneficiary,_token,_amount,tokens);}

Viewing all articles
Browse latest Browse all 16448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>