Donkey Update Diff

Created Diff never expires
# Palkeoramix decompiler.
# Palkeoramix decompiler.


const unknown3ac4202f = 1
const unknown3ac4202f = 1
const getCash = (eth.balance(this.address) - call.value)
const getCash = (eth.balance(this.address) - call.value)


def storage:
def storage:
stor0 is uint8 at storage 0
stor0 is uint8 at storage 0
stor0 is uint8 at storage 0 offset 8
stor0 is uint8 at storage 0 offset 8
stor0 is uint8 at storage 0 offset 16
stor0 is uint8 at storage 0 offset 16
controllerAddress is addr at storage 0 offset 24
controllerAddress is addr at storage 0 offset 24
stor0 is uint256 at storage 0 offset 8
stor0 is uint256 at storage 0 offset 8
interestRateModelAddress is addr at storage 1
interestRateModelAddress is addr at storage 1
unknownd90a730e is uint256 at storage 2
unknownd90a730e is uint256 at storage 2
name is array of uint256 at storage 3
name is array of uint256 at storage 3
symbol is array of uint256 at storage 4
symbol is array of uint256 at storage 4
decimals is uint8 at storage 5
decimals is uint8 at storage 5
stor5 is addr at storage 5
stor5 is addr at storage 5
adminAddress is addr at storage 5 offset 8
adminAddress is addr at storage 5 offset 8
stor5 is uint256 at storage 5 offset 8
stor5 is uint256 at storage 5 offset 8
totalBorrows is uint256 at storage 6
totalBorrows is uint256 at storage 6
totalSupply is uint256 at storage 7
totalSupply is uint256 at storage 7
accrualBlockNumber is uint256 at storage 8
accrualBlockNumber is uint256 at storage 8
borrowIndex is uint256 at storage 9
borrowIndex is uint256 at storage 9
totalReserves is uint256 at storage 10
totalReserves is uint256 at storage 10
reserveFactorMantissa is uint256 at storage 11
reserveFactorMantissa is uint256 at storage 11
stor12 is uint256 at storage 12
stor12 is uint256 at storage 12
balanceOf is mapping of uint256 at storage 13
balanceOf is mapping of uint256 at storage 13
allowance is mapping of uint256 at storage 14
allowance is mapping of uint256 at storage 14
unknown4dc3487d is mapping of uint256 at storage 15
unknown4dc3487d is mapping of uint256 at storage 15
unknown954f92a3 is mapping of uint256 at storage 16
unknown954f92a3 is mapping of uint256 at storage 16
stor17 is mapping of struct at storage 17
stor17 is mapping of struct at storage 17


def name(): # not payable
def name(): # not payable
return name[0 len name.length]
return name[0 len name.length]


def reserveFactorMantissa(): # not payable
def reserveFactorMantissa(): # not payable
return reserveFactorMantissa
return reserveFactorMantissa


def totalSupply(): # not payable
def totalSupply(): # not payable
return totalSupply
return totalSupply


def decimals(): # not payable
def decimals(): # not payable
return decimals
return decimals


def totalBorrows(): # not payable
def totalBorrows(): # not payable
return totalBorrows
return totalBorrows


def unknown4dc3487d(addr _param1): # not payable
def unknown4dc3487d(addr _param1): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
return unknown4dc3487d[_param1]
return unknown4dc3487d[_param1]


def accrualBlockNumber(): # not payable
def accrualBlockNumber(): # not payable
return accrualBlockNumber
return accrualBlockNumber


def balanceOf(address _owner): # not payable
def balanceOf(address _owner): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
return balanceOf[addr(_owner)]
return balanceOf[addr(_owner)]


def totalReserves(): # not payable
def totalReserves(): # not payable
return totalReserves
return totalReserves


def unknown954f92a3(addr _param1): # not payable
def unknown954f92a3(addr _param1): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
return unknown954f92a3[_param1]
return unknown954f92a3[_param1]


def symbol(): # not payable
def symbol(): # not payable
return symbol[0 len symbol.length]
return symbol[0 len symbol.length]


def borrowIndex(): # not payable
def borrowIndex(): # not payable
return borrowIndex
return borrowIndex


def unknownd90a730e(): # not payable
def unknownd90a730e(): # not payable
return unknownd90a730e
return unknownd90a730e


def allowance(address _owner, address _spender): # not payable
def allowance(address _owner, address _spender): # not payable
require calldata.size - 4 >= 64
require calldata.size - 4 >= 64
return allowance[addr(_owner)][addr(_spender)]
return allowance[addr(_owner)][addr(_spender)]


def interestRateModel(): # not payable
def interestRateModel(): # not payable
return interestRateModelAddress
return interestRateModelAddress


def controller(): # not payable
def controller(): # not payable
return controllerAddress
return controllerAddress


def admin(): # not payable
def admin(): # not payable
return adminAddress
return adminAddress


#
#
# Regular functions
# Regular functions
#
#


def setController(address _c): # not payable
def setController(address _c): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
if adminAddress != caller:
if adminAddress != caller:
revert with 0, 'E1'
revert with 0, 'E1'
controllerAddress = _c
controllerAddress = _c
log 0xe253457d: _c
log 0xe253457d: _c
return 0
return 0


def setAdmin(address _admin): # not payable
def setAdmin(address _admin): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
if adminAddress != caller:
if adminAddress != caller:
revert with 0, 'E1'
revert with 0, 'E1'
adminAddress = _admin
adminAddress = _admin
log NewAdmin(address admin):
log NewAdmin(address admin):
0,
0,
_admin,
_admin,


def approve(address _spender, uint256 _value): # not payable
def approve(address _spender, uint256 _value): # not payable
require calldata.size - 4 >= 64
require calldata.size - 4 >= 64
allowance[caller][addr(_spender)] = _value
allowance[caller][addr(_spender)] = _value
log Approval(
log Approval(
address tokenOwner=_value,
address tokenOwner=_value,
address spender=caller,
address spender=caller,
uint256 tokens=_spender)
uint256 tokens=_spender)
return 1
return 1


def supplyRatePerBlock(): # not payable
def supplyRatePerBlock(): # not payable
require call.value <= eth.balance(this.address)
require call.value <= eth.balance(this.address)
require ext_code.size(interestRateModelAddress)
require ext_code.size(interestRateModelAddress)
static call interestRateModelAddress.0xb8168816 with:
static call interestRateModelAddress.0xb8168816 with:
gas gas_remaining wei
gas gas_remaining wei
args 0, uint32(eth.balance(this.address) - call.value), totalBorrows, totalReserves, reserveFactorMantissa
args 0, uint32(eth.balance(this.address) - call.value), totalBorrows, totalReserves, reserveFactorMantissa
if not ext_call.success:
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
require return_data.size >= 32
return ext_call.return_data[0]
return ext_call.return_data[0]


def borrowRatePerBlock(): # not payable
def borrowRatePerBlock(): # not payable
require call.value <= eth.balance(this.address)
require call.value <= eth.balance(this.address)
require ext_code.size(interestRateModelAddress)
require ext_code.size(interestRateModelAddress)
static call interestRateModelAddress.getBorrowRate(uint256 param1, uint256 param2, uint256 param3) with:
static call interestRateModelAddress.getBorrowRate(uint256 param1, uint256 param2, uint256 param3) with:
gas gas_remaining wei
gas gas_remaining wei
args eth.balance(this.address) - call.value, totalBorrows, totalReserves
args eth.balance(this.address) - call.value, totalBorrows, totalReserves
if not ext_call.success:
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
require return_data.size >= 32
return ext_call.return_data[0]
return ext_call.return_data[0]


def borrowBalanceStored(address _param1): # not payable
def borrowBalanceStored(address _param1): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
if not stor17[addr(_param1)].field_0:
if not stor17[addr(_param1)].field_0:
return 0
return 0
if borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_0 != borrowIndex:
if borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_0 != borrowIndex:
revert with 0, 'E74'
revert with 0, 'E74'
if not stor17[addr(_param1)].field_256:
if not stor17[addr(_param1)].field_256:
revert with 0, 'E74'
revert with 0, 'E74'
return (borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256)
return (borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256)


def exchangeRateStored(): # not payable
def exchangeRateStored(): # not payable
if not totalSupply:
if not totalSupply:
return stor12
return stor12
require call.value <= eth.balance(this.address)
require call.value <= eth.balance(this.address)
if totalBorrows < 0:
if totalBorrows < 0:
revert with 0, 'E68'
revert with 0, 'E68'
if totalReserves > totalBorrows + eth.balance(this.address) - call.value:
if totalReserves > totalBorrows + eth.balance(this.address) - call.value:
revert with 0, 'E68'
revert with 0, 'E68'
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if not totalSupply:
if not totalSupply:
revert with 0, 'E68'
revert with 0, 'E68'
return (0 / totalSupply)
return (0 / totalSupply)
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves != 10^18:
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves != 10^18:
revert with 0, 'E68'
revert with 0, 'E68'
if not totalSupply:
if not totalSupply:
revert with 0, 'E68'
revert with 0, 'E68'
return ((10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply)
return ((10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply)


def seize(address _param1, address _param2, uint256 _param3): # not payable
require calldata.size - 4 >= 96
if not uint8(stor0.field_16):
revert with 0, 'E67'
uint8(stor0.field_16) = 0
require ext_code.size(controllerAddress)
call controllerAddress.0xeafe967b with:
gas gas_remaining wei
args 0, uint32(this.address), caller, addr(_param1), _param2
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
if ext_call.return_data[0]:
revert with 0, 'E57'
if _param2 == _param1:
revert with 0, 'E50'
if _param3 > balanceOf[addr(_param2)]:
revert with 0, 'E58'
if _param3 + balanceOf[addr(_param1)] < balanceOf[addr(_param1)]:
revert with 0, 'E59'
balanceOf[addr(_param2)] -= _param3
balanceOf[_param1] = _param3 + balanceOf[addr(_param1)]
log 0x64ddf252: _param3, _param2, _param1
uint8(stor0.field_16) = 1
return 0

def transfer(address _to, uint256 _value): # not payable
def transfer(address _to, uint256 _value): # not payable
require calldata.size - 4 >= 64
require calldata.size - 4 >= 64
if not uint8(stor0.field_16):
if not uint8(stor0.field_16):
revert with 0, 'E67'
revert with 0, 'E67'
uint8(stor0.field_16) = 0
uint8(stor0.field_16) = 0
require ext_code.size(controllerAddress)
require ext_code.size(controllerAddress)
call controllerAddress.transferAllowed(address param1, address param2, address param3, uint256 param4) with:
call controllerAddress.transferAllowed(address param1, address param2, address param3, uint256 param4) with:
gas gas_remaining wei
gas gas_remaining wei
args 0, uint32(this.address), caller, addr(_to), _value
args 0, uint32(this.address), caller, addr(_to), _value
if not ext_call.success:
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
require return_data.size >= 32
if ext_call.return_data[0]:
if ext_call.return_data[0]:
log Failure(
log Failure(
uint256 error=3,
uint256 error=3,
uint256 info=74,
uint256 info=74,
uint256 detail=ext_call.return_data[0])
uint256 detail=ext_call.return_data[0])
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
return 0
return 0
if caller == _to:
if caller == _to:
log Failure(
log Failure(
uint256 error=2,
uint256 error=2,
uint256 info=75,
uint256 info=75,
uint256 detail=0)
uint256 detail=0)
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
return 0
return 0
if caller == caller:
if caller == caller:
if _value > -1:
if _value > -1:
revert with 0, 'E70'
revert with 0, 'E70'
if _value > balanceOf[caller]:
if _value > balanceOf[caller]:
revert with 0, 'E71'
revert with 0, 'E71'
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
revert with 0, 'E72'
revert with 0, 'E72'
balanceOf[caller] -= _value
balanceOf[caller] -= _value
balanceOf[_to] = _value + balanceOf[addr(_to)]
balanceOf[_to] = _value + balanceOf[addr(_to)]
else:
else:
if _value > allowance[caller][caller]:
if _value > allowance[caller][caller]:
revert with 0, 'E70'
revert with 0, 'E70'
if _value > balanceOf[caller]:
if _value > balanceOf[caller]:
revert with 0, 'E71'
revert with 0, 'E71'
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
revert with 0, 'E72'
revert with 0, 'E72'
balanceOf[caller] -= _value
balanceOf[caller] -= _value
balanceOf[_to] = _value + balanceOf[addr(_to)]
balanceOf[_to] = _value + balanceOf[addr(_to)]
if allowance[caller][caller] != -1:
if allowance[caller][caller] != -1:
allowance[caller][caller] -= _value
allowance[caller][caller] -= _value
log 0x64ddf252: _value, caller, _to
log 0x64ddf252: _value, caller, _to
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
return 1
return 1


def transferFrom(address _from, address _to, uint256 _value): # not payable
def transferFrom(address _from, address _to, uint256 _value): # not payable
require calldata.size - 4 >= 96
require calldata.size - 4 >= 96
if not uint8(stor0.field_16):
if not uint8(stor0.field_16):
revert with 0, 'E67'
revert with 0, 'E67'
uint8(stor0.field_16) = 0
uint8(stor0.field_16) = 0
require ext_code.size(controllerAddress)
require ext_code.size(controllerAddress)
call controllerAddress.transferAllowed(address param1, address param2, address param3, uint256 param4) with:
call controllerAddress.transferAllowed(address param1, address param2, address param3, uint256 param4) with:
gas gas_remaining wei
gas gas_remaining wei
args 0, uint32(this.address), addr(_from), addr(_to), _value
args 0, uint32(this.address), addr(_from), addr(_to), _value
if not ext_call.success:
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
require return_data.size >= 32
if ext_call.return_data[0]:
if ext_call.return_data[0]:
log Failure(
log Failure(
uint256 error=3,
uint256 error=3,
uint256 info=74,
uint256 info=74,
uint256 detail=ext_call.return_data[0])
uint256 detail=ext_call.return_data[0])
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
return 0
return 0
if _from == _to:
if _from == _to:
log Failure(
log Failure(
uint256 error=2,
uint256 error=2,
uint256 info=75,
uint256 info=75,
uint256 detail=0)
uint256 detail=0)
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
return 0
return 0
if _from == caller:
if _from == caller:
if _value > -1:
if _value > -1:
revert with 0, 'E70'
revert with 0, 'E70'
if _value > balanceOf[addr(_from)]:
if _value > balanceOf[addr(_from)]:
revert with 0, 'E71'
revert with 0, 'E71'
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
revert with 0, 'E72'
revert with 0, 'E72'
balanceOf[addr(_from)] -= _value
balanceOf[addr(_from)] -= _value
balanceOf[_to] = _value + balanceOf[addr(_to)]
balanceOf[_to] = _value + balanceOf[addr(_to)]
else:
else:
if _value > allowance[addr(_from)][caller]:
if _value > allowance[addr(_from)][caller]:
revert with 0, 'E70'
revert with 0, 'E70'
if _value > balanceOf[addr(_from)]:
if _value > balanceOf[addr(_from)]:
revert with 0, 'E71'
revert with 0, 'E71'
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
if _value + balanceOf[addr(_to)] < balanceOf[addr(_to)]:
revert with 0, 'E72'
revert with 0, 'E72'
balanceOf[addr(_from)] -= _value
balanceOf[addr(_from)] -= _value
balanceOf[_to] = _value + balanceOf[addr(_to)]
balanceOf[_to] = _value + balanceOf[addr(_to)]
if allowance[addr(_from)][caller] != -1:
if allowance[addr(_from)][caller] != -1:
allowance[addr(_from)][caller] -= _value
allowance[addr(_from)][caller] -= _value
log 0x64ddf252: _value, _from, _to
log 0x64ddf252: _value, _from, _to
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
return 1
return 1


def unknownc7b7cc13(addr _param1, addr _param2, uint256 _param3, array _param4, array _param5, uint256 _param6, uint8 _param7): # not payable
def unknownc7b7cc13(addr _param1, addr _param2, uint256 _param3, array _param4, array _param5, uint256 _param6, uint8 _param7): # not payable
require calldata.size - 4 >= 224
require calldata.size - 4 >= 224
require _param4 <= 4294967296
require _param4 <= 4294967296
require _param4 + 36 <= calldata.size
require _param4 + 36 <= calldata.size
require _param4.length <= 4294967296 and _param4 + _param4.length + 36 <= calldata.size
require _param4.length <= 4294967296 and _param4 + _param4.length + 36 <= calldata.size
require _param5 <= 4294967296
require _param5 <= 4294967296
require _param5 + 36 <= calldata.size
require _param5 + 36 <= calldata.size
require _param5.length <= 4294967296 and _param5 + _param5.length + 36 <= calldata.size
require _param5.length <= 4294967296 and _param5 + _param5.length + 36 <= calldata.size
if uint8(stor0.field_8):
if uint8(stor0.field_8):
Mask(248, 0, stor5.field_8) = Mask(248, 0, caller)
Mask(248, 0, stor5.field_8) = Mask(248, 0, caller)
else:
else:
if ext_code.size(this.address):
if ext_code.size(this.address):
if uint8(stor0.field_0):
if uint8(stor0.field_0):
revert with 0,
revert with 0,
32,
32,
46,
46,
0xfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65,
0xfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65,
mem[ceil32(_param4.length) + ceil32(_param5.length) + 274 len 18]
mem[ceil32(_param4.length) + ceil32(_param5.length) + 274 len 18]
if uint8(stor0.field_8):
if uint8(stor0.field_8):
Mask(248, 0, stor5.field_8) = Mask(248, 0, caller)
Mask(248, 0, stor5.field_8) = Mask(248, 0, caller)
else:
else:
uint8(stor0.field_0) = 1
uint8(stor0.field_0) = 1
uint8(stor0.field_8) = 1
uint8(stor0.field_8) = 1
Mask(248, 0, stor0.field_8) = 0
Mask(248, 0, stor0.field_8) = 0
Mask(248, 0, stor5.field_8) = Mask(248, 0, caller)
Mask(248, 0, stor5.field_8) = Mask(248, 0, caller)
if ext_code.size(this.address):
if ext_code.size(this.address):
if uint8(stor0.field_0):
if uint8(stor0.field_0):
revert with 0,
revert with 0,
32,
32,
46,
46,
0xfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65,
0xfe496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a65,
mem[ceil32(_param4.length) + ceil32(_param5.length) + 274 len 18]
mem[ceil32(_param4.length) + ceil32(_param5.length) + 274 len 18]
if not uint8(stor0.field_8):
if not uint8(stor0.field_8):
uint8(stor0.field_0) = 1
uint8(stor0.field_0) = 1
uint8(stor0.field_8) = 1
uint8(stor0.field_8) = 1
Mask(248, 0, stor0.field_8) = 0
Mask(248, 0, stor0.field_8) = 0
if adminAddress != caller:
if adminAddress != caller:
revert with 0, 'E1'
revert with 0, 'E1'
if accrualBlockNumber:
if accrualBlockNumber:
revert with 0, 'E2'
revert with 0, 'E2'
if borrowIndex:
if borrowIndex:
revert with 0, 'E2'
revert with 0, 'E2'
stor12 = _param3
stor12 = _param3
if not _param3:
if not _param3:
revert with 0, 'E3'
revert with 0, 'E3'
controllerAddress = _param1
controllerAddress = _param1
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex = 10^18
borrowIndex = 10^18
if adminAddress != caller:
if adminAddress != caller:
revert with 0, 'E1'
revert with 0, 'E1'
if accrualBlockNumber != block.number:
if accrualBlockNumber != block.number:
revert with 0, 'E7'
revert with 0, 'E7'
require ext_code.size(_param2)
require ext_code.size(_param2)
static call _param2.isInterestRateModel() with:
static call _param2.isInterestRateModel() with:
gas gas_remaining wei
gas gas_remaining wei
if not ext_call.success:
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
require return_data.size >= 32
if not ext_call.return_data[0]:
if not ext_call.return_data[0]:
revert with 0, 'E45'
revert with 0, 'E45'
interestRateModelAddress = _param2
interestRateModelAddress = _param2
name[] = Array(len=_param4.length, data=_param4[all])
name[] = Array(len=_param4.length, data=_param4[all])
symbol[] = Array(len=_param5.length, data=_param5[all])
symbol[] = Array(len=_param5.length, data=_param5[all])
unknownd90a730e = _param6
unknownd90a730e = _param6
decimals = _param7
decimals = _param7
uint8(stor0.field_16) = 1
uint8(stor0.field_16) = 1
if not uint8(stor0.field_8):
if not uint8(stor0.field_8):
uint8(stor0.field_8) = 0
uint8(stor0.field_8) = 0
uint8(stor0.field_8) = 0
uint8(stor0.field_8) = 0


def getAccountSnapshot(address _param1): # not payable
def getAccountSnapshot(address _param1): # not payable
require calldata.size - 4 >= 32
require calldata.size - 4 >= 32
if not stor17[addr(_param1)].field_0:
if not stor17[addr(_param1)].field_0:
if not totalSupply:
if not totalSupply:
return 0, balanceOf[addr(_param1)], 0, stor12
return 0, balanceOf[addr(_param1)], 0, stor12
require call.value <= eth.balance(this.address)
require call.value <= eth.balance(this.address)
if totalBorrows >= 0:
if totalBorrows >= 0:
if totalReserves <= totalBorrows + eth.balance(this.address) - call.value:
if totalReserves <= totalBorrows + eth.balance(this.address) - call.value:
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if totalSupply:
if totalSupply:
return 0, balanceOf[addr(_param1)], 0, 0 / totalSupply
return 0, balanceOf[addr(_param1)], 0, 0 / totalSupply
else:
else:
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves == 10^18:
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves == 10^18:
if totalSupply:
if totalSupply:
return 0,
return 0,
balanceOf[addr(_param1)],
balanceOf[addr(_param1)],
0,
0,
(10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply
(10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply
else:
else:
if borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_0 == borrowIndex:
if borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_0 == borrowIndex:
if stor17[addr(_param1)].field_256:
if stor17[addr(_param1)].field_256:
if not totalSupply:
if not totalSupply:
return 0, balanceOf[addr(_param1)], borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256, stor12
return 0, balanceOf[addr(_param1)], borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256, stor12
require call.value <= eth.balance(this.address)
require call.value <= eth.balance(this.address)
if totalBorrows >= 0:
if totalBorrows >= 0:
if totalReserves <= totalBorrows + eth.balance(this.address) - call.value:
if totalReserves <= totalBorrows + eth.balance(this.address) - call.value:
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if totalSupply:
if totalSupply:
return 0,
return 0,
balanceOf[addr(_param1)],
balanceOf[addr(_param1)],
borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256,
borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256,
0 / totalSupply
0 / totalSupply
else:
else:
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves == 10^18:
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves == 10^18:
if totalSupply:
if totalSupply:
return 0,
return 0,
balanceOf[addr(_param1)],
balanceOf[addr(_param1)],
borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256,
borrowIndex * stor17[addr(_param1)].field_0 / stor17[addr(_param1)].field_256,
(10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply
(10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply
return 9, 0, 0, 0
return 9, 0, 0, 0


def seize(address _param1, address _param2, uint256 _param3): # not payable
require calldata.size - 4 >= 96
if not uint8(stor0.field_16):
revert with 0, 'E67'
uint8(stor0.field_16) = 0
require ext_code.size(controllerAddress)
call controllerAddress.0xeafe967b with:
gas gas_remaining wei
args 0, uint32(this.address), caller, addr(_param1), _param2
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
if ext_call.return_data[0]:
revert with 0, 'E57'
if _param2 == _param1:
revert with 0, 'E50'
if _param3 > balanceOf[addr(_param2)]:
revert with 0, 'E58'
if _param3 + balanceOf[addr(_param1)] < balanceOf[addr(_param1)]:
revert with 0, 'E59'
balanceOf[addr(_param2)] -= _param3
balanceOf[_param1] = _param3 + balanceOf[addr(_param1)]
if not totalSupply:
if not stor12:
if (0 / 10^18) + unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
unknown4dc3487d[addr(_param1)] += 0 / 10^18
else:
if _param3 * stor12 / stor12 != _param3:
if unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
else:
if (_param3 * stor12 / 10^18) + unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
unknown4dc3487d[addr(_param1)] += _param3 * stor12 / 10^18
else:
require call.value <= eth.balance(this.address)
if totalBorrows < 0:
revert with 0, 'E35'
if totalReserves > totalBorrows + eth.balance(this.address) - call.value:
revert with 0, 'E35'
if not totalBorrows + eth.balance(this.address) - call.value - totalReserves:
if not totalSupply:
revert with 0, 'E35'
if not 0 / totalSupply:
if (0 / 10^18) + unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
unknown4dc3487d[addr(_param1)] += 0 / 10^18
else:
if _param3 * 0 / totalSupply / 0 / totalSupply != _param3:
if unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
else:
if (_param3 * 0 / totalSupply / 10^18) + unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
unknown4dc3487d[addr(_param1)] += _param3 * 0 / totalSupply / 10^18
else:
if (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalBorrows + eth.balance(this.address) - call.value - totalReserves != 10^18:
revert with 0, 'E35'
if not totalSupply:
revert with 0, 'E35'
if not (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply:
if (0 / 10^18) + unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
unknown4dc3487d[addr(_param1)] += 0 / 10^18
else:
if _param3 * (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply / (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply != _param3:
if unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
else:
if (_param3 * (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply / 10^18) + unknown4dc3487d[addr(_param1)] < unknown4dc3487d[addr(_param1)]:
revert with 0, 'E16'
unknown4dc3487d[addr(_param1)] += _param3 * (10^18 * totalBorrows) + (10^18 * eth.balance(this.address)) - (10^18 * call.value) - (10^18 * totalReserves) / totalSupply / 10^18
log 0x64ddf252: _param3, _param2, _param1
uint8(stor0.field_16) = 1
return 0

def accrueInterest(): # not payable
def accrueInterest(): # not payable
if accrualBlockNumber != block.number:
if accrualBlockNumber != block.number:
require call.value <= eth.balance(this.address)
require call.value <= eth.balance(this.address)
require ext_code.size(interestRateModelAddress)
require ext_code.size(interestRateModelAddress)
static call interestRateModelAddress.getBorrowRate(uint256 param1, uint256 param2, uint256 param3) with:
static call interestRateModelAddress.getBorrowRate(uint256 param1, uint256 param2, uint256 param3) with:
gas gas_remaining wei
gas gas_remaining wei
args eth.balance(this.address) - call.value, totalBorrows, totalReserves
args eth.balance(this.address) - call.value, totalBorrows, totalReserves
if not ext_call.success:
if not ext_call.success:
revert with ext_call.return_data[0 len return_data.size]
revert with ext_call.return_data[0 len return_data.size]
require return_data.size >= 32
require return_data.size >= 32
if ext_call.return_data[0] > 5 * 10^12:
if ext_call.return_data[0] > 5 * 10^12:
revert with 0, 'E60'
revert with 0, 'E60'
if accrualBlockNumber > block.number:
if accrualBlockNumber > block.number:
revert with 0, 'E61'
revert with 0, 'E61'
if not ext_call.return_data[0]:
if not ext_call.return_data[0]:
if totalBorrows + (0 / 10^18) < 0 / 10^18:
if totalBorrows + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E64'
revert with 0, 'E64'
if not reserveFactorMantissa:
if not reserveFactorMantissa:
if totalReserves + (0 / 10^18) < 0 / 10^18:
if totalReserves + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E65'
revert with 0, 'E65'
if borrowIndex + (0 / 10^18) < 0 / 10^18:
if borrowIndex + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E66'
revert with 0, 'E66'
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex += 0 / 10^18
borrowIndex += 0 / 10^18
totalBorrows += 0 / 10^18
totalBorrows += 0 / 10^18
totalReserves += 0 / 10^18
totalReserves += 0 / 10^18
else:
else:
if 0 / 10^18 * reserveFactorMantissa / reserveFactorMantissa != 0 / 10^18:
if 0 / 10^18 * reserveFactorMantissa / reserveFactorMantissa != 0 / 10^18:
revert with 0, 'E65'
revert with 0, 'E65'
if totalReserves + (0 / 10^18 * reserveFactorMantissa / 10^18) < 0 / 10^18 * reserveFactorMantissa / 10^18:
if totalReserves + (0 / 10^18 * reserveFactorMantissa / 10^18) < 0 / 10^18 * reserveFactorMantissa / 10^18:
revert with 0, 'E65'
revert with 0, 'E65'
if borrowIndex + (0 / 10^18) < 0 / 10^18:
if borrowIndex + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E66'
revert with 0, 'E66'
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex += 0 / 10^18
borrowIndex += 0 / 10^18
totalBorrows += 0 / 10^18
totalBorrows += 0 / 10^18
totalReserves += 0 / 10^18 * reserveFactorMantissa / 10^18
totalReserves += 0 / 10^18 * reserveFactorMantissa / 10^18
else:
else:
if (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) / ext_call.return_data[0] != block.number - accrualBlockNumber:
if (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) / ext_call.return_data[0] != block.number - accrualBlockNumber:
revert with 0, 'E62'
revert with 0, 'E62'
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if totalBorrows + (0 / 10^18) < 0 / 10^18:
if totalBorrows + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E64'
revert with 0, 'E64'
if not reserveFactorMantissa:
if not reserveFactorMantissa:
if totalReserves + (0 / 10^18) < 0 / 10^18:
if totalReserves + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E65'
revert with 0, 'E65'
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if borrowIndex + (0 / 10^18) < 0 / 10^18:
if borrowIndex + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E66'
revert with 0, 'E66'
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex += 0 / 10^18
borrowIndex += 0 / 10^18
else:
else:
if (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != borrowIndex:
if (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != borrowIndex:
revert with 0, 'E66'
revert with 0, 'E66'
if borrowIndex + ((block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18) < (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18:
if borrowIndex + ((block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18) < (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18:
revert with 0, 'E66'
revert with 0, 'E66'
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex += (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18
borrowIndex += (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18
totalBorrows += 0 / 10^18
totalBorrows += 0 / 10^18
totalReserves += 0 / 10^18
totalReserves += 0 / 10^18
else:
else:
if 0 / 10^18 * reserveFactorMantissa / reserveFactorMantissa != 0 / 10^18:
if 0 / 10^18 * reserveFactorMantissa / reserveFactorMantissa != 0 / 10^18:
revert with 0, 'E65'
revert with 0, 'E65'
if totalReserves + (0 / 10^18 * reserveFactorMantissa / 10^18) < 0 / 10^18 * reserveFactorMantissa / 10^18:
if totalReserves + (0 / 10^18 * reserveFactorMantissa / 10^18) < 0 / 10^18 * reserveFactorMantissa / 10^18:
revert with 0, 'E65'
revert with 0, 'E65'
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if borrowIndex + (0 / 10^18) < 0 / 10^18:
if borrowIndex + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E66'
revert with 0, 'E66'
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex += 0 / 10^18
borrowIndex += 0 / 10^18
else:
else:
if (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != borrowIndex:
if (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != borrowIndex:
revert with 0, 'E66'
revert with 0, 'E66'
if borrowIndex + ((block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18) < (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18:
if borrowIndex + ((block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18) < (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18:
revert with 0, 'E66'
revert with 0, 'E66'
accrualBlockNumber = block.number
accrualBlockNumber = block.number
borrowIndex += (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18
borrowIndex += (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18
totalBorrows += 0 / 10^18
totalBorrows += 0 / 10^18
totalReserves += 0 / 10^18 * reserveFactorMantissa / 10^18
totalReserves += 0 / 10^18 * reserveFactorMantissa / 10^18
else:
else:
if (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != totalBorrows:
if (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != totalBorrows:
revert with 0, 'E63'
revert with 0, 'E63'
if totalBorrows + ((block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18) < (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18:
if totalBorrows + ((block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18) < (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18:
revert with 0, 'E64'
revert with 0, 'E64'
if not reserveFactorMantissa:
if not reserveFactorMan
if totalReserves + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E65'
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if borrowIndex + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E66'
accrualBlockNumber = block.number
borrowIndex += 0 / 10^18
else:
if (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != borrowIndex:
revert with 0, 'E66'
if borrowIndex + ((block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18) < (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18:
revert with 0, 'E66'
accrualBlockNumber = block.number
borrowIndex += (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18
totalBorrows += (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18
totalReserves += 0 / 10^18
else:
if (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18 * reserveFactorMantissa / reserveFactorMantissa != (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18:
revert with 0, 'E65'
if totalReserves + ((block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18 * reserveFactorMantissa / 10^18) < (block.number * ext_call.return_data[0] * totalBorrows) - (accrualBlockNumber * ext_call.return_data[0] * totalBorrows) / 10^18 * reserveFactorMantissa / 10^18:
revert with 0, 'E65'
if not (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]):
if borrowIndex + (0 / 10^18) < 0 / 10^18:
revert with 0, 'E66'
accrualBlockNumber = block.number
borrowIndex += 0 / 10^18
else:
if (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / (block.number * ext_call.return_data[0]) - (accrualBlockNumber * ext_call.return_data[0]) != borrowIndex:
revert with 0, 'E66'
if borrowIndex + ((block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18) < (block.number * ext_call.return_data[0] * borrowIndex) - (accrualBlockNumber * ext_call.return_data[0] * borrowIndex) / 10^18:
revert with 0, '