improved logic for slow minting

This commit is contained in:
Alexander 2024-07-09 13:21:11 -04:00
parent eb79b433a4
commit 0e86839a3a
2 changed files with 9 additions and 2 deletions

View file

@ -516,7 +516,8 @@ def mint_tokens(account, token_address, amount, attempts=18):
call_function = random.choice(list(rng_functions[token_address]['functions'])) call_function = random.choice(list(rng_functions[token_address]['functions']))
token_contract = load_contract(token_address, load_contract_abi(token_address)) token_contract = load_contract(token_address, load_contract_abi(token_address))
token_info = get_token_info(token_address) token_info = get_token_info(token_address)
for i in list(range(0, int(amount))): loops = math.ceil(amount / rng_functions[token_address]['mints'])
for i in list(range(0, loops)):
tx = getattr(token_contract.functions, call_function)().build_transaction({ tx = getattr(token_contract.functions, call_function)().build_transaction({
"from": account.address, "from": account.address,
"nonce": get_nonce(account.address) "nonce": get_nonce(account.address)

View file

@ -3,30 +3,35 @@
"functions": { "functions": {
"Generate": null "Generate": null
}, },
"mints": 1,
"label": "RNG 1" "label": "RNG 1"
}, },
"0x2b943Bf3cFc3B7A42DC7d13898171802BCD3Aea9": { "0x2b943Bf3cFc3B7A42DC7d13898171802BCD3Aea9": {
"functions": { "functions": {
"Generate": null "Generate": null
}, },
"mints": 1,
"label": "RNG 2" "label": "RNG 2"
}, },
"0x17E136fD4c821ae25A611fAF187753B6e84736a4": { "0x17E136fD4c821ae25A611fAF187753B6e84736a4": {
"functions": { "functions": {
"Generate": null "Generate": null
}, },
"mints": 1,
"label": "RNG 3" "label": "RNG 3"
}, },
"0x5EF3011243B03f817223A19f277638397048A0DC": { "0x5EF3011243B03f817223A19f277638397048A0DC": {
"functions": { "functions": {
"Random": null "Random": null
}, },
"mints": 1,
"label": "MATH v1.0" "label": "MATH v1.0"
}, },
"0xB680F0cc810317933F234f67EB6A9E923407f05D": { "0xB680F0cc810317933F234f67EB6A9E923407f05D": {
"functions": { "functions": {
"Random": null "Random": null
}, },
"mints": 1,
"label": "MATH v1.1" "label": "MATH v1.1"
}, },
"0x24F0154C1dCe548AdF15da2098Fdd8B8A3B8151D": { "0x24F0154C1dCe548AdF15da2098Fdd8B8A3B8151D": {
@ -35,6 +40,7 @@
"Pi": null, "Pi": null,
"Rho": null "Rho": null
}, },
"mints": 3,
"label": "AFFECTION™" "label": "AFFECTION™"
} }
} }