反编译 Python 代码
unknown
python
3 years ago
7.5 kB
22
Indexable
# Palkeoramix decompiler.
def storage:
govAddress is addr at storage 0
unknown245a7bfcAddress is addr at storage 1
answer is uint256 at storage 2
stor3 is array of struct at storage 3
decimals is uint256 at storage 4
roundId is uint128 at storage 5
unknown4c295ca3 is mapping of uint256 at storage 6
unknown356cb32c is mapping of uint256 at storage 7
stor8 is mapping of uint8 at storage 8
def gov() payable:
return govAddress
def unknown245a7bfc() payable:
return unknown245a7bfcAddress
def isAdmin(address _account) payable:
require calldata.size - 4 >=′ 32
require _account == _account
return bool(stor8[_account])
def decimals() payable:
return decimals
def unknown356cb32c(uint256 _param1) payable:
require calldata.size - 4 >=′ 32
require _param1 == Mask(80, 0, _param1)
return unknown356cb32c[_param1]
def unknown4c295ca3(uint256 _param1) payable:
require calldata.size - 4 >=′ 32
require _param1 == Mask(80, 0, _param1)
return unknown4c295ca3[_param1]
def unknown50d25bcd() payable:
return answer
def latestRound() payable:
return roundId
def answer() payable:
return answer
def roundId() payable:
return roundId
#
# Regular functions
#
def _fallback() payable: # default function
revert
def unknown9a6fc8f5(uint256 _param1) payable:
require calldata.size - 4 >=′ 32
require _param1 == Mask(80, 0, _param1)
return _param1 << 176, unknown4c295ca3[_param1 << 176], unknown356cb32c[stor5], 0, 0
def setAdmin(address _admin, bool _isAdmin) payable:
require calldata.size - 4 >=′ 64
require _admin == _admin
require _isAdmin == _isAdmin
if govAddress != caller:
revert with 0, 'PriceFeed: forbidden'
stor8[addr(_admin)] = uint8(_isAdmin)
log SetAdmin(
address address=_isAdmin,
bool isAdmin=_admin)
def unknown20aa1b80(uint256 _param1) payable:
require calldata.size - 4 >=′ 32
if not stor8[caller]:
revert with 0, 'PriceFeed: forbidden'
if 1 > -roundId + 1208925819614629174706175:
revert with 0, 17
roundId = Mask(80, 0, roundId + 1)
answer = _param1
unknown4c295ca3[stor5 + 1 << 176] = _param1
unknown356cb32c[stor5] = block.timestamp
log 0xb1b517ec: _param1
def setDescription(string _description) payable:
require calldata.size - 4 >=′ 32
require _description <= 18446744073709551615
require _description + 35 <′ calldata.size
if _description.length > 18446744073709551615:
revert with 0, 65
if ceil32(ceil32(_description.length)) + 97 < 96 or ceil32(ceil32(_description.length)) + 97 > 18446744073709551615:
revert with 0, 65
require _description + _description.length + 36 <= calldata.size
if not stor8[caller]:
revert with 0, 'PriceFeed: forbidden'
if bool(stor3.length):
if bool(stor3.length) == uint255(stor3.length) * 0.5 < 32:
revert with 0, 34
if _description.length:
stor3[].field_0 = Array(len=_description.length, data=_description[all])
else:
stor3.length = 0
idx = 0
while (uint255(stor3.length) * 0.5) + 31 / 32 > idx:
stor3[idx].field_0 = 0
idx = idx + 1
continue
else:
if bool(stor3.length) == stor3.length.field_1 < 32:
revert with 0, 34
if _description.length:
stor3[].field_0 = Array(len=_description.length, data=_description[all])
else:
stor3.length = 0
idx = 0
while stor3.length.field_1 + 31 / 32 > idx:
stor3[idx].field_0 = 0
idx = idx + 1
continue
log 0x57edbdcc: Array(len=_description.length, data=_description[all])
def description() payable:
if bool(stor3.length):
if bool(stor3.length) == uint255(stor3.length) * 0.5 < 32:
revert with 0, 34
if bool(stor3.length):
if bool(stor3.length) == uint255(stor3.length) * 0.5 < 32:
revert with 0, 34
if Mask(256, -1, stor3.length):
if 31 < uint255(stor3.length) * 0.5:
mem[128] = uint256(stor3.field_0)
idx = 128
s = 0
while (uint255(stor3.length) * 0.5) + 96 > idx:
mem[idx + 32] = stor3[s].field_256
idx = idx + 32
s = s + 1
continue
return Array(len=2 * Mask(256, -1, stor3.length), data=mem[128 len ceil32(uint255(stor3.length) * 0.5)])
mem[128] = 256 * stor3.length.field_8
else:
if bool(stor3.length) == stor3.length.field_1 < 32:
revert with 0, 34
if stor3.length.field_1:
if 31 < stor3.length.field_1:
mem[128] = uint256(stor3.field_0)
idx = 128
s = 0
while stor3.length.field_1 + 96 > idx:
mem[idx + 32] = stor3[s].field_256
idx = idx + 32
s = s + 1
continue
return Array(len=2 * Mask(256, -1, stor3.length), data=mem[128 len ceil32(uint255(stor3.length) * 0.5)])
mem[128] = 256 * stor3.length.field_8
mem[ceil32(uint255(stor3.length) * 0.5) + 192 len ceil32(uint255(stor3.length) * 0.5)] = mem[128 len ceil32(uint255(stor3.length) * 0.5)]
if ceil32(uint255(stor3.length) * 0.5) > uint255(stor3.length) * 0.5:
mem[ceil32(uint255(stor3.length) * 0.5) + (uint255(stor3.length) * 0.5) + 192] = 0
return Array(len=2 * Mask(256, -1, stor3.length), data=mem[128 len ceil32(uint255(stor3.length) * 0.5)], mem[(2 * ceil32(uint255(stor3.length) * 0.5)) + 192 len 2 * ceil32(uint255(stor3.length) * 0.5)]),
if bool(stor3.length) == stor3.length.field_1 < 32:
revert with 0, 34
if bool(stor3.length):
if bool(stor3.length) == uint255(stor3.length) * 0.5 < 32:
revert with 0, 34
if Mask(256, -1, stor3.length):
if 31 < uint255(stor3.length) * 0.5:
mem[128] = uint256(stor3.field_0)
idx = 128
s = 0
while (uint255(stor3.length) * 0.5) + 96 > idx:
mem[idx + 32] = stor3[s].field_256
idx = idx + 32
s = s + 1
continue
return Array(len=stor3.length % 128, data=mem[128 len ceil32(stor3.length.field_1)])
mem[128] = 256 * stor3.length.field_8
else:
if bool(stor3.length) == stor3.length.field_1 < 32:
revert with 0, 34
if stor3.length.field_1:
if 31 < stor3.length.field_1:
mem[128] = uint256(stor3.field_0)
idx = 128
s = 0
while stor3.length.field_1 + 96 > idx:
mem[idx + 32] = stor3[s].field_256
idx = idx + 32
s = s + 1
continue
return Array(len=stor3.length % 128, data=mem[128 len ceil32(stor3.length.field_1)])
mem[128] = 256 * stor3.length.field_8
mem[ceil32(stor3.length.field_1) + 192 len ceil32(stor3.length.field_1)] = mem[128 len ceil32(stor3.length.field_1)]
if ceil32(stor3.length.field_1) > stor3.length.field_1:
mem[ceil32(stor3.length.field_1) + stor3.length.field_1 + 192] = 0
return Array(len=stor3.length % 128, data=mem[128 len ceil32(stor3.length.field_1)], mem[(2 * ceil32(stor3.length.field_1)) + 192 len 2 * ceil32(stor3.length.field_1)]),Editor is loading...