Skip to content

Instantly share code, notes, and snippets.

@BlinkyStitt
Created February 7, 2019 20:47
Show Gist options
  • Save BlinkyStitt/8b481e829796f2b01318f750400c6127 to your computer and use it in GitHub Desktop.
Save BlinkyStitt/8b481e829796f2b01318f750400c6127 to your computer and use it in GitHub Desktop.
This crashses ganache 2
{
"contractName": "Bank",
"abi": [
{
"constant": false,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "addWhitelisted",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x10154bad"
},
{
"constant": false,
"inputs": [
{
"name": "_max_borrow",
"type": "uint256"
}
],
"name": "setMaxBorrow",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x1d54164b"
},
{
"constant": false,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "removeWhitelisted",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x291d9549"
},
{
"constant": true,
"inputs": [],
"name": "max_borrow",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x37963340"
},
{
"constant": true,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "isWhitelisted",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x3af32abf"
},
{
"constant": false,
"inputs": [],
"name": "unpause",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x3f4ba83a"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
}
],
"name": "borrowAllowed",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x46b119a4"
},
{
"constant": true,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "isPauser",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x46fbf68e"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "borrow",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x4b8a3529"
},
{
"constant": false,
"inputs": [],
"name": "renounceWhitelistAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x4c5a628c"
},
{
"constant": true,
"inputs": [],
"name": "paused",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x5c975abb"
},
{
"constant": false,
"inputs": [],
"name": "renouncePauser",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x6ef8d66d"
},
{
"constant": false,
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x715018a6"
},
{
"constant": false,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "addWhitelistAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x7362d9c8"
},
{
"constant": false,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "addPauser",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x82dc1ec4"
},
{
"constant": true,
"inputs": [],
"name": "ETH",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x8322fff2"
},
{
"constant": false,
"inputs": [],
"name": "pause",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0x8456cb59"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x8da5cb5b"
},
{
"constant": true,
"inputs": [],
"name": "isOwner",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0x8f32d59b"
},
{
"constant": true,
"inputs": [
{
"name": "account",
"type": "address"
}
],
"name": "isWhitelistAdmin",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0xbb5f747b"
},
{
"constant": true,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "who",
"type": "address"
}
],
"name": "allowedSupplyOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0xd1364652"
},
{
"constant": false,
"inputs": [],
"name": "renounceWhitelisted",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0xd6cd9473"
},
{
"constant": true,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "who",
"type": "address"
}
],
"name": "totalSupplyOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function",
"signature": "0xe50eaf0d"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0xf2fde38b"
},
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
},
{
"name": "amount",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function",
"signature": "0xf3fef3a3"
},
{
"inputs": [
{
"name": "_max_borrow",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor",
"signature": "constructor"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "max_borrow",
"type": "uint256"
}
],
"name": "MaxBorrowSet",
"type": "event",
"signature": "0xc69c807b2f85677d60cdd89ac10a854ee2d8808b612abd731b93e129dd2e67a1"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_token",
"type": "address"
},
{
"indexed": true,
"name": "_from",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "DepositEvent",
"type": "event",
"signature": "0x01bee1bfa4116bd0440a1108ef6cb6a2f6eb9b611d8f53260aec20d39e84ee88"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_token",
"type": "address"
},
{
"indexed": true,
"name": "_to",
"type": "address"
},
{
"indexed": false,
"name": "_value",
"type": "uint256"
}
],
"name": "WithdrawEvent",
"type": "event",
"signature": "0x93cb7b4ba12c5bb07f02e52c4e43788d8f4db1e66e9d30aaaeffc5ab325b810c"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "account",
"type": "address"
}
],
"name": "WhitelistedAdded",
"type": "event",
"signature": "0xee1504a83b6d4a361f4c1dc78ab59bfa30d6a3b6612c403e86bb01ef2984295f"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "account",
"type": "address"
}
],
"name": "WhitelistedRemoved",
"type": "event",
"signature": "0x270d9b30cf5b0793bbfd54c9d5b94aeb49462b8148399000265144a8722da6b6"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "account",
"type": "address"
}
],
"name": "WhitelistAdminAdded",
"type": "event",
"signature": "0x22380c05984257a1cb900161c713dd71d39e74820f1aea43bd3f1bdd20961299"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "account",
"type": "address"
}
],
"name": "WhitelistAdminRemoved",
"type": "event",
"signature": "0x0a8eb35e5ca14b3d6f28e4abf2f128dbab231a58b56e89beb5d636115001e165"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "account",
"type": "address"
}
],
"name": "Paused",
"type": "event",
"signature": "0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "account",
"type": "address"
}
],
"name": "Unpaused",
"type": "event",
"signature": "0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "account",
"type": "address"
}
],
"name": "PauserAdded",
"type": "event",
"signature": "0x6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f8"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "account",
"type": "address"
}
],
"name": "PauserRemoved",
"type": "event",
"signature": "0xcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event",
"signature": "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0"
}
],
"bytecode": "0x60806040523480156200001157600080fd5b5060405160208062001323833981018060405260208110156200003357600080fd5b505160008054600160a060020a0319163317808255604051600160a060020a039190911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a36200009233640100000000620000cb810204565b6002805460ff19169055620000b0336401000000006200011d810204565b620000c4816401000000006200016f810204565b506200023d565b620000e660018264010000000062000ead620001aa82021704565b604051600160a060020a038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6200013860038264010000000062000ead620001aa82021704565b604051600160a060020a038216907f22380c05984257a1cb900161c713dd71d39e74820f1aea43bd3f1bdd2096129990600090a250565b60058190556040805182815290517fc69c807b2f85677d60cdd89ac10a854ee2d8808b612abd731b93e129dd2e67a19181900360200190a150565b600160a060020a0381161515620001c057600080fd5b620001d5828264010000000062000205810204565b15620001e057600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b6000600160a060020a03821615156200021d57600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6110d6806200024d6000396000f3fe60806040526004361061016a5760003560e060020a90048063715018a6116100d55780638f32d59b1161008e578063d6cd947311610068578063d6cd9473146104f0578063e50eaf0d14610505578063f2fde38b14610540578063f3fef3a3146105735761016a565b80638f32d59b1461046d578063bb5f747b14610482578063d1364652146104b55761016a565b8063715018a6146103975780637362d9c8146103ac57806382dc1ec4146103df5780638322fff2146104125780638456cb59146104435780638da5cb5b146104585761016a565b806346b119a41161012757806346b119a4146102b957806346fbf68e146102ec5780634b8a35291461031f5780634c5a628c146103585780635c975abb1461036d5780636ef8d66d146103825761016a565b806310154bad146101a45780631d54164b146101d9578063291d95491461020357806337963340146102365780633af32abf1461025d5780633f4ba83a146102a4575b60408051348152905133916000917f01bee1bfa4116bd0440a1108ef6cb6a2f6eb9b611d8f53260aec20d39e84ee889181900360200190a3005b3480156101b057600080fd5b506101d7600480360360208110156101c757600080fd5b5035600160a060020a03166105ac565b005b3480156101e557600080fd5b506101d7600480360360208110156101fc57600080fd5b50356105cc565b34801561020f57600080fd5b506101d76004803603602081101561022657600080fd5b5035600160a060020a03166105e9565b34801561024257600080fd5b5061024b610606565b60408051918252519081900360200190f35b34801561026957600080fd5b506102906004803603602081101561028057600080fd5b5035600160a060020a031661060c565b604080519115158252519081900360200190f35b3480156102b057600080fd5b506101d7610625565b3480156102c557600080fd5b506101d7600480360360208110156102dc57600080fd5b5035600160a060020a0316610689565b3480156102f857600080fd5b506102906004803603602081101561030f57600080fd5b5035600160a060020a031661071e565b34801561032b57600080fd5b506101d76004803603604081101561034257600080fd5b50600160a060020a038135169060200135610731565b34801561036457600080fd5b506101d76107c1565b34801561037957600080fd5b506102906107cc565b34801561038e57600080fd5b506101d76107d5565b3480156103a357600080fd5b506101d76107de565b3480156103b857600080fd5b506101d7600480360360208110156103cf57600080fd5b5035600160a060020a0316610848565b3480156103eb57600080fd5b506101d76004803603602081101561040257600080fd5b5035600160a060020a0316610865565b34801561041e57600080fd5b50610427610882565b60408051600160a060020a039092168252519081900360200190f35b34801561044f57600080fd5b506101d7610887565b34801561046457600080fd5b506104276108ed565b34801561047957600080fd5b506102906108fc565b34801561048e57600080fd5b50610290600480360360208110156104a557600080fd5b5035600160a060020a031661090d565b3480156104c157600080fd5b5061024b600480360360408110156104d857600080fd5b50600160a060020a0381358116916020013516610920565b3480156104fc57600080fd5b506101d76109df565b34801561051157600080fd5b5061024b6004803603604081101561052857600080fd5b50600160a060020a03813581169160200135166109e8565b34801561054c57600080fd5b506101d76004803603602081101561056357600080fd5b5035600160a060020a0316610a97565b34801561057f57600080fd5b506101d76004803603604081101561059657600080fd5b50600160a060020a038135169060200135610ab3565b6105b53361090d565b15156105c057600080fd5b6105c981610b17565b50565b6105d53361090d565b15156105e057600080fd5b6105c981610b5f565b6105f23361090d565b15156105fd57600080fd5b6105c981610b9a565b60055481565b600061061f60048363ffffffff610be216565b92915050565b61062e3361071e565b151561063957600080fd5b60025460ff16151561064a57600080fd5b6002805460ff191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b6106923361060c565b151561069d57600080fd5b6106b181336106ac8430610920565b610c19565b15156105c957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f424f52524f575f414c4c4f5745445f4641494c45440000000000000000000000604482015290519081900360640190fd5b600061061f60018363ffffffff610be216565b61073a3361060c565b151561074557600080fd5b610750823383610c19565b15156107bd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f424f52524f575f4641494c454400000000000000000000000000000000000000604482015290519081900360640190fd5b5050565b6107ca33610cf8565b565b60025460ff1690565b6107ca33610d40565b6107e66108fc565b15156107f157600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6108513361090d565b151561085c57600080fd5b6105c981610d88565b61086e3361071e565b151561087957600080fd5b6105c981610dd0565b600081565b6108903361071e565b151561089b57600080fd5b60025460ff16156108ab57600080fd5b6002805460ff191660011790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b600054600160a060020a031690565b600054600160a060020a0316331490565b600061061f60038363ffffffff610be216565b6000600160a060020a038316151561094f5761094882600160a060020a031631600554610e18565b905061061f565b61094883600160a060020a03166370a08231846040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060206040518083038186803b1580156109ab57600080fd5b505afa1580156109bf573d6000803e3d6000fd5b505050506040513d60208110156109d557600080fd5b5051600554610e18565b6107ca33610b9a565b6000600160a060020a0383161515610a0b5750600160a060020a0381163161061f565b82600160a060020a03166370a08231836040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060206040518083038186803b158015610a6457600080fd5b505afa158015610a78573d6000803e3d6000fd5b505050506040513d6020811015610a8e57600080fd5b5051905061061f565b610a9f6108fc565b1515610aaa57600080fd5b6105c981610e30565b610abc3361090d565b1515610ac757600080fd5b610ad2823383610c19565b506040805182815290513391600160a060020a038516917f93cb7b4ba12c5bb07f02e52c4e43788d8f4db1e66e9d30aaaeffc5ab325b810c9181900360200190a35050565b610b2860048263ffffffff610ead16565b604051600160a060020a038216907fee1504a83b6d4a361f4c1dc78ab59bfa30d6a3b6612c403e86bb01ef2984295f90600090a250565b60058190556040805182815290517fc69c807b2f85677d60cdd89ac10a854ee2d8808b612abd731b93e129dd2e67a19181900360200190a150565b610bab60048263ffffffff610efb16565b604051600160a060020a038216907f270d9b30cf5b0793bbfd54c9d5b94aeb49462b8148399000265144a8722da6b690600090a250565b6000600160a060020a0382161515610bf957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6000600160a060020a0384161515610c6757604051600160a060020a0384169083156108fc029084906000818181858888f19350505050158015610c61573d6000803e3d6000fd5b50610cee565b610c81600160a060020a038516848463ffffffff610f4716565b1515610cee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c45440000000000000000000000000000000000604482015290519081900360640190fd5b5060019392505050565b610d0960038263ffffffff610efb16565b604051600160a060020a038216907f0a8eb35e5ca14b3d6f28e4abf2f128dbab231a58b56e89beb5d636115001e16590600090a250565b610d5160018263ffffffff610efb16565b604051600160a060020a038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b610d9960038263ffffffff610ead16565b604051600160a060020a038216907f22380c05984257a1cb900161c713dd71d39e74820f1aea43bd3f1bdd2096129990600090a250565b610de160018263ffffffff610ead16565b604051600160a060020a038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6000818310610e275781610e29565b825b9392505050565b600160a060020a0381161515610e4557600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0381161515610ec257600080fd5b610ecc8282610be2565b15610ed657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a0381161515610f1057600080fd5b610f1a8282610be2565b1515610f2557600080fd5b600160a060020a0316600090815260209190915260409020805460ff19169055565b60408051600160a060020a038085166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017815292518251600094928816928492918291908083835b60208310610ff05780518252601f199092019160209182019101610fd1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611052576040519150601f19603f3d011682016040523d82523d6000602084013e611057565b606091505b5050809250506110668261106f565b95945050505050565b600081156110a6573d801561108f576020811461109857600092506110a4565b600192506110a4565b60206000803e60005192505b505b509056fea165627a7a72305820858eaf6766a31058f1b3af06f8ca315948210c03d0aeebe0253a90ccd05f22760029",
"deployedBytecode": "0x60806040526004361061016a5760003560e060020a90048063715018a6116100d55780638f32d59b1161008e578063d6cd947311610068578063d6cd9473146104f0578063e50eaf0d14610505578063f2fde38b14610540578063f3fef3a3146105735761016a565b80638f32d59b1461046d578063bb5f747b14610482578063d1364652146104b55761016a565b8063715018a6146103975780637362d9c8146103ac57806382dc1ec4146103df5780638322fff2146104125780638456cb59146104435780638da5cb5b146104585761016a565b806346b119a41161012757806346b119a4146102b957806346fbf68e146102ec5780634b8a35291461031f5780634c5a628c146103585780635c975abb1461036d5780636ef8d66d146103825761016a565b806310154bad146101a45780631d54164b146101d9578063291d95491461020357806337963340146102365780633af32abf1461025d5780633f4ba83a146102a4575b60408051348152905133916000917f01bee1bfa4116bd0440a1108ef6cb6a2f6eb9b611d8f53260aec20d39e84ee889181900360200190a3005b3480156101b057600080fd5b506101d7600480360360208110156101c757600080fd5b5035600160a060020a03166105ac565b005b3480156101e557600080fd5b506101d7600480360360208110156101fc57600080fd5b50356105cc565b34801561020f57600080fd5b506101d76004803603602081101561022657600080fd5b5035600160a060020a03166105e9565b34801561024257600080fd5b5061024b610606565b60408051918252519081900360200190f35b34801561026957600080fd5b506102906004803603602081101561028057600080fd5b5035600160a060020a031661060c565b604080519115158252519081900360200190f35b3480156102b057600080fd5b506101d7610625565b3480156102c557600080fd5b506101d7600480360360208110156102dc57600080fd5b5035600160a060020a0316610689565b3480156102f857600080fd5b506102906004803603602081101561030f57600080fd5b5035600160a060020a031661071e565b34801561032b57600080fd5b506101d76004803603604081101561034257600080fd5b50600160a060020a038135169060200135610731565b34801561036457600080fd5b506101d76107c1565b34801561037957600080fd5b506102906107cc565b34801561038e57600080fd5b506101d76107d5565b3480156103a357600080fd5b506101d76107de565b3480156103b857600080fd5b506101d7600480360360208110156103cf57600080fd5b5035600160a060020a0316610848565b3480156103eb57600080fd5b506101d76004803603602081101561040257600080fd5b5035600160a060020a0316610865565b34801561041e57600080fd5b50610427610882565b60408051600160a060020a039092168252519081900360200190f35b34801561044f57600080fd5b506101d7610887565b34801561046457600080fd5b506104276108ed565b34801561047957600080fd5b506102906108fc565b34801561048e57600080fd5b50610290600480360360208110156104a557600080fd5b5035600160a060020a031661090d565b3480156104c157600080fd5b5061024b600480360360408110156104d857600080fd5b50600160a060020a0381358116916020013516610920565b3480156104fc57600080fd5b506101d76109df565b34801561051157600080fd5b5061024b6004803603604081101561052857600080fd5b50600160a060020a03813581169160200135166109e8565b34801561054c57600080fd5b506101d76004803603602081101561056357600080fd5b5035600160a060020a0316610a97565b34801561057f57600080fd5b506101d76004803603604081101561059657600080fd5b50600160a060020a038135169060200135610ab3565b6105b53361090d565b15156105c057600080fd5b6105c981610b17565b50565b6105d53361090d565b15156105e057600080fd5b6105c981610b5f565b6105f23361090d565b15156105fd57600080fd5b6105c981610b9a565b60055481565b600061061f60048363ffffffff610be216565b92915050565b61062e3361071e565b151561063957600080fd5b60025460ff16151561064a57600080fd5b6002805460ff191690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b6106923361060c565b151561069d57600080fd5b6106b181336106ac8430610920565b610c19565b15156105c957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f424f52524f575f414c4c4f5745445f4641494c45440000000000000000000000604482015290519081900360640190fd5b600061061f60018363ffffffff610be216565b61073a3361060c565b151561074557600080fd5b610750823383610c19565b15156107bd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600d60248201527f424f52524f575f4641494c454400000000000000000000000000000000000000604482015290519081900360640190fd5b5050565b6107ca33610cf8565b565b60025460ff1690565b6107ca33610d40565b6107e66108fc565b15156107f157600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6108513361090d565b151561085c57600080fd5b6105c981610d88565b61086e3361071e565b151561087957600080fd5b6105c981610dd0565b600081565b6108903361071e565b151561089b57600080fd5b60025460ff16156108ab57600080fd5b6002805460ff191660011790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b600054600160a060020a031690565b600054600160a060020a0316331490565b600061061f60038363ffffffff610be216565b6000600160a060020a038316151561094f5761094882600160a060020a031631600554610e18565b905061061f565b61094883600160a060020a03166370a08231846040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060206040518083038186803b1580156109ab57600080fd5b505afa1580156109bf573d6000803e3d6000fd5b505050506040513d60208110156109d557600080fd5b5051600554610e18565b6107ca33610b9a565b6000600160a060020a0383161515610a0b5750600160a060020a0381163161061f565b82600160a060020a03166370a08231836040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a0316815260200191505060206040518083038186803b158015610a6457600080fd5b505afa158015610a78573d6000803e3d6000fd5b505050506040513d6020811015610a8e57600080fd5b5051905061061f565b610a9f6108fc565b1515610aaa57600080fd5b6105c981610e30565b610abc3361090d565b1515610ac757600080fd5b610ad2823383610c19565b506040805182815290513391600160a060020a038516917f93cb7b4ba12c5bb07f02e52c4e43788d8f4db1e66e9d30aaaeffc5ab325b810c9181900360200190a35050565b610b2860048263ffffffff610ead16565b604051600160a060020a038216907fee1504a83b6d4a361f4c1dc78ab59bfa30d6a3b6612c403e86bb01ef2984295f90600090a250565b60058190556040805182815290517fc69c807b2f85677d60cdd89ac10a854ee2d8808b612abd731b93e129dd2e67a19181900360200190a150565b610bab60048263ffffffff610efb16565b604051600160a060020a038216907f270d9b30cf5b0793bbfd54c9d5b94aeb49462b8148399000265144a8722da6b690600090a250565b6000600160a060020a0382161515610bf957600080fd5b50600160a060020a03166000908152602091909152604090205460ff1690565b6000600160a060020a0384161515610c6757604051600160a060020a0384169083156108fc029084906000818181858888f19350505050158015610c61573d6000803e3d6000fd5b50610cee565b610c81600160a060020a038516848463ffffffff610f4716565b1515610cee57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c45440000000000000000000000000000000000604482015290519081900360640190fd5b5060019392505050565b610d0960038263ffffffff610efb16565b604051600160a060020a038216907f0a8eb35e5ca14b3d6f28e4abf2f128dbab231a58b56e89beb5d636115001e16590600090a250565b610d5160018263ffffffff610efb16565b604051600160a060020a038216907fcd265ebaf09df2871cc7bd4133404a235ba12eff2041bb89d9c714a2621c7c7e90600090a250565b610d9960038263ffffffff610ead16565b604051600160a060020a038216907f22380c05984257a1cb900161c713dd71d39e74820f1aea43bd3f1bdd2096129990600090a250565b610de160018263ffffffff610ead16565b604051600160a060020a038216907f6719d08c1888103bea251a4ed56406bd0c3e69723c8a1686e017e7bbe159b6f890600090a250565b6000818310610e275781610e29565b825b9392505050565b600160a060020a0381161515610e4557600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0381161515610ec257600080fd5b610ecc8282610be2565b15610ed657600080fd5b600160a060020a0316600090815260209190915260409020805460ff19166001179055565b600160a060020a0381161515610f1057600080fd5b610f1a8282610be2565b1515610f2557600080fd5b600160a060020a0316600090815260209190915260409020805460ff19169055565b60408051600160a060020a038085166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb0000000000000000000000000000000000000000000000000000000017815292518251600094928816928492918291908083835b60208310610ff05780518252601f199092019160209182019101610fd1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611052576040519150601f19603f3d011682016040523d82523d6000602084013e611057565b606091505b5050809250506110668261106f565b95945050505050565b600081156110a6573d801561108f576020811461109857600092506110a4565b600192506110a4565b60206000803e60005192505b505b509056fea165627a7a72305820858eaf6766a31058f1b3af06f8ca315948210c03d0aeebe0253a90ccd05f22760029",
"sourceMap": "1446:3186:0:-;;;1957:138;8:9:-1;5:2;;;30:1;27;20:12;5:2;1957:138:0;;;;;;;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1957:138:0;515:6:16;:19;;-1:-1:-1;;;;;;515:19:16;524:10;515:19;;;;549:40;;-1:-1:-1;;;;;582:6:16;;;;;515;549:40;;515:6;;549:40;275:22:10;286:10;275;;;;:22;:::i;:::-;352:7:13;:15;;-1:-1:-1;;352:15:13;;;433:30:11;452:10;433:18;;;;:30;:::i;:::-;2062:26:0;2076:11;2062:13;;;;:26;:::i;:::-;1957:138;1446:3186;;685:119:10;741:21;:8;754:7;741:12;;;;;;:21;:::i;:::-;777:20;;-1:-1:-1;;;;;777:20:10;;;;;;;;685:119;:::o;923:143:11:-;987:29;:16;1008:7;987:20;;;;;;:29;:::i;:::-;1031:28;;-1:-1:-1;;;;;1031:28:11;;;;;;;;923:143;:::o;4440:190:0:-;4560:10;:24;;;4599;;;;;;;;;;;;;;;;;4440:190;:::o;259:181:9:-;-1:-1:-1;;;;;335:21:9;;;;327:30;;;;;;376:18;380:4;386:7;376:3;;;;:18;:::i;:::-;375:19;367:28;;;;;;-1:-1:-1;;;;;406:20:9;:11;:20;;;;;;;;;;;:27;;-1:-1:-1;;406:27:9;429:4;406:27;;;259:181::o;786:162::-;858:4;-1:-1:-1;;;;;882:21:9;;;;874:30;;;;;;-1:-1:-1;;;;;;921:20:9;:11;:20;;;;;;;;;;;;;;;786:162::o;1446:3186:0:-;;;;;;;",
"deployedSourceMap": "1446:3186:0:-;;;;;;;;;;-1:-1:-1;;;1446:3186:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2390:40;;;2420:9;2390:40;;;;2408:10;;87:3:2;;2390:40:0;;;;;;;;;1446:3186;848:108:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;848:108:12;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;848:108:12;-1:-1:-1;;;;;848:108:12;;:::i;:::-;;2443:114:0;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2443:114:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;2443:114:0;;:::i;962::12:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;962:114:12;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;962:114:12;-1:-1:-1;;;;;962:114:12;;:::i;1714:25:0:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1714:25:0;;;:::i;:::-;;;;;;;;;;;;;;;;725:117:12;;8:9:-1;5:2;;;30:1;27;20:12;5:2;725:117:12;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;725:117:12;-1:-1:-1;;;;;725:117:12;;:::i;:::-;;;;;;;;;;;;;;;;;;1176:115:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1176:115:13;;;:::i;3517:182:0:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3517:182:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;3517:182:0;-1:-1:-1;;;;;3517:182:0;;:::i;395:107:10:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;395:107:10;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;395:107:10;-1:-1:-1;;;;;395:107:10;;:::i;3225:152:0:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3225:152:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3225:152:0;;;;;;;;:::i;826:91:11:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;826:91:11;;;:::i;460:76:13:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;460:76:13;;;:::i;604:75:10:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;604:75:10;;;:::i;1347:137:16:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1347:137:16;;;:::i;706:114:11:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;706:114:11;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;706:114:11;-1:-1:-1;;;;;706:114:11;;:::i;508:90:10:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;508:90:10;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;508:90:10;-1:-1:-1;;;;;508:90:10;;:::i;49:42:2:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;49:42:2;;;:::i;:::-;;;;-1:-1:-1;;;;;49:42:2;;;;;;;;;;;;;;973:113:13;;8:9:-1;5:2;;;30:1;27;20:12;5:2;973:113:13;;;:::i;659:77:16:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;659:77:16;;;:::i;979:90::-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;979:90:16;;;:::i;577:123:11:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;577:123:11;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;577:123:11;-1:-1:-1;;;;;577:123:11;;:::i;3858:576:0:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3858:576:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;3858:576:0;;;;;;;;;;:::i;1082:85:12:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1082:85:12;;;:::i;1363:232:3:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1363:232:3;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;1363:232:3;;;;;;;;;;:::i;1655:107:16:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1655:107:16;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1655:107:16;-1:-1:-1;;;;;1655:107:16;;:::i;2802:186:0:-;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2802:186:0;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;2802:186:0;;;;;;;;:::i;848:108:12:-;524:28:11;541:10;524:16;:28::i;:::-;516:37;;;;;;;;925:24:12;941:7;925:15;:24::i;:::-;848:108;:::o;2443:114:0:-;524:28:11;541:10;524:16;:28::i;:::-;516:37;;;;;;;;2524:26:0;2538:11;2524:13;:26::i;962:114:12:-;524:28:11;541:10;524:16;:28::i;:::-;516:37;;;;;;;;1042:27:12;1061:7;1042:18;:27::i;1714:25:0:-;;;;:::o;725:117:12:-;786:4;809:26;:13;827:7;809:26;:17;:26;:::i;:::-;802:33;725:117;-1:-1:-1;;725:117:12:o;1176:115:13:-;350:20:10;359:10;350:8;:20::i;:::-;342:29;;;;;;;;860:7:13;;;;852:16;;;;;;;;1234:7;:15;;-1:-1:-1;;1234:15:13;;;1264:20;;;1273:10;1264:20;;;;;;;;;;;;;1176:115::o;3517:182:0:-;675:25:12;689:10;675:13;:25::i;:::-;667:34;;;;;;;;3598:68:0;3609:5;3616:10;3628:37;3644:5;3659:4;3628:15;:37::i;:::-;3598:10;:68::i;:::-;3590:102;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;395:107:10;451:4;474:21;:8;487:7;474:21;:12;:21;:::i;3225:152:0:-;675:25:12;689:10;675:13;:25::i;:::-;667:34;;;;;;;;3315:37:0;3326:5;3333:10;3345:6;3315:10;:37::i;:::-;3307:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3225:152;;:::o;826:91:11:-;877:33;899:10;877:21;:33::i;:::-;826:91::o;460:76:13:-;522:7;;;;460:76;:::o;604:75:10:-;647:25;661:10;647:13;:25::i;1347:137:16:-;863:9;:7;:9::i;:::-;855:18;;;;;;;;1445:1;1429:6;;1408:40;;-1:-1:-1;;;;;1429:6:16;;;;1408:40;;1445:1;;1408:40;1475:1;1458:19;;-1:-1:-1;;1458:19:16;;;1347:137::o;706:114:11:-;524:28;541:10;524:16;:28::i;:::-;516:37;;;;;;;;786:27;805:7;786:18;:27::i;508:90:10:-;350:20;359:10;350:8;:20::i;:::-;342:29;;;;;;;;572:19;583:7;572:10;:19::i;49:42:2:-;87:3;49:42;:::o;973:113:13:-;350:20:10;359:10;350:8;:20::i;:::-;342:29;;;;;;;;689:7:13;;;;688:8;680:17;;;;;;1032:7;:14;;-1:-1:-1;;1032:14:13;1042:4;1032:14;;;1061:18;;;1068:10;1061:18;;;;;;;;;;;;;973:113::o;659:77:16:-;697:7;723:6;-1:-1:-1;;;;;723:6:16;659:77;:::o;979:90::-;1019:4;1056:6;-1:-1:-1;;;;;1056:6:16;1042:10;:20;;979:90::o;577:123:11:-;641:4;664:29;:16;685:7;664:29;:20;:29;:::i;3858:576:0:-;3932:15;-1:-1:-1;;;;;4060:12:0;;;4056:372;;;4095:33;4104:3;-1:-1:-1;;;;;4104:11:0;;4117:10;;4095:8;:33::i;:::-;4088:40;;;;4056:372;4367:50;4383:5;-1:-1:-1;;;;;4376:23:0;;4400:3;4376:28;;;;;-1:-1:-1;;;4376:28:0;;;;;;;-1:-1:-1;;;;;4376:28:0;-1:-1:-1;;;;;4376:28:0;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4376:28:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4376:28:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4376:28:0;4406:10;;4367:8;:50::i;1082:85:12:-;1130:30;1149:10;1130:18;:30::i;1363:232:3:-;1435:15;-1:-1:-1;;;;;1466:12:3;;;1462:127;;;-1:-1:-1;;;;;;1501:11:3;;;1494:18;;1462:127;1557:5;-1:-1:-1;;;;;1550:23:3;;1574:3;1550:28;;;;;-1:-1:-1;;;1550:28:3;;;;;;;-1:-1:-1;;;;;1550:28:3;-1:-1:-1;;;;;1550:28:3;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1550:28:3;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1550:28:3;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;1550:28:3;;-1:-1:-1;1543:35:3;;1655:107:16;863:9;:7;:9::i;:::-;855:18;;;;;;;;1727:28;1746:8;1727:18;:28::i;2802:186:0:-;524:28:11;541:10;524:16;:28::i;:::-;516:37;;;;;;;;2889::0;2900:5;2907:10;2919:6;2889:10;:37::i;:::-;-1:-1:-1;2941:40:0;;;;;;;;2962:10;;-1:-1:-1;;;;;2941:40:0;;;;;;;;;;;;2802:186;;:::o;1173:134:12:-;1234:26;:13;1252:7;1234:26;:17;:26;:::i;:::-;1275:25;;-1:-1:-1;;;;;1275:25:12;;;;;;;;1173:134;:::o;4440:190:0:-;4560:10;:24;;;4599;;;;;;;;;;;;;;;;;4440:190;:::o;1313:142:12:-;1377:29;:13;1398:7;1377:29;:20;:29;:::i;:::-;1421:27;;-1:-1:-1;;;;;1421:27:12;;;;;;;;1313:142;:::o;786:162:9:-;858:4;-1:-1:-1;;;;;882:21:9;;;;874:30;;;;;;-1:-1:-1;;;;;;921:20:9;:11;:20;;;;;;;;;;;;;;;786:162::o;1907:402:3:-;1996:4;-1:-1:-1;;;;;2016:12:3;;;2012:270;;;2093:19;;-1:-1:-1;;;;;2093:11:3;;;:19;;;;;2105:6;;2093:19;;;;2105:6;2093:11;:19;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2093:19:3;2012:270;;;2216:35;-1:-1:-1;;;;;2216:23:3;;2240:2;2244:6;2216:35;:23;:35;:::i;:::-;2208:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2298:4:3;1907:402;;;;;:::o;1072:151:11:-;1139:32;:16;1163:7;1139:32;:23;:32;:::i;:::-;1186:30;;-1:-1:-1;;;;;1186:30:11;;;;;;;;1072:151;:::o;810:127:10:-;869:24;:8;885:7;869:24;:15;:24;:::i;:::-;908:22;;-1:-1:-1;;;;;908:22:10;;;;;;;;810:127;:::o;923:143:11:-;987:29;:16;1008:7;987:29;:20;:29;:::i;:::-;1031:28;;-1:-1:-1;;;;;1031:28:11;;;;;;;;923:143;:::o;685:119:10:-;741:21;:8;754:7;741:21;:12;:21;:::i;:::-;777:20;;-1:-1:-1;;;;;777:20:10;;;;;;;;685:119;:::o;336:104:14:-;394:7;424:1;420;:5;:13;;432:1;420:13;;;428:1;420:13;413:20;336:104;-1:-1:-1;;;336:104:14:o;1906:183:16:-;-1:-1:-1;;;;;1979:22:16;;;;1971:31;;;;;;2038:6;;;2017:38;;-1:-1:-1;;;;;2017:38:16;;;;2038:6;;;2017:38;;;2065:6;:17;;-1:-1:-1;;2065:17:16;-1:-1:-1;;;;;2065:17:16;;;;;;;;;;1906:183::o;259:181:9:-;-1:-1:-1;;;;;335:21:9;;;;327:30;;;;;;376:18;380:4;386:7;376:3;:18::i;:::-;375:19;367:28;;;;;;-1:-1:-1;;;;;406:20:9;:11;:20;;;;;;;;;;;:27;;-1:-1:-1;;406:27:9;429:4;406:27;;;259:181::o;514:184::-;-1:-1:-1;;;;;593:21:9;;;;585:30;;;;;;633:18;637:4;643:7;633:3;:18::i;:::-;625:27;;;;;;;;-1:-1:-1;;;;;663:20:9;686:5;663:20;;;;;;;;;;;:28;;-1:-1:-1;;663:28:9;;;514:184::o;895:725:6:-;1428:99;;;-1:-1:-1;;;;;1428:99:6;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;1428:99:6;;;;;;;25:18:-1;;61:17;;1428:99:6;182:15:-1;1464:18:6;179:29:-1;160:49;;1551:20:6;;;;1023:12;;1551:10;;;;1428:99;;1551:20;;;25:18:-1;1551:20:6;;25:18:-1;36:153;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1551:20:6;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;1537:34:6;;;;;1588:25;1605:7;1588:16;:25::i;:::-;1581:32;895:725;-1:-1:-1;;;;;895:725:6:o;2417:1098::-;2522:4;2840:7;2836:649;;;2897:16;3050:59;;;;3224:2;3219:112;;;;3442:1;3431:12;;2890:571;;3050:59;3090:1;3079:12;;3050:59;;3219:112;3270:2;3267:1;3264;3249:24;3311:1;3305:8;3294:19;;2890:571;;2872:603;-1:-1:-1;3501:7:6;2417:1098::o",
"source": "// based on https://github.com/marbleprotocol/flash-lending/blob/master/contracts/Bank.sol\n// TODO: i wanted to have the bank be a simple Externally-owned account, but that isn't capable of pulling ETH (hence W-ETH existing)\n// we could wrap/unwrap as needed, but I think a bank with deposit, pause, withdraw will have cheaper gas\n// Bank's transfer will call ERC20's safeTransfer if necessary. ETH's transfer for 0x0, and potentially other things for ERC721\n// TODO: do we want to switch to using asset data like 0x does now, or wait. i think wait\n// The Bank must fully trust the BankTeller. I think that is fine for this setup. It is possible to build a contract that doesn't (like marble's flash-lending), but I think the gas costs are higher\npragma solidity 0.5.3;\n\nimport \"openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol\";\nimport \"openzeppelin-solidity/contracts/lifecycle/Pausable.sol\";\nimport \"openzeppelin-solidity/contracts/math/Math.sol\";\n// import \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"openzeppelin-solidity/contracts/ownership/Ownable.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\nimport \"./Constants.sol\";\nimport \"./Transfer.sol\";\nimport \"./lib/ERC20SafeTransfer.sol\";\n\n// TODO: using these generic openzepplin contracts means that revert messages can be confusing. \n// TODO: replace WhitelistedRole with \"AllowedWithdraws\" so the modifier names are more descriptive\ncontract Bank is Constants, Ownable, Transfer, Pausable, WhitelistedRole {\n // using SafeMath for uint256;\n using ERC20SafeTransfer for address; // TODO: why for \"address\" instead of \"for IERC20\"\n\n // TODO: should we have approvals instead of max_borrow?\n uint256 public max_borrow;\n event MaxBorrowSet(uint256 max_borrow);\n event DepositEvent(address indexed _token, address indexed _from, uint _value);\n event WithdrawEvent(address indexed _token, address indexed _to, uint _value);\n\n constructor(uint256 _max_borrow) public Ownable() PauserRole() Pausable() WhitelistAdminRole() {\n _setMaxBorrow(_max_borrow);\n }\n\n /**\n * @dev Default payable function. We take ETH from anywhere.\n */\n function () external payable {\n // TODO: limit who can deposit? i don't think we need to\n // TODO: i think we might even this event every time the teller acts. thats more than i want\n emit DepositEvent(ETH, msg.sender, msg.value);\n }\n\n function setMaxBorrow(uint256 _max_borrow) external onlyWhitelistAdmin {\n _setMaxBorrow(_max_borrow);\n }\n\n /**\n * @dev Withdraw tokens from the bank.\n * @param token Address of token to withdraw. 0x0 for ETH\n * @param amount Amount of token to withdraw.\n * @dev TODO: who should this be limited to? onlyOwner is too strict\n */\n function withdraw(address token, uint256 amount) external onlyWhitelistAdmin {\n transferTo(token, msg.sender, amount);\n emit WithdrawEvent(token, msg.sender, amount);\n }\n\n /**\n * @dev Borrow tokens from the bank.\n * @param token Address of token to borrow. 0x0 for ETH\n * @param amount Amount of token to borrow.\n * @dev TODO: borrow is a bad name. this doesn't enforce repayment\n */\n function borrow(address token, uint256 amount) external onlyWhitelisted {\n require(transferTo(token, msg.sender, amount), \"BORROW_FAILED\");\n }\n\n /**\n * @dev Borrow as many tokens as possible from the bank.\n * @param token Address of token to borrow. 0x0 for ETH\n */\n function borrowAllowed(address token) external onlyWhitelisted {\n require(transferTo(token, msg.sender, allowedSupplyOf(token, address(this))), \"BORROW_ALLOWED_FAILED\");\n }\n\n /**\n * @dev Get balance of bank that the sender is allowed to withdraw. \n * @param token Address of token to calculate total supply of.\n */\n function allowedSupplyOf(address token, address who) public view returns (uint256 balance) {\n // TODO: I'm not sure we even want this. we aren't using allowances since we push tokens\n if (token == ETH) {\n return Math.min(who.balance, max_borrow);\n } else {\n // TODO: i'm structuring this so approvals aren't needed between the bank and teller\n // return Math.min(IERC20(token).balanceOf(who), IERC20(token).allowance(who, msg.sender));\n return Math.min(IERC20(token).balanceOf(who), max_borrow);\n }\n }\n\n function _setMaxBorrow(uint256 _max_borrow) internal {\n // TODO: check something about the bank. EIP165?\n max_borrow = _max_borrow;\n emit MaxBorrowSet(max_borrow);\n }\n}\n",
"sourcePath": "Bank.sol",
"ast": {
"absolutePath": "/usr/src/app/contracts-sol-compiler/Bank.sol",
"exportedSymbols": {
"Bank": [
202
]
},
"id": 203,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.5",
".3"
],
"nodeType": "PragmaDirective",
"src": "747:22:0"
},
{
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol",
"file": "openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 1498,
"src": "771:74:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/lifecycle/Pausable.sol",
"file": "openzeppelin-solidity/contracts/lifecycle/Pausable.sol",
"id": 3,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 1581,
"src": "846:64:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/math/Math.sol",
"file": "openzeppelin-solidity/contracts/math/Math.sol",
"id": 4,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 1650,
"src": "911:55:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol",
"file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"id": 5,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 1887,
"src": "1030:63:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol",
"file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol",
"id": 6,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 2388,
"src": "1094:64:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/contracts-sol-compiler/Constants.sol",
"file": "./Constants.sol",
"id": 7,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 778,
"src": "1159:25:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/contracts-sol-compiler/Transfer.sol",
"file": "./Transfer.sol",
"id": 8,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 852,
"src": "1185:24:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/usr/src/app/contracts-sol-compiler/lib/ERC20SafeTransfer.sol",
"file": "./lib/ERC20SafeTransfer.sol",
"id": 9,
"nodeType": "ImportDirective",
"scope": 203,
"sourceUnit": 1011,
"src": "1210:37:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 10,
"name": "Constants",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 777,
"src": "1463:9:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Constants_$777",
"typeString": "contract Constants"
}
},
"id": 11,
"nodeType": "InheritanceSpecifier",
"src": "1463:9:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 12,
"name": "Ownable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1886,
"src": "1474:7:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Ownable_$1886",
"typeString": "contract Ownable"
}
},
"id": 13,
"nodeType": "InheritanceSpecifier",
"src": "1474:7:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 14,
"name": "Transfer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 851,
"src": "1483:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Transfer_$851",
"typeString": "contract Transfer"
}
},
"id": 15,
"nodeType": "InheritanceSpecifier",
"src": "1483:8:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 16,
"name": "Pausable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1580,
"src": "1493:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Pausable_$1580",
"typeString": "contract Pausable"
}
},
"id": 17,
"nodeType": "InheritanceSpecifier",
"src": "1493:8:0"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 18,
"name": "WhitelistedRole",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1497,
"src": "1503:15:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_WhitelistedRole_$1497",
"typeString": "contract WhitelistedRole"
}
},
"id": 19,
"nodeType": "InheritanceSpecifier",
"src": "1503:15:0"
}
],
"contractDependencies": [
777,
851,
1285,
1388,
1497,
1580,
1886
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 202,
"linearizedBaseContracts": [
202,
1497,
1388,
1580,
1285,
851,
1886,
777
],
"name": "Bank",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 22,
"libraryName": {
"contractScope": null,
"id": 20,
"name": "ERC20SafeTransfer",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1010,
"src": "1566:17:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ERC20SafeTransfer_$1010",
"typeString": "library ERC20SafeTransfer"
}
},
"nodeType": "UsingForDirective",
"src": "1560:36:0",
"typeName": {
"id": 21,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1588:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
},
{
"constant": false,
"id": 24,
"name": "max_borrow",
"nodeType": "VariableDeclaration",
"scope": 202,
"src": "1714:25:0",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 23,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1714:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"anonymous": false,
"documentation": null,
"id": 28,
"name": "MaxBorrowSet",
"nodeType": "EventDefinition",
"parameters": {
"id": 27,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26,
"indexed": false,
"name": "max_borrow",
"nodeType": "VariableDeclaration",
"scope": 28,
"src": "1764:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 25,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1764:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1763:20:0"
},
"src": "1745:39:0"
},
{
"anonymous": false,
"documentation": null,
"id": 36,
"name": "DepositEvent",
"nodeType": "EventDefinition",
"parameters": {
"id": 35,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 30,
"indexed": true,
"name": "_token",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "1808:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 29,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1808:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 32,
"indexed": true,
"name": "_from",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "1832:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 31,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1832:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 34,
"indexed": false,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 36,
"src": "1855:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 33,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1855:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1807:60:0"
},
"src": "1789:79:0"
},
{
"anonymous": false,
"documentation": null,
"id": 44,
"name": "WithdrawEvent",
"nodeType": "EventDefinition",
"parameters": {
"id": 43,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 38,
"indexed": true,
"name": "_token",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1893:22:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 37,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1893:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 40,
"indexed": true,
"name": "_to",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1917:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 39,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1917:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 42,
"indexed": false,
"name": "_value",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1938:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 41,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1938:4:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1892:58:0"
},
"src": "1873:78:0"
},
{
"body": {
"id": 61,
"nodeType": "Block",
"src": "2052:43:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 58,
"name": "_max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 46,
"src": "2076:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 57,
"name": "_setMaxBorrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 201,
"src": "2062:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 59,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2062:26:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 60,
"nodeType": "ExpressionStatement",
"src": "2062:26:0"
}
]
},
"documentation": null,
"id": 62,
"implemented": true,
"kind": "constructor",
"modifiers": [
{
"arguments": [],
"id": 49,
"modifierName": {
"argumentTypes": null,
"id": 48,
"name": "Ownable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1886,
"src": "1997:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Ownable_$1886_$",
"typeString": "type(contract Ownable)"
}
},
"nodeType": "ModifierInvocation",
"src": "1997:9:0"
},
{
"arguments": [],
"id": 51,
"modifierName": {
"argumentTypes": null,
"id": 50,
"name": "PauserRole",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1285,
"src": "2007:10:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_PauserRole_$1285_$",
"typeString": "type(contract PauserRole)"
}
},
"nodeType": "ModifierInvocation",
"src": "2007:12:0"
},
{
"arguments": [],
"id": 53,
"modifierName": {
"argumentTypes": null,
"id": 52,
"name": "Pausable",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1580,
"src": "2020:8:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Pausable_$1580_$",
"typeString": "type(contract Pausable)"
}
},
"nodeType": "ModifierInvocation",
"src": "2020:10:0"
},
{
"arguments": [],
"id": 55,
"modifierName": {
"argumentTypes": null,
"id": 54,
"name": "WhitelistAdminRole",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1388,
"src": "2031:18:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_WhitelistAdminRole_$1388_$",
"typeString": "type(contract WhitelistAdminRole)"
}
},
"nodeType": "ModifierInvocation",
"src": "2031:20:0"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 47,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 46,
"name": "_max_borrow",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "1969:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 45,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1969:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1968:21:0"
},
"returnParameters": {
"id": 56,
"nodeType": "ParameterList",
"parameters": [],
"src": "2052:0:0"
},
"scope": 202,
"src": "1957:138:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 73,
"nodeType": "Block",
"src": "2209:228:0",
"statements": [
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 66,
"name": "ETH",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 776,
"src": "2403:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 67,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2433,
"src": "2408:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 68,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2408:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 69,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2433,
"src": "2420:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 70,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "value",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2420:9:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 65,
"name": "DepositEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 36,
"src": "2390:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,uint256)"
}
},
"id": 71,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2390:40:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 72,
"nodeType": "EmitStatement",
"src": "2385:45:0"
}
]
},
"documentation": "@dev Default payable function. We take ETH from anywhere.",
"id": 74,
"implemented": true,
"kind": "fallback",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 63,
"nodeType": "ParameterList",
"parameters": [],
"src": "2189:2:0"
},
"returnParameters": {
"id": 64,
"nodeType": "ParameterList",
"parameters": [],
"src": "2209:0:0"
},
"scope": 202,
"src": "2180:257:0",
"stateMutability": "payable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 85,
"nodeType": "Block",
"src": "2514:43:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 82,
"name": "_max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "2538:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 81,
"name": "_setMaxBorrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 201,
"src": "2524:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2524:26:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 84,
"nodeType": "ExpressionStatement",
"src": "2524:26:0"
}
]
},
"documentation": null,
"id": 86,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 79,
"modifierName": {
"argumentTypes": null,
"id": 78,
"name": "onlyWhitelistAdmin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1321,
"src": "2495:18:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2495:18:0"
}
],
"name": "setMaxBorrow",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 77,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 76,
"name": "_max_borrow",
"nodeType": "VariableDeclaration",
"scope": 86,
"src": "2465:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 75,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2465:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2464:21:0"
},
"returnParameters": {
"id": 80,
"nodeType": "ParameterList",
"parameters": [],
"src": "2514:0:0"
},
"scope": 202,
"src": "2443:114:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 109,
"nodeType": "Block",
"src": "2879:109:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 96,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 88,
"src": "2900:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 97,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2433,
"src": "2907:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 98,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2907:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 99,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 90,
"src": "2919:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 95,
"name": "transferTo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 850,
"src": "2889:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_payable_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,address payable,uint256) returns (bool)"
}
},
"id": 100,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2889:37:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 101,
"nodeType": "ExpressionStatement",
"src": "2889:37:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 103,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 88,
"src": "2955:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 104,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2433,
"src": "2962:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 105,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "2962:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 106,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 90,
"src": "2974:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 102,
"name": "WithdrawEvent",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 44,
"src": "2941:13:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$_t_uint256_$returns$__$",
"typeString": "function (address,address,uint256)"
}
},
"id": 107,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2941:40:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 108,
"nodeType": "EmitStatement",
"src": "2936:45:0"
}
]
},
"documentation": "@dev Withdraw tokens from the bank.\n@param token Address of token to withdraw. 0x0 for ETH\n@param amount Amount of token to withdraw.\n@dev TODO: who should this be limited to? onlyOwner is too strict",
"id": 110,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 93,
"modifierName": {
"argumentTypes": null,
"id": 92,
"name": "onlyWhitelistAdmin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1321,
"src": "2860:18:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "2860:18:0"
}
],
"name": "withdraw",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 91,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 88,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 110,
"src": "2820:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 87,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2820:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 90,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 110,
"src": "2835:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 89,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2835:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2819:31:0"
},
"returnParameters": {
"id": 94,
"nodeType": "ParameterList",
"parameters": [],
"src": "2879:0:0"
},
"scope": 202,
"src": "2802:186:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 129,
"nodeType": "Block",
"src": "3297:80:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 121,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 112,
"src": "3326:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 122,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2433,
"src": "3333:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 123,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3333:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"id": 124,
"name": "amount",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 114,
"src": "3345:6:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 120,
"name": "transferTo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 850,
"src": "3315:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_payable_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,address payable,uint256) returns (bool)"
}
},
"id": 125,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3315:37:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "424f52524f575f4641494c4544",
"id": 126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3354:15:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_e68a2a89111b59af120d1624b4ea441767e5a7d22db562c7259f0e5d168d29fd",
"typeString": "literal_string \"BORROW_FAILED\""
},
"value": "BORROW_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e68a2a89111b59af120d1624b4ea441767e5a7d22db562c7259f0e5d168d29fd",
"typeString": "literal_string \"BORROW_FAILED\""
}
],
"id": 119,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2436,
2437
],
"referencedDeclaration": 2437,
"src": "3307:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 127,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3307:63:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 128,
"nodeType": "ExpressionStatement",
"src": "3307:63:0"
}
]
},
"documentation": "@dev Borrow tokens from the bank.\n@param token Address of token to borrow. 0x0 for ETH\n@param amount Amount of token to borrow.\n@dev TODO: borrow is a bad name. this doesn't enforce repayment",
"id": 130,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 117,
"modifierName": {
"argumentTypes": null,
"id": 116,
"name": "onlyWhitelisted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "3281:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "3281:15:0"
}
],
"name": "borrow",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 115,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 112,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 130,
"src": "3241:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 111,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3241:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 114,
"name": "amount",
"nodeType": "VariableDeclaration",
"scope": 130,
"src": "3256:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 113,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3256:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3240:31:0"
},
"returnParameters": {
"id": 118,
"nodeType": "ParameterList",
"parameters": [],
"src": "3297:0:0"
},
"scope": 202,
"src": "3225:152:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 152,
"nodeType": "Block",
"src": "3580:119:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 139,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "3609:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 140,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2433,
"src": "3616:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 141,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "3616:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 143,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 132,
"src": "3644:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 145,
"name": "this",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2469,
"src": "3659:4:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Bank_$202",
"typeString": "contract Bank"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_Bank_$202",
"typeString": "contract Bank"
}
],
"id": 144,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "3651:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 146,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3651:13:0",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"id": 142,
"name": "allowedSupplyOf",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 187,
"src": "3628:15:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$_t_address_$returns$_t_uint256_$",
"typeString": "function (address,address) view returns (uint256)"
}
},
"id": 147,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3628:37:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 138,
"name": "transferTo",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 850,
"src": "3598:10:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_address_payable_$_t_uint256_$returns$_t_bool_$",
"typeString": "function (address,address payable,uint256) returns (bool)"
}
},
"id": 148,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3598:68:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "424f52524f575f414c4c4f5745445f4641494c4544",
"id": 149,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "3668:23:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_bafa6a72a382126d691a3c83df53d611743f9f3ec056567580b03005d7850297",
"typeString": "literal_string \"BORROW_ALLOWED_FAILED\""
},
"value": "BORROW_ALLOWED_FAILED"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_bafa6a72a382126d691a3c83df53d611743f9f3ec056567580b03005d7850297",
"typeString": "literal_string \"BORROW_ALLOWED_FAILED\""
}
],
"id": 137,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
2436,
2437
],
"referencedDeclaration": 2437,
"src": "3590:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 150,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "3590:102:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 151,
"nodeType": "ExpressionStatement",
"src": "3590:102:0"
}
]
},
"documentation": "@dev Borrow as many tokens as possible from the bank.\n@param token Address of token to borrow. 0x0 for ETH",
"id": 153,
"implemented": true,
"kind": "function",
"modifiers": [
{
"arguments": null,
"id": 135,
"modifierName": {
"argumentTypes": null,
"id": 134,
"name": "onlyWhitelisted",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1418,
"src": "3564:15:0",
"typeDescriptions": {
"typeIdentifier": "t_modifier$__$",
"typeString": "modifier ()"
}
},
"nodeType": "ModifierInvocation",
"src": "3564:15:0"
}
],
"name": "borrowAllowed",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 133,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 132,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 153,
"src": "3540:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 131,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3540:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3539:15:0"
},
"returnParameters": {
"id": 136,
"nodeType": "ParameterList",
"parameters": [],
"src": "3580:0:0"
},
"scope": 202,
"src": "3517:182:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
{
"body": {
"id": 186,
"nodeType": "Block",
"src": "3949:485:0",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 164,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 162,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 155,
"src": "4060:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 163,
"name": "ETH",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 776,
"src": "4069:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "4060:12:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 184,
"nodeType": "Block",
"src": "4145:283:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 179,
"name": "who",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 157,
"src": "4400:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 176,
"name": "token",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 155,
"src": "4383:5:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 175,
"name": "IERC20",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2387,
"src": "4376:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_IERC20_$2387_$",
"typeString": "type(contract IERC20)"
}
},
"id": 177,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4376:13:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_IERC20_$2387",
"typeString": "contract IERC20"
}
},
"id": 178,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balanceOf",
"nodeType": "MemberAccess",
"referencedDeclaration": 2361,
"src": "4376:23:0",
"typeDescriptions": {
"typeIdentifier": "t_function_external_view$_t_address_$returns$_t_uint256_$",
"typeString": "function (address) view external returns (uint256)"
}
},
"id": 180,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4376:28:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 181,
"name": "max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 24,
"src": "4406:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 173,
"name": "Math",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1649,
"src": "4367:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Math_$1649_$",
"typeString": "type(library Math)"
}
},
"id": 174,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "min",
"nodeType": "MemberAccess",
"referencedDeclaration": 1616,
"src": "4367:8:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 182,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4367:50:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 161,
"id": 183,
"nodeType": "Return",
"src": "4360:57:0"
}
]
},
"id": 185,
"nodeType": "IfStatement",
"src": "4056:372:0",
"trueBody": {
"id": 172,
"nodeType": "Block",
"src": "4074:65:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 167,
"name": "who",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 157,
"src": "4104:3:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 168,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "balance",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "4104:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"argumentTypes": null,
"id": 169,
"name": "max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 24,
"src": "4117:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 165,
"name": "Math",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1649,
"src": "4095:4:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_Math_$1649_$",
"typeString": "type(library Math)"
}
},
"id": 166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "min",
"nodeType": "MemberAccess",
"referencedDeclaration": 1616,
"src": "4095:8:0",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
"typeString": "function (uint256,uint256) pure returns (uint256)"
}
},
"id": 170,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4095:33:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 161,
"id": 171,
"nodeType": "Return",
"src": "4088:40:0"
}
]
}
}
]
},
"documentation": "@dev Get balance of bank that the sender is allowed to withdraw. \n@param token Address of token to calculate total supply of.",
"id": 187,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "allowedSupplyOf",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 158,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 155,
"name": "token",
"nodeType": "VariableDeclaration",
"scope": 187,
"src": "3883:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 154,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3883:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 157,
"name": "who",
"nodeType": "VariableDeclaration",
"scope": 187,
"src": "3898:11:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 156,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "3898:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3882:28:0"
},
"returnParameters": {
"id": 161,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 160,
"name": "balance",
"nodeType": "VariableDeclaration",
"scope": 187,
"src": "3932:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 159,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "3932:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "3931:17:0"
},
"scope": 202,
"src": "3858:576:0",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 200,
"nodeType": "Block",
"src": "4493:137:0",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 194,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 192,
"name": "max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 24,
"src": "4560:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 193,
"name": "_max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 189,
"src": "4573:11:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "4560:24:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 195,
"nodeType": "ExpressionStatement",
"src": "4560:24:0"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 197,
"name": "max_borrow",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 24,
"src": "4612:10:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 196,
"name": "MaxBorrowSet",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 28,
"src": "4599:12:0",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_uint256_$returns$__$",
"typeString": "function (uint256)"
}
},
"id": 198,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "4599:24:0",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 199,
"nodeType": "EmitStatement",
"src": "4594:29:0"
}
]
},
"documentation": null,
"id": 201,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_setMaxBorrow",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 189,
"name": "_max_borrow",
"nodeType": "VariableDeclaration",
"scope": 201,
"src": "4463:19:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 188,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "4463:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "4462:21:0"
},
"returnParameters": {
"id": 191,
"nodeType": "ParameterList",
"parameters": [],
"src": "4493:0:0"
},
"scope": 202,
"src": "4440:190:0",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 203,
"src": "1446:3186:0"
}
],
"src": "747:3886:0"
},
"legacyAST": {
"attributes": {
"absolutePath": "/usr/src/app/contracts-sol-compiler/Bank.sol",
"exportedSymbols": {
"Bank": [
202
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"0.5",
".3"
]
},
"id": 1,
"name": "PragmaDirective",
"src": "747:22:0"
},
{
"attributes": {
"SourceUnit": 1498,
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol",
"file": "openzeppelin-solidity/contracts/access/roles/WhitelistedRole.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 2,
"name": "ImportDirective",
"src": "771:74:0"
},
{
"attributes": {
"SourceUnit": 1581,
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/lifecycle/Pausable.sol",
"file": "openzeppelin-solidity/contracts/lifecycle/Pausable.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 3,
"name": "ImportDirective",
"src": "846:64:0"
},
{
"attributes": {
"SourceUnit": 1650,
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/math/Math.sol",
"file": "openzeppelin-solidity/contracts/math/Math.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 4,
"name": "ImportDirective",
"src": "911:55:0"
},
{
"attributes": {
"SourceUnit": 1887,
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol",
"file": "openzeppelin-solidity/contracts/ownership/Ownable.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 5,
"name": "ImportDirective",
"src": "1030:63:0"
},
{
"attributes": {
"SourceUnit": 2388,
"absolutePath": "/usr/src/app/node_modules/openzeppelin-solidity/contracts/token/ERC20/IERC20.sol",
"file": "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 6,
"name": "ImportDirective",
"src": "1094:64:0"
},
{
"attributes": {
"SourceUnit": 778,
"absolutePath": "/usr/src/app/contracts-sol-compiler/Constants.sol",
"file": "./Constants.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 7,
"name": "ImportDirective",
"src": "1159:25:0"
},
{
"attributes": {
"SourceUnit": 852,
"absolutePath": "/usr/src/app/contracts-sol-compiler/Transfer.sol",
"file": "./Transfer.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 8,
"name": "ImportDirective",
"src": "1185:24:0"
},
{
"attributes": {
"SourceUnit": 1011,
"absolutePath": "/usr/src/app/contracts-sol-compiler/lib/ERC20SafeTransfer.sol",
"file": "./lib/ERC20SafeTransfer.sol",
"scope": 203,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 9,
"name": "ImportDirective",
"src": "1210:37:0"
},
{
"attributes": {
"contractDependencies": [
777,
851,
1285,
1388,
1497,
1580,
1886
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"linearizedBaseContracts": [
202,
1497,
1388,
1580,
1285,
851,
1886,
777
],
"name": "Bank",
"scope": 203
},
"children": [
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "Constants",
"referencedDeclaration": 777,
"type": "contract Constants"
},
"id": 10,
"name": "UserDefinedTypeName",
"src": "1463:9:0"
}
],
"id": 11,
"name": "InheritanceSpecifier",
"src": "1463:9:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "Ownable",
"referencedDeclaration": 1886,
"type": "contract Ownable"
},
"id": 12,
"name": "UserDefinedTypeName",
"src": "1474:7:0"
}
],
"id": 13,
"name": "InheritanceSpecifier",
"src": "1474:7:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "Transfer",
"referencedDeclaration": 851,
"type": "contract Transfer"
},
"id": 14,
"name": "UserDefinedTypeName",
"src": "1483:8:0"
}
],
"id": 15,
"name": "InheritanceSpecifier",
"src": "1483:8:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "Pausable",
"referencedDeclaration": 1580,
"type": "contract Pausable"
},
"id": 16,
"name": "UserDefinedTypeName",
"src": "1493:8:0"
}
],
"id": 17,
"name": "InheritanceSpecifier",
"src": "1493:8:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "WhitelistedRole",
"referencedDeclaration": 1497,
"type": "contract WhitelistedRole"
},
"id": 18,
"name": "UserDefinedTypeName",
"src": "1503:15:0"
}
],
"id": 19,
"name": "InheritanceSpecifier",
"src": "1503:15:0"
},
{
"children": [
{
"attributes": {
"contractScope": null,
"name": "ERC20SafeTransfer",
"referencedDeclaration": 1010,
"type": "library ERC20SafeTransfer"
},
"id": 20,
"name": "UserDefinedTypeName",
"src": "1566:17:0"
},
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 21,
"name": "ElementaryTypeName",
"src": "1588:7:0"
}
],
"id": 22,
"name": "UsingForDirective",
"src": "1560:36:0"
},
{
"attributes": {
"constant": false,
"name": "max_borrow",
"scope": 202,
"stateVariable": true,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 23,
"name": "ElementaryTypeName",
"src": "1714:7:0"
}
],
"id": 24,
"name": "VariableDeclaration",
"src": "1714:25:0"
},
{
"attributes": {
"anonymous": false,
"documentation": null,
"name": "MaxBorrowSet"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"indexed": false,
"name": "max_borrow",
"scope": 28,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 25,
"name": "ElementaryTypeName",
"src": "1764:7:0"
}
],
"id": 26,
"name": "VariableDeclaration",
"src": "1764:18:0"
}
],
"id": 27,
"name": "ParameterList",
"src": "1763:20:0"
}
],
"id": 28,
"name": "EventDefinition",
"src": "1745:39:0"
},
{
"attributes": {
"anonymous": false,
"documentation": null,
"name": "DepositEvent"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"indexed": true,
"name": "_token",
"scope": 36,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 29,
"name": "ElementaryTypeName",
"src": "1808:7:0"
}
],
"id": 30,
"name": "VariableDeclaration",
"src": "1808:22:0"
},
{
"attributes": {
"constant": false,
"indexed": true,
"name": "_from",
"scope": 36,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 31,
"name": "ElementaryTypeName",
"src": "1832:7:0"
}
],
"id": 32,
"name": "VariableDeclaration",
"src": "1832:21:0"
},
{
"attributes": {
"constant": false,
"indexed": false,
"name": "_value",
"scope": 36,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 33,
"name": "ElementaryTypeName",
"src": "1855:4:0"
}
],
"id": 34,
"name": "VariableDeclaration",
"src": "1855:11:0"
}
],
"id": 35,
"name": "ParameterList",
"src": "1807:60:0"
}
],
"id": 36,
"name": "EventDefinition",
"src": "1789:79:0"
},
{
"attributes": {
"anonymous": false,
"documentation": null,
"name": "WithdrawEvent"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"indexed": true,
"name": "_token",
"scope": 44,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 37,
"name": "ElementaryTypeName",
"src": "1893:7:0"
}
],
"id": 38,
"name": "VariableDeclaration",
"src": "1893:22:0"
},
{
"attributes": {
"constant": false,
"indexed": true,
"name": "_to",
"scope": 44,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 39,
"name": "ElementaryTypeName",
"src": "1917:7:0"
}
],
"id": 40,
"name": "VariableDeclaration",
"src": "1917:19:0"
},
{
"attributes": {
"constant": false,
"indexed": false,
"name": "_value",
"scope": 44,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint",
"type": "uint256"
},
"id": 41,
"name": "ElementaryTypeName",
"src": "1938:4:0"
}
],
"id": 42,
"name": "VariableDeclaration",
"src": "1938:11:0"
}
],
"id": 43,
"name": "ParameterList",
"src": "1892:58:0"
}
],
"id": 44,
"name": "EventDefinition",
"src": "1873:78:0"
},
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": true,
"kind": "constructor",
"name": "",
"scope": 202,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "_max_borrow",
"scope": 62,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 45,
"name": "ElementaryTypeName",
"src": "1969:7:0"
}
],
"id": 46,
"name": "VariableDeclaration",
"src": "1969:19:0"
}
],
"id": 47,
"name": "ParameterList",
"src": "1968:21:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 56,
"name": "ParameterList",
"src": "2052:0:0"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1886,
"type": "type(contract Ownable)",
"value": "Ownable"
},
"id": 48,
"name": "Identifier",
"src": "1997:7:0"
}
],
"id": 49,
"name": "ModifierInvocation",
"src": "1997:9:0"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1285,
"type": "type(contract PauserRole)",
"value": "PauserRole"
},
"id": 50,
"name": "Identifier",
"src": "2007:10:0"
}
],
"id": 51,
"name": "ModifierInvocation",
"src": "2007:12:0"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1580,
"type": "type(contract Pausable)",
"value": "Pausable"
},
"id": 52,
"name": "Identifier",
"src": "2020:8:0"
}
],
"id": 53,
"name": "ModifierInvocation",
"src": "2020:10:0"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1388,
"type": "type(contract WhitelistAdminRole)",
"value": "WhitelistAdminRole"
},
"id": 54,
"name": "Identifier",
"src": "2031:18:0"
}
],
"id": 55,
"name": "ModifierInvocation",
"src": "2031:20:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 201,
"type": "function (uint256)",
"value": "_setMaxBorrow"
},
"id": 57,
"name": "Identifier",
"src": "2062:13:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 46,
"type": "uint256",
"value": "_max_borrow"
},
"id": 58,
"name": "Identifier",
"src": "2076:11:0"
}
],
"id": 59,
"name": "FunctionCall",
"src": "2062:26:0"
}
],
"id": 60,
"name": "ExpressionStatement",
"src": "2062:26:0"
}
],
"id": 61,
"name": "Block",
"src": "2052:43:0"
}
],
"id": 62,
"name": "FunctionDefinition",
"src": "1957:138:0"
},
{
"attributes": {
"documentation": "@dev Default payable function. We take ETH from anywhere.",
"implemented": true,
"isConstructor": false,
"kind": "fallback",
"modifiers": [
null
],
"name": "",
"scope": 202,
"stateMutability": "payable",
"superFunction": null,
"visibility": "external"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 63,
"name": "ParameterList",
"src": "2189:2:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 64,
"name": "ParameterList",
"src": "2209:0:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 36,
"type": "function (address,address,uint256)",
"value": "DepositEvent"
},
"id": 65,
"name": "Identifier",
"src": "2390:12:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 776,
"type": "address",
"value": "ETH"
},
"id": 66,
"name": "Identifier",
"src": "2403:3:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address payable"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2433,
"type": "msg",
"value": "msg"
},
"id": 67,
"name": "Identifier",
"src": "2408:3:0"
}
],
"id": 68,
"name": "MemberAccess",
"src": "2408:10:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "value",
"referencedDeclaration": null,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2433,
"type": "msg",
"value": "msg"
},
"id": 69,
"name": "Identifier",
"src": "2420:3:0"
}
],
"id": 70,
"name": "MemberAccess",
"src": "2420:9:0"
}
],
"id": 71,
"name": "FunctionCall",
"src": "2390:40:0"
}
],
"id": 72,
"name": "EmitStatement",
"src": "2385:45:0"
}
],
"id": 73,
"name": "Block",
"src": "2209:228:0"
}
],
"id": 74,
"name": "FunctionDefinition",
"src": "2180:257:0"
},
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": false,
"kind": "function",
"name": "setMaxBorrow",
"scope": 202,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "_max_borrow",
"scope": 86,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 75,
"name": "ElementaryTypeName",
"src": "2465:7:0"
}
],
"id": 76,
"name": "VariableDeclaration",
"src": "2465:19:0"
}
],
"id": 77,
"name": "ParameterList",
"src": "2464:21:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 80,
"name": "ParameterList",
"src": "2514:0:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1321,
"type": "modifier ()",
"value": "onlyWhitelistAdmin"
},
"id": 78,
"name": "Identifier",
"src": "2495:18:0"
}
],
"id": 79,
"name": "ModifierInvocation",
"src": "2495:18:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 201,
"type": "function (uint256)",
"value": "_setMaxBorrow"
},
"id": 81,
"name": "Identifier",
"src": "2524:13:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 76,
"type": "uint256",
"value": "_max_borrow"
},
"id": 82,
"name": "Identifier",
"src": "2538:11:0"
}
],
"id": 83,
"name": "FunctionCall",
"src": "2524:26:0"
}
],
"id": 84,
"name": "ExpressionStatement",
"src": "2524:26:0"
}
],
"id": 85,
"name": "Block",
"src": "2514:43:0"
}
],
"id": 86,
"name": "FunctionDefinition",
"src": "2443:114:0"
},
{
"attributes": {
"documentation": "@dev Withdraw tokens from the bank.\n@param token Address of token to withdraw. 0x0 for ETH\n@param amount Amount of token to withdraw.\n@dev TODO: who should this be limited to? onlyOwner is too strict",
"implemented": true,
"isConstructor": false,
"kind": "function",
"name": "withdraw",
"scope": 202,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "token",
"scope": 110,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 87,
"name": "ElementaryTypeName",
"src": "2820:7:0"
}
],
"id": 88,
"name": "VariableDeclaration",
"src": "2820:13:0"
},
{
"attributes": {
"constant": false,
"name": "amount",
"scope": 110,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 89,
"name": "ElementaryTypeName",
"src": "2835:7:0"
}
],
"id": 90,
"name": "VariableDeclaration",
"src": "2835:14:0"
}
],
"id": 91,
"name": "ParameterList",
"src": "2819:31:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 94,
"name": "ParameterList",
"src": "2879:0:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1321,
"type": "modifier ()",
"value": "onlyWhitelistAdmin"
},
"id": 92,
"name": "Identifier",
"src": "2860:18:0"
}
],
"id": 93,
"name": "ModifierInvocation",
"src": "2860:18:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "bool",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 850,
"type": "function (address,address payable,uint256) returns (bool)",
"value": "transferTo"
},
"id": 95,
"name": "Identifier",
"src": "2889:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 88,
"type": "address",
"value": "token"
},
"id": 96,
"name": "Identifier",
"src": "2900:5:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address payable"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2433,
"type": "msg",
"value": "msg"
},
"id": 97,
"name": "Identifier",
"src": "2907:3:0"
}
],
"id": 98,
"name": "MemberAccess",
"src": "2907:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 90,
"type": "uint256",
"value": "amount"
},
"id": 99,
"name": "Identifier",
"src": "2919:6:0"
}
],
"id": 100,
"name": "FunctionCall",
"src": "2889:37:0"
}
],
"id": 101,
"name": "ExpressionStatement",
"src": "2889:37:0"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 44,
"type": "function (address,address,uint256)",
"value": "WithdrawEvent"
},
"id": 102,
"name": "Identifier",
"src": "2941:13:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 88,
"type": "address",
"value": "token"
},
"id": 103,
"name": "Identifier",
"src": "2955:5:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address payable"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2433,
"type": "msg",
"value": "msg"
},
"id": 104,
"name": "Identifier",
"src": "2962:3:0"
}
],
"id": 105,
"name": "MemberAccess",
"src": "2962:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 90,
"type": "uint256",
"value": "amount"
},
"id": 106,
"name": "Identifier",
"src": "2974:6:0"
}
],
"id": 107,
"name": "FunctionCall",
"src": "2941:40:0"
}
],
"id": 108,
"name": "EmitStatement",
"src": "2936:45:0"
}
],
"id": 109,
"name": "Block",
"src": "2879:109:0"
}
],
"id": 110,
"name": "FunctionDefinition",
"src": "2802:186:0"
},
{
"attributes": {
"documentation": "@dev Borrow tokens from the bank.\n@param token Address of token to borrow. 0x0 for ETH\n@param amount Amount of token to borrow.\n@dev TODO: borrow is a bad name. this doesn't enforce repayment",
"implemented": true,
"isConstructor": false,
"kind": "function",
"name": "borrow",
"scope": 202,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "token",
"scope": 130,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 111,
"name": "ElementaryTypeName",
"src": "3241:7:0"
}
],
"id": 112,
"name": "VariableDeclaration",
"src": "3241:13:0"
},
{
"attributes": {
"constant": false,
"name": "amount",
"scope": 130,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 113,
"name": "ElementaryTypeName",
"src": "3256:7:0"
}
],
"id": 114,
"name": "VariableDeclaration",
"src": "3256:14:0"
}
],
"id": 115,
"name": "ParameterList",
"src": "3240:31:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 118,
"name": "ParameterList",
"src": "3297:0:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1418,
"type": "modifier ()",
"value": "onlyWhitelisted"
},
"id": 116,
"name": "Identifier",
"src": "3281:15:0"
}
],
"id": 117,
"name": "ModifierInvocation",
"src": "3281:15:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_e68a2a89111b59af120d1624b4ea441767e5a7d22db562c7259f0e5d168d29fd",
"typeString": "literal_string \"BORROW_FAILED\""
}
],
"overloadedDeclarations": [
2436,
2437
],
"referencedDeclaration": 2437,
"type": "function (bool,string memory) pure",
"value": "require"
},
"id": 119,
"name": "Identifier",
"src": "3307:7:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "bool",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 850,
"type": "function (address,address payable,uint256) returns (bool)",
"value": "transferTo"
},
"id": 120,
"name": "Identifier",
"src": "3315:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 112,
"type": "address",
"value": "token"
},
"id": 121,
"name": "Identifier",
"src": "3326:5:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address payable"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2433,
"type": "msg",
"value": "msg"
},
"id": 122,
"name": "Identifier",
"src": "3333:3:0"
}
],
"id": 123,
"name": "MemberAccess",
"src": "3333:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 114,
"type": "uint256",
"value": "amount"
},
"id": 124,
"name": "Identifier",
"src": "3345:6:0"
}
],
"id": 125,
"name": "FunctionCall",
"src": "3315:37:0"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "424f52524f575f4641494c4544",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "string",
"type": "literal_string \"BORROW_FAILED\"",
"value": "BORROW_FAILED"
},
"id": 126,
"name": "Literal",
"src": "3354:15:0"
}
],
"id": 127,
"name": "FunctionCall",
"src": "3307:63:0"
}
],
"id": 128,
"name": "ExpressionStatement",
"src": "3307:63:0"
}
],
"id": 129,
"name": "Block",
"src": "3297:80:0"
}
],
"id": 130,
"name": "FunctionDefinition",
"src": "3225:152:0"
},
{
"attributes": {
"documentation": "@dev Borrow as many tokens as possible from the bank.\n@param token Address of token to borrow. 0x0 for ETH",
"implemented": true,
"isConstructor": false,
"kind": "function",
"name": "borrowAllowed",
"scope": 202,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "external"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "token",
"scope": 153,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 131,
"name": "ElementaryTypeName",
"src": "3540:7:0"
}
],
"id": 132,
"name": "VariableDeclaration",
"src": "3540:13:0"
}
],
"id": 133,
"name": "ParameterList",
"src": "3539:15:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 136,
"name": "ParameterList",
"src": "3580:0:0"
},
{
"attributes": {
"arguments": null
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1418,
"type": "modifier ()",
"value": "onlyWhitelisted"
},
"id": 134,
"name": "Identifier",
"src": "3564:15:0"
}
],
"id": 135,
"name": "ModifierInvocation",
"src": "3564:15:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_bafa6a72a382126d691a3c83df53d611743f9f3ec056567580b03005d7850297",
"typeString": "literal_string \"BORROW_ALLOWED_FAILED\""
}
],
"overloadedDeclarations": [
2436,
2437
],
"referencedDeclaration": 2437,
"type": "function (bool,string memory) pure",
"value": "require"
},
"id": 137,
"name": "Identifier",
"src": "3590:7:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "bool",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 850,
"type": "function (address,address payable,uint256) returns (bool)",
"value": "transferTo"
},
"id": 138,
"name": "Identifier",
"src": "3598:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 132,
"type": "address",
"value": "token"
},
"id": 139,
"name": "Identifier",
"src": "3609:5:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "sender",
"referencedDeclaration": null,
"type": "address payable"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2433,
"type": "msg",
"value": "msg"
},
"id": 140,
"name": "Identifier",
"src": "3616:3:0"
}
],
"id": 141,
"name": "MemberAccess",
"src": "3616:10:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "uint256",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 187,
"type": "function (address,address) view returns (uint256)",
"value": "allowedSupplyOf"
},
"id": 142,
"name": "Identifier",
"src": "3628:15:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 132,
"type": "address",
"value": "token"
},
"id": 143,
"name": "Identifier",
"src": "3644:5:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "address payable",
"type_conversion": true
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_Bank_$202",
"typeString": "contract Bank"
}
],
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"type": "type(address)",
"value": "address"
},
"id": 144,
"name": "ElementaryTypeNameExpression",
"src": "3651:7:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2469,
"type": "contract Bank",
"value": "this"
},
"id": 145,
"name": "Identifier",
"src": "3659:4:0"
}
],
"id": 146,
"name": "FunctionCall",
"src": "3651:13:0"
}
],
"id": 147,
"name": "FunctionCall",
"src": "3628:37:0"
}
],
"id": 148,
"name": "FunctionCall",
"src": "3598:68:0"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "424f52524f575f414c4c4f5745445f4641494c4544",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "string",
"type": "literal_string \"BORROW_ALLOWED_FAILED\"",
"value": "BORROW_ALLOWED_FAILED"
},
"id": 149,
"name": "Literal",
"src": "3668:23:0"
}
],
"id": 150,
"name": "FunctionCall",
"src": "3590:102:0"
}
],
"id": 151,
"name": "ExpressionStatement",
"src": "3590:102:0"
}
],
"id": 152,
"name": "Block",
"src": "3580:119:0"
}
],
"id": 153,
"name": "FunctionDefinition",
"src": "3517:182:0"
},
{
"attributes": {
"documentation": "@dev Get balance of bank that the sender is allowed to withdraw. \n@param token Address of token to calculate total supply of.",
"implemented": true,
"isConstructor": false,
"kind": "function",
"modifiers": [
null
],
"name": "allowedSupplyOf",
"scope": 202,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "token",
"scope": 187,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 154,
"name": "ElementaryTypeName",
"src": "3883:7:0"
}
],
"id": 155,
"name": "VariableDeclaration",
"src": "3883:13:0"
},
{
"attributes": {
"constant": false,
"name": "who",
"scope": 187,
"stateVariable": false,
"storageLocation": "default",
"type": "address",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "address",
"stateMutability": "nonpayable",
"type": "address"
},
"id": 156,
"name": "ElementaryTypeName",
"src": "3898:7:0"
}
],
"id": 157,
"name": "VariableDeclaration",
"src": "3898:11:0"
}
],
"id": 158,
"name": "ParameterList",
"src": "3882:28:0"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "balance",
"scope": 187,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 159,
"name": "ElementaryTypeName",
"src": "3932:7:0"
}
],
"id": 160,
"name": "VariableDeclaration",
"src": "3932:15:0"
}
],
"id": 161,
"name": "ParameterList",
"src": "3931:17:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "==",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 155,
"type": "address",
"value": "token"
},
"id": 162,
"name": "Identifier",
"src": "4060:5:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 776,
"type": "address",
"value": "ETH"
},
"id": 163,
"name": "Identifier",
"src": "4069:3:0"
}
],
"id": 164,
"name": "BinaryOperation",
"src": "4060:12:0"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 161
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "uint256",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "min",
"referencedDeclaration": 1616,
"type": "function (uint256,uint256) pure returns (uint256)"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1649,
"type": "type(library Math)",
"value": "Math"
},
"id": 165,
"name": "Identifier",
"src": "4095:4:0"
}
],
"id": 166,
"name": "MemberAccess",
"src": "4095:8:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "balance",
"referencedDeclaration": null,
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 157,
"type": "address",
"value": "who"
},
"id": 167,
"name": "Identifier",
"src": "4104:3:0"
}
],
"id": 168,
"name": "MemberAccess",
"src": "4104:11:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 24,
"type": "uint256",
"value": "max_borrow"
},
"id": 169,
"name": "Identifier",
"src": "4117:10:0"
}
],
"id": 170,
"name": "FunctionCall",
"src": "4095:33:0"
}
],
"id": 171,
"name": "Return",
"src": "4088:40:0"
}
],
"id": 172,
"name": "Block",
"src": "4074:65:0"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 161
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "uint256",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "min",
"referencedDeclaration": 1616,
"type": "function (uint256,uint256) pure returns (uint256)"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 1649,
"type": "type(library Math)",
"value": "Math"
},
"id": 173,
"name": "Identifier",
"src": "4367:4:0"
}
],
"id": 174,
"name": "MemberAccess",
"src": "4367:8:0"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "uint256",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"member_name": "balanceOf",
"referencedDeclaration": 2361,
"type": "function (address) view external returns (uint256)"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "contract IERC20",
"type_conversion": true
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2387,
"type": "type(contract IERC20)",
"value": "IERC20"
},
"id": 175,
"name": "Identifier",
"src": "4376:6:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 155,
"type": "address",
"value": "token"
},
"id": 176,
"name": "Identifier",
"src": "4383:5:0"
}
],
"id": 177,
"name": "FunctionCall",
"src": "4376:13:0"
}
],
"id": 178,
"name": "MemberAccess",
"src": "4376:23:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 157,
"type": "address",
"value": "who"
},
"id": 179,
"name": "Identifier",
"src": "4400:3:0"
}
],
"id": 180,
"name": "FunctionCall",
"src": "4376:28:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 24,
"type": "uint256",
"value": "max_borrow"
},
"id": 181,
"name": "Identifier",
"src": "4406:10:0"
}
],
"id": 182,
"name": "FunctionCall",
"src": "4367:50:0"
}
],
"id": 183,
"name": "Return",
"src": "4360:57:0"
}
],
"id": 184,
"name": "Block",
"src": "4145:283:0"
}
],
"id": 185,
"name": "IfStatement",
"src": "4056:372:0"
}
],
"id": 186,
"name": "Block",
"src": "3949:485:0"
}
],
"id": 187,
"name": "FunctionDefinition",
"src": "3858:576:0"
},
{
"attributes": {
"documentation": null,
"implemented": true,
"isConstructor": false,
"kind": "function",
"modifiers": [
null
],
"name": "_setMaxBorrow",
"scope": 202,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "_max_borrow",
"scope": 201,
"stateVariable": false,
"storageLocation": "default",
"type": "uint256",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "uint256",
"type": "uint256"
},
"id": 188,
"name": "ElementaryTypeName",
"src": "4463:7:0"
}
],
"id": 189,
"name": "VariableDeclaration",
"src": "4463:19:0"
}
],
"id": 190,
"name": "ParameterList",
"src": "4462:21:0"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 191,
"name": "ParameterList",
"src": "4493:0:0"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "uint256"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 24,
"type": "uint256",
"value": "max_borrow"
},
"id": 192,
"name": "Identifier",
"src": "4560:10:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 189,
"type": "uint256",
"value": "_max_borrow"
},
"id": 193,
"name": "Identifier",
"src": "4573:11:0"
}
],
"id": 194,
"name": "Assignment",
"src": "4560:24:0"
}
],
"id": 195,
"name": "ExpressionStatement",
"src": "4560:24:0"
},
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 28,
"type": "function (uint256)",
"value": "MaxBorrowSet"
},
"id": 196,
"name": "Identifier",
"src": "4599:12:0"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 24,
"type": "uint256",
"value": "max_borrow"
},
"id": 197,
"name": "Identifier",
"src": "4612:10:0"
}
],
"id": 198,
"name": "FunctionCall",
"src": "4599:24:0"
}
],
"id": 199,
"name": "EmitStatement",
"src": "4594:29:0"
}
],
"id": 200,
"name": "Block",
"src": "4493:137:0"
}
],
"id": 201,
"name": "FunctionDefinition",
"src": "4440:190:0"
}
],
"id": 202,
"name": "ContractDefinition",
"src": "1446:3186:0"
}
],
"id": 203,
"name": "SourceUnit",
"src": "747:3886:0"
},
"compiler": {
"name": "solc",
"version": "soljson-v0.5.3+commit.10d17f24.js"
},
"networks": {
"5777": {
"events": {},
"links": {},
"address": "0xf0c0Df99c67297bAC2D4f582CaC5b74D1d544140",
"transactionHash": "0x6af84b2856d81514892daed62e963c1c11d167f5f888a1f26aa47e7d4948dcbd"
}
},
"schemaVersion": "3.0.1",
"updatedAt": "2019-02-07T20:38:06.018Z",
"devdoc": {
"methods": {
"allowedSupplyOf(address,address)": {
"details": "Get balance of bank that the sender is allowed to withdraw. ",
"params": {
"token": "Address of token to calculate total supply of."
}
},
"borrow(address,uint256)": {
"details": "Borrow tokens from the bank.TODO: borrow is a bad name. this doesn't enforce repayment",
"params": {
"amount": "Amount of token to borrow.",
"token": "Address of token to borrow. 0x0 for ETH"
}
},
"borrowAllowed(address)": {
"details": "Borrow as many tokens as possible from the bank.",
"params": {
"token": "Address of token to borrow. 0x0 for ETH"
}
},
"isOwner()": {
"return": "true if `msg.sender` is the owner of the contract."
},
"owner()": {
"return": "the address of the owner."
},
"pause()": {
"details": "called by the owner to pause, triggers stopped state"
},
"paused()": {
"return": "true if the contract is paused, false otherwise."
},
"renounceOwnership()": {
"details": "Allows the current owner to relinquish control of the contract."
},
"totalSupplyOf(address,address)": {
"details": "Gets balance of bank. ",
"params": {
"token": "Address of token to calculate total supply of."
}
},
"transferOwnership(address)": {
"details": "Allows the current owner to transfer control of the contract to a newOwner.",
"params": {
"newOwner": "The address to transfer ownership to."
}
},
"unpause()": {
"details": "called by the owner to unpause, returns to normal state"
},
"withdraw(address,uint256)": {
"details": "Withdraw tokens from the bank.TODO: who should this be limited to? onlyOwner is too strict",
"params": {
"amount": "Amount of token to withdraw.",
"token": "Address of token to withdraw. 0x0 for ETH"
}
}
}
},
"userdoc": {
"methods": {
"renounceOwnership()": {
"notice": "Renouncing to ownership will leave the contract without an owner. It will not be possible to call the functions with the `onlyOwner` modifier anymore."
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment