1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
| In [547]: proposeadmin_selector = io.soliditySha3(abi_types=['string'],values=['proposeNewAdmin(address)'])[:4].hex()
In [548]: proposeadmin_selector Out[548]: '0xa6376746'
In [549]: calldata = proposeadmin_selector + pub[2:].zfill(64)
In [550]: calldata Out[550]: '0xa637674600000000000000000000000025Bf651a048be8420997944C92c80e5064C1c5d6'
In [551]: tx = {'to': ad, 'from': pub, 'data': calldata, 'chainId': 11155111, 'nonce': io.eth.get_transaction_count(pub), 'gasPrice': io.eth.gas_price} t In [552]: tx['gas'] = io.eth.estimate_gas(tx)
In [553]: tx Out[553]: {'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'data': '0xa637674600000000000000000000000025Bf651a048be8420997944C92c80e5064C1c5d6', 'chainId': 11155111, 'nonce': 338, 'gasPrice': 2500000007, 'gas': 26158}
In [554]: stx = io.eth.account.sign_transaction(tx,p)
In [555]: hsh = io.eth.send_raw_transaction(stx.rawTransaction)
In [556]: io.eth.wait_for_transaction_receipt(hsh) Out[556]: AttributeDict({'blockHash': HexBytes('0xe5e93b3acaeb9470e03fa62e389a9c3786272bbd2d6ce555d159c9ea5a248cfc'), 'blockNumber': 2383194, 'contractAddress': None, 'cumulativeGasUsed': 23966, 'effectiveGasPrice': 2500000007, 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'gasUsed': 23966, 'logs': [], 'logsBloom': HexBytes('0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'status': 1, 'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'transactionHash': HexBytes('0x94e4ff6939b4cb9b3c1f492a480fa7f4302e616e90674b86289e3556aa3f7d31'), 'transactionIndex': 0, 'type': '0x0'})
In [557]: io.eth.get_storage_at(ad,0) Out[557]: HexBytes('0x00000000000000000000000025bf651a048be8420997944c92c80e5064c1c5d6')
In [558]: addtowhitelist_selector = io.soliditySha3(abi_types=['string'],values=['addToWhitelist(address)'])[:4].hex()
In [559]: addtowhitelist_selector Out[559]: '0xe43252d7'
In [560]: calldata = addtowhitelist_selector + pub[2:].zfill(64)
In [561]: calldata Out[561]: '0xe43252d700000000000000000000000025Bf651a048be8420997944C92c80e5064C1c5d6'
In [562]: tx = {'to': ad, 'from': pub, 'data': calldata, 'chainId': 11155111, 'nonce': io.eth.get_transaction_count(pub), 'gasPrice': io.eth.gas_price}
In [563]: tx['gas'] = io.eth.estimate_gas(tx)
In [564]: tx Out[564]: {'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'data': '0xe43252d700000000000000000000000025Bf651a048be8420997944C92c80e5064C1c5d6', 'chainId': 11155111, 'nonce': 339, 'gasPrice': 2500000007, 'gas': 33483}
In [565]: stx = io.eth.account.sign_transaction(tx,p)
In [566]: hsh = io.eth.send_raw_transaction(stx.rawTransaction)
In [567]: io.eth.get_storage_at(ad,0) Out[567]: HexBytes('0x00000000000000000000000025bf651a048be8420997944c92c80e5064c1c5d6')
In [568]: io.eth.wait_for_transaction_receipt(hsh) Out[568]: AttributeDict({'blockHash': HexBytes('0xc83921ff00d4046f14c2bf24365c1aa0fb6158e0678329b630b58bfed5dcda70'), 'blockNumber': 2383196, 'contractAddress': None, 'cumulativeGasUsed': 31218, 'effectiveGasPrice': 2500000007, 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'gasUsed': 31218, 'logs': [], 'logsBloom': HexBytes('0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'status': 1, 'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'transactionHash': HexBytes('0xbf6f02cb48561e75a2972dc7ed8a77bbca502947d647e575e0f93fd7d57b14fb'), 'transactionIndex': 0, 'type': '0x0'})
In [569]: calldata = '''0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000400000000 ...: 0000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 ...: 00000000000000000000000000a4ac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000 ...: 00000200000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'''
In [570]: tx = {'to': ad, 'from': pub, 'data': calldata, 'chainId': 11155111, 'nonce': io.eth.get_transaction_count(pub), 'gasPrice': io.eth.gas_price}
In [571]: io.eth.get_balance(ad) Out[571]: 1000000000000000
In [572]: tx = {'to': ad, 'from': pub, 'data': calldata, 'chainId': 11155111, 'nonce': io.eth.get_transaction_count(pub), 'gasPrice': io.eth.gas_price, 'value': io.eth.get_balance(ad)}
In [573]: tx['gas'] = io.eth.estimate_gas(tx)
In [574]: tx Out[574]: {'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'data': '0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a4ac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000', 'chainId': 11155111, 'nonce': 340, 'gasPrice': 2500000007, 'value': 1000000000000000, 'gas': 64207}
In [575]: stx = io.eth.account.sign_transaction(tx,p)
In [576]: hsh = io.eth.send_raw_transaction(stx.rawTransaction)
In [577]: io.eth.wait_for_transaction_receipt(hsh) Out[577]: AttributeDict({'blockHash': HexBytes('0x43c6b94d62f24476fe8f06976b35d1332511918cf1f00138947959ede1b72138'), 'blockNumber': 2383204, 'contractAddress': None, 'cumulativeGasUsed': 61724, 'effectiveGasPrice': 2500000007, 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'gasUsed': 61724, 'logs': [], 'logsBloom': HexBytes('0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'status': 1, 'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'transactionHash': HexBytes('0x81d0d7075c855e6432f37526b8aa506660e0f431f10d253878fa17c64a6b65af'), 'transactionIndex': 0, 'type': '0x0'})
In [578]: io.eth.get_balance(ad) Out[578]: 2000000000000000
In [579]: calldata = '''0xb61d27f600000000000000000000000025bf651a048be8420997944c92c80e5064c1c5d600000000000000000000000000000000000000000000000000071afd498d000000000000000000000000000000000000000000000000000000000000000000600000000 ...: 000000000000000000000000000000000000000000000000000000000'''
In [580]: tx = {'to': ad, 'from': pub, 'data': calldata, 'chainId': 11155111, 'nonce': io.eth.get_transaction_count(pub), 'gasPrice': io.eth.gas_price}
In [581]: tx['gas'] = io.eth.estimate_gas(tx)
In [582]: stx = io.eth.account.sign_transaction(tx,p)
In [583]: hsh = io.eth.send_raw_transaction(stx.rawTransaction)
In [584]: io.eth.wait_for_transaction_receipt(hsh) Out[584]: AttributeDict({'blockHash': HexBytes('0x7a7a2f5db57ae7c8e485686fe796c3263ab73fd949d68b3c2dcf344f6b8216f0'), 'blockNumber': 2383220, 'contractAddress': None, 'cumulativeGasUsed': 37158, 'effectiveGasPrice': 2500000007, 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'gasUsed': 37158, 'logs': [], 'logsBloom': HexBytes('0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'status': 1, 'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'transactionHash': HexBytes('0x015cfc32c92f00a41cdbc72d8d3bb120a2276bb02a53d9395c09e47e34d350fa'), 'transactionIndex': 0, 'type': '0x0'})
In [585]: io.eth.get_balance(ad) Out[585]: 0
In [586]: setmaxbalance_selector = io.soliditySha3(abi_types=['string'],values=['setMaxBalance(uint256)'])[:4].hex()
In [587]: setmaxbalance_selector Out[587]: '0x9d51d9b7'
In [592]: calldata = setmaxbalance_selector + pub[2:].zfill(64)
In [593]: calldata Out[593]: '0x9d51d9b700000000000000000000000025Bf651a048be8420997944C92c80e5064C1c5d6'
In [594]: tx = {'to': ad, 'from': pub, 'data': calldata, 'chainId': 11155111, 'nonce': io.eth.get_transaction_count(pub), 'gasPrice': io.eth.gas_price}
In [595]: tx['gas'] = io.eth.estimate_gas(tx)
In [596]: stx = io.eth.account.sign_transaction(tx,p)
In [597]: hsh = io.eth.send_raw_transaction(stx.rawTransaction)
In [599]: io.eth.wait_for_transaction_receipt(hsh) Out[599]: AttributeDict({'blockHash': HexBytes('0xaacdaa8ad4732671a8bfcf4ce6024a4d9f5290b2750a6b192e474c9499f54f76'), 'blockNumber': 2383250, 'contractAddress': None, 'cumulativeGasUsed': 387033, 'effectiveGasPrice': 2500000007, 'from': '0x25Bf651a048be8420997944C92c80e5064C1c5d6', 'gasUsed': 33863, 'logs': [], 'logsBloom': HexBytes('0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'), 'status': 1, 'to': '0xbb404C0948221a9AE98eDfc25D5B75B89150DC1A', 'transactionHash': HexBytes('0x41a43e208ed44d90dab73ee0f270b2c4979afcee54f1896f0b9d995d36011024'), 'transactionIndex': 4, 'type': '0x0'})
|