kleros-interaction-2
Version:
Smart contracts interacting with Kleros.
663 lines • 594 kB
JSON
{
"contractName": "BondingCurve",
"abi": [
{
"constant": true,
"inputs": [],
"name": "governor",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalETH",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokenContract",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "depositPointMap",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "spread",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalDepositPoints",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalTKN",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"name": "_tokenContract",
"type": "address"
},
{
"name": "_governor",
"type": "address"
},
{
"name": "_spread",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": false,
"inputs": [
{
"name": "_tkn",
"type": "uint256"
}
],
"name": "deposit",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "withdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_receiver",
"type": "address"
},
{
"name": "_minTKN",
"type": "uint256"
}
],
"name": "buy",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_from",
"type": "address"
},
{
"name": "_amount",
"type": "uint256"
},
{
"name": "",
"type": "address"
},
{
"name": "_extraData",
"type": "bytes"
}
],
"name": "receiveApproval",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_spread",
"type": "uint256"
}
],
"name": "setSpread",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_governor",
"type": "address"
}
],
"name": "setGovernor",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50604051606080610eb683398101604090815281516020830151919092015160008054600160a060020a03948516600160a060020a03199182161790915560028054949093169316929092179055600155610e46806100706000396000f3006080604052600436106100c45763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c340a2481146100c957806336bdee74146100fa5780633ccfd60b1461012157806355a373d61461013857806358cdb4ab1461014d5780635c25c76c1461016e5780637a4698e5146101835780637f0191dc146101985780638f4ffcb1146101ad578063b66a261c1461021d578063b6b55f2514610235578063c42cf53514610240578063cce7ec1314610261575b600080fd5b3480156100d557600080fd5b506100de610278565b60408051600160a060020a039092168252519081900360200190f35b34801561010657600080fd5b5061010f610287565b60408051918252519081900360200190f35b34801561012d57600080fd5b5061013661028d565b005b34801561014457600080fd5b506100de610420565b34801561015957600080fd5b5061010f600160a060020a036004351661042f565b34801561017a57600080fd5b5061010f610441565b34801561018f57600080fd5b5061010f610447565b3480156101a457600080fd5b5061010f61044d565b3480156101b957600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261013694600160a060020a038135811695602480359660443590931695369560849492019181908401838280828437509497506104539650505050505050565b34801561022957600080fd5b50610136600435610895565b6101366004356108fc565b34801561024c57600080fd5b50610136600160a060020a0360043516610b24565b610136600160a060020a0360043516602435610bb5565b600254600160a060020a031681565b60035481565b3360009081526006602052604081205460055460035491929182916102c8916102bc908663ffffffff610d6716565b9063ffffffff610d9616565b91506102e56005546102bc85600454610d6790919063ffffffff16565b336000818152600660209081526040808320839055600580548990039055825481517fa9059cbb0000000000000000000000000000000000000000000000000000000081526004810195909552602485018690529051949550600160a060020a03169363a9059cbb93604480820194918390030190829087803b15801561036b57600080fd5b505af115801561037f573d6000803e3d6000fd5b505050506040513d602081101561039557600080fd5b505115156103ed576040805160e560020a62461bcd02815260206004820152601460248201527f544b4e207472616e73666572206661696c65642e000000000000000000000000604482015290519081900360640190fd5b604051339083156108fc029084906000818181858888f1935050505015801561041a573d6000803e3d6000fd5b50505050565b600054600160a060020a031681565b60066020526000908152604090205481565b60015481565b60055481565b60045481565b6000805481908190600160a060020a03163381146104bb576040805160e560020a62461bcd02815260206004820152600d60248201527f57726f6e672063616c6c65722e00000000000000000000000000000000000000604482015290519081900360640190fd5b8451603814610514576040805160e560020a62461bcd02815260206004820152601e60248201527f657874726144617461206c656e67746820697320696e636f72726563742e0000604482015290519081900360640190fd5b84600081518110151561052357fe5b90602001015160f860020a900460f860020a02600160f860020a031916606260f860020a02148015610586575084600181518110151561055f57fe5b90602001015160f860020a900460f860020a02600160f860020a031916606360f860020a02145b80156105c3575084600281518110151561059c57fe5b90602001015160f860020a900460f860020a02600160f860020a031916607360f860020a02145b801561060057508460038151811015156105d957fe5b90602001015160f860020a900460f860020a02600160f860020a031916603160f860020a02145b1515610656576040805160e560020a62461bcd02815260206004820152601460248201527f457870656374206d61676963206e756d6265722e000000000000000000000000604482015290519081900360640190fd5b610661856004610dab565b935061066e856018610ddb565b92506106c861068a600154612710610dfb90919063ffffffff16565b6004546102bc906106a1908b63ffffffff610dfb16565b6102bc6127106106bc8d600354610d6790919063ffffffff16565b9063ffffffff610d6716565b915082821015610748576040805160e560020a62461bcd02815260206004820152602f60248201527f544b4e207072696365206d7573742062652061626f7665206d696e696d756d2060448201527f65787065637465642076616c75652e0000000000000000000000000000000000606482015290519081900360840190fd5b604051600160a060020a0385169083156108fc029084906000818181858888f1935050505015801561077e573d6000803e3d6000fd5b5060008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038c81166004830152306024830152604482018c9052915191909216926323b872dd92606480820193602093909283900390910190829087803b1580156107f757600080fd5b505af115801561080b573d6000803e3d6000fd5b505050506040513d602081101561082157600080fd5b50511515610879576040805160e560020a62461bcd02815260206004820152601d60248201527f426f6e64656420746f6b656e207472616e73666572206661696c65642e000000604482015290519081900360640190fd5b5060038054919091039055505060048054909301909255505050565b600254600160a060020a031633146108f7576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c792063616c6c61626c652062792074686520676f7665726e6f722e0000604482015290519081900360640190fd5b600155565b60045434906000908190819061091990859063ffffffff610d6716565b60035461092d90879063ffffffff610d6716565b141561093e578392508491506109c4565b60045461095290859063ffffffff610d6716565b60035461096690879063ffffffff610d6716565b11156109915783925061098a6003546102bc60045487610d6790919063ffffffff16565b91506109c4565b8491506109af6004546102bc60035488610d6790919063ffffffff16565b92506109c1848463ffffffff610e0816565b90505b60008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051600160a060020a03909216926323b872dd926064808401936020939083900390910190829087803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b505050506040513d6020811015610a6257600080fd5b50511515610aba576040805160e560020a62461bcd02815260206004820152601460248201527f544b4e207472616e73666572206661696c65642e000000000000000000000000604482015290519081900360640190fd5b600380548401905560048054830190556005805484019055336000908152600660205260408120805485019055811115610b1d57604051339082156108fc029083906000818181858888f19350505050158015610b1b573d6000803e3d6000fd5b505b5050505050565b600254600160a060020a03163314610b86576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c792063616c6c61626c652062792074686520676f7665726e6f722e0000604482015290519081900360640190fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000610c03610bd1600154612710610dfb90919063ffffffff16565b6003546102bc90610be8903463ffffffff610dfb16565b6102bc6127106106bc60045434610d6790919063ffffffff16565b905081811015610c5d576040805160e560020a62461bcd02815260206004820152601460248201527f50726963652065786365656473206c696d69742e000000000000000000000000604482015290519081900360640190fd5b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152602482018690529151919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610ccf57600080fd5b505af1158015610ce3573d6000803e3d6000fd5b505050506040513d6020811015610cf957600080fd5b50511515610d51576040805160e560020a62461bcd02815260206004820152601460248201527f544b4e207472616e73666572206661696c65642e000000000000000000000000604482015290519081900360640190fd5b6003805434019055600480549190910390555050565b6000821515610d7857506000610d90565b50818102818382811515610d8857fe5b0414610d9057fe5b92915050565b60008183811515610da357fe5b049392505050565b60008082601401845110151515610dc157600080fd5b505001602001516c01000000000000000000000000900490565b60008082602001845110151515610df157600080fd5b5050016020015190565b81810182811015610d9057fe5b600082821115610e1457fe5b509003905600a165627a7a72305820482d685901a735c40b93f9fa2e9a4695aed418348bb6723cbbeb4e5b90873d290029",
"deployedBytecode": "0x6080604052600436106100c45763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630c340a2481146100c957806336bdee74146100fa5780633ccfd60b1461012157806355a373d61461013857806358cdb4ab1461014d5780635c25c76c1461016e5780637a4698e5146101835780637f0191dc146101985780638f4ffcb1146101ad578063b66a261c1461021d578063b6b55f2514610235578063c42cf53514610240578063cce7ec1314610261575b600080fd5b3480156100d557600080fd5b506100de610278565b60408051600160a060020a039092168252519081900360200190f35b34801561010657600080fd5b5061010f610287565b60408051918252519081900360200190f35b34801561012d57600080fd5b5061013661028d565b005b34801561014457600080fd5b506100de610420565b34801561015957600080fd5b5061010f600160a060020a036004351661042f565b34801561017a57600080fd5b5061010f610441565b34801561018f57600080fd5b5061010f610447565b3480156101a457600080fd5b5061010f61044d565b3480156101b957600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261013694600160a060020a038135811695602480359660443590931695369560849492019181908401838280828437509497506104539650505050505050565b34801561022957600080fd5b50610136600435610895565b6101366004356108fc565b34801561024c57600080fd5b50610136600160a060020a0360043516610b24565b610136600160a060020a0360043516602435610bb5565b600254600160a060020a031681565b60035481565b3360009081526006602052604081205460055460035491929182916102c8916102bc908663ffffffff610d6716565b9063ffffffff610d9616565b91506102e56005546102bc85600454610d6790919063ffffffff16565b336000818152600660209081526040808320839055600580548990039055825481517fa9059cbb0000000000000000000000000000000000000000000000000000000081526004810195909552602485018690529051949550600160a060020a03169363a9059cbb93604480820194918390030190829087803b15801561036b57600080fd5b505af115801561037f573d6000803e3d6000fd5b505050506040513d602081101561039557600080fd5b505115156103ed576040805160e560020a62461bcd02815260206004820152601460248201527f544b4e207472616e73666572206661696c65642e000000000000000000000000604482015290519081900360640190fd5b604051339083156108fc029084906000818181858888f1935050505015801561041a573d6000803e3d6000fd5b50505050565b600054600160a060020a031681565b60066020526000908152604090205481565b60015481565b60055481565b60045481565b6000805481908190600160a060020a03163381146104bb576040805160e560020a62461bcd02815260206004820152600d60248201527f57726f6e672063616c6c65722e00000000000000000000000000000000000000604482015290519081900360640190fd5b8451603814610514576040805160e560020a62461bcd02815260206004820152601e60248201527f657874726144617461206c656e67746820697320696e636f72726563742e0000604482015290519081900360640190fd5b84600081518110151561052357fe5b90602001015160f860020a900460f860020a02600160f860020a031916606260f860020a02148015610586575084600181518110151561055f57fe5b90602001015160f860020a900460f860020a02600160f860020a031916606360f860020a02145b80156105c3575084600281518110151561059c57fe5b90602001015160f860020a900460f860020a02600160f860020a031916607360f860020a02145b801561060057508460038151811015156105d957fe5b90602001015160f860020a900460f860020a02600160f860020a031916603160f860020a02145b1515610656576040805160e560020a62461bcd02815260206004820152601460248201527f457870656374206d61676963206e756d6265722e000000000000000000000000604482015290519081900360640190fd5b610661856004610dab565b935061066e856018610ddb565b92506106c861068a600154612710610dfb90919063ffffffff16565b6004546102bc906106a1908b63ffffffff610dfb16565b6102bc6127106106bc8d600354610d6790919063ffffffff16565b9063ffffffff610d6716565b915082821015610748576040805160e560020a62461bcd02815260206004820152602f60248201527f544b4e207072696365206d7573742062652061626f7665206d696e696d756d2060448201527f65787065637465642076616c75652e0000000000000000000000000000000000606482015290519081900360840190fd5b604051600160a060020a0385169083156108fc029084906000818181858888f1935050505015801561077e573d6000803e3d6000fd5b5060008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a038c81166004830152306024830152604482018c9052915191909216926323b872dd92606480820193602093909283900390910190829087803b1580156107f757600080fd5b505af115801561080b573d6000803e3d6000fd5b505050506040513d602081101561082157600080fd5b50511515610879576040805160e560020a62461bcd02815260206004820152601d60248201527f426f6e64656420746f6b656e207472616e73666572206661696c65642e000000604482015290519081900360640190fd5b5060038054919091039055505060048054909301909255505050565b600254600160a060020a031633146108f7576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c792063616c6c61626c652062792074686520676f7665726e6f722e0000604482015290519081900360640190fd5b600155565b60045434906000908190819061091990859063ffffffff610d6716565b60035461092d90879063ffffffff610d6716565b141561093e578392508491506109c4565b60045461095290859063ffffffff610d6716565b60035461096690879063ffffffff610d6716565b11156109915783925061098a6003546102bc60045487610d6790919063ffffffff16565b91506109c4565b8491506109af6004546102bc60035488610d6790919063ffffffff16565b92506109c1848463ffffffff610e0816565b90505b60008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690529051600160a060020a03909216926323b872dd926064808401936020939083900390910190829087803b158015610a3857600080fd5b505af1158015610a4c573d6000803e3d6000fd5b505050506040513d6020811015610a6257600080fd5b50511515610aba576040805160e560020a62461bcd02815260206004820152601460248201527f544b4e207472616e73666572206661696c65642e000000000000000000000000604482015290519081900360640190fd5b600380548401905560048054830190556005805484019055336000908152600660205260408120805485019055811115610b1d57604051339082156108fc029083906000818181858888f19350505050158015610b1b573d6000803e3d6000fd5b505b5050505050565b600254600160a060020a03163314610b86576040805160e560020a62461bcd02815260206004820152601e60248201527f4f6e6c792063616c6c61626c652062792074686520676f7665726e6f722e0000604482015290519081900360640190fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000610c03610bd1600154612710610dfb90919063ffffffff16565b6003546102bc90610be8903463ffffffff610dfb16565b6102bc6127106106bc60045434610d6790919063ffffffff16565b905081811015610c5d576040805160e560020a62461bcd02815260206004820152601460248201527f50726963652065786365656473206c696d69742e000000000000000000000000604482015290519081900360640190fd5b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038781166004830152602482018690529151919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610ccf57600080fd5b505af1158015610ce3573d6000803e3d6000fd5b505050506040513d6020811015610cf957600080fd5b50511515610d51576040805160e560020a62461bcd02815260206004820152601460248201527f544b4e207472616e73666572206661696c65642e000000000000000000000000604482015290519081900360640190fd5b6003805434019055600480549190910390555050565b6000821515610d7857506000610d90565b50818102818382811515610d8857fe5b0414610d9057fe5b92915050565b60008183811515610da357fe5b049392505050565b60008082601401845110151515610dc157600080fd5b505001602001516c01000000000000000000000000900490565b60008082602001845110151515610df157600080fd5b5050016020015190565b81810182811015610d9057fe5b600082821115610e1457fe5b509003905600a165627a7a72305820482d685901a735c40b93f9fa2e9a4695aed418348bb6723cbbeb4e5b90873d290029",
"sourceMap": "651:8585:43:-;;;2185:185;8:9:-1;5:2;;;30:1;27;20:12;5:2;2185:185:43;;;;;;;;;;;;;;;;;;;;;;;;;2277:13;:30;;-1:-1:-1;;;;;2277:30:43;;;-1:-1:-1;;;;;;2277:30:43;;;;;;;2317:8;:20;;;;;;;;;;;;;;2277:30;2347:16;651:8585;;;;;;",
"deployedSourceMap": "651:8585:43:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1223:23;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1223:23:43;;;;;;;;-1:-1:-1;;;;;1223:23:43;;;;;;;;;;;;;;1347:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1347:20:43;;;;;;;;;;;;;;;;;;;;4971:475;;8:9:-1;5:2;;;30:1;27;20:12;5:2;4971:475:43;;;;;;917:34;;8:9:-1;5:2;;;30:1;27;20:12;5:2;917:34:43;;;;1537:46;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1537:46:43;-1:-1:-1;;;;;1537:46:43;;;;;1156:18;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1156:18:43;;;;1501:30;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1501:30:43;;;;1420:20;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1420:20:43;;;;7486:1249;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7486:1249:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;7486:1249:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7486:1249:43;;-1:-1:-1;7486:1249:43;;-1:-1:-1;;;;;;;7486:1249:43;8935:88;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8935:88:43;;;;;3100:1727;;;;;;9134:99;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;9134:99:43;-1:-1:-1;;;;;9134:99:43;;;;;5896:653;;-1:-1:-1;;;;;5896:653:43;;;;;;;1223:23;;;-1:-1:-1;;;;;1223:23:43;;:::o;1347:20::-;;;;:::o;4971:475::-;5047:10;5010:18;5031:27;;;:15;:27;;;;;;5120:18;;5088:8;;5031:27;;5010:18;;;5088:51;;:27;;5031;5088;:12;:27;:::i;:::-;:31;:51;:31;:51;:::i;:::-;5069:70;;5168:51;5200:18;;5168:27;5181:13;5168:8;;:12;;:27;;;;:::i;:51::-;5246:10;5260:1;5230:27;;;:15;:27;;;;;;;;:31;;;5271:18;:35;;;;;;;5325:13;;:47;;;;;;;;;;;;;;;;;;;;5149:70;;-1:-1:-1;;;;;;5325:13:43;;:22;;:47;;;;;;;;;;;;;:13;:47;;;5:2:-1;;;;30:1;27;20:12;5:2;5325:47:43;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5325:47:43;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;5325:47:43;5317:80;;;;;;;-1:-1:-1;;;;;5317:80:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;5407:32;;:10;;:32;;;;;5427:11;;5407:32;;;;5427:11;5407:10;:32;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;5407:32:43;4971:475;;;:::o;917:34::-;;;-1:-1:-1;;;;;917:34:43;;:::o;1537:46::-;;;;;;;;;;;;;:::o;1156:18::-;;;;:::o;1501:30::-;;;;:::o;1420:20::-;;;;:::o;7486:1249::-;7953:17;7581:13;;7953:17;;;;-1:-1:-1;;;;;7581:13:43;1841:10;:22;;1833:48;;;;;-1:-1:-1;;;;;1833:48:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;7614:17;;7635:2;7614:23;7606:66;;;;;-1:-1:-1;;;;;7606:66:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;7739:10;7750:1;7739:13;;;;;;;;;;;;;;;-1:-1:-1;;;7739:13:43;;-1:-1:-1;;;7739:13:43;-1:-1:-1;;;;;7739:19:43;;7754:4;-1:-1:-1;;;7739:19:43;;:61;;;;;7781:10;7792:1;7781:13;;;;;;;;;;;;;;;-1:-1:-1;;;7781:13:43;;-1:-1:-1;;;7781:13:43;-1:-1:-1;;;;;7781:19:43;;7796:4;-1:-1:-1;;;7781:19:43;;7739:61;:107;;;;;7827:10;7838:1;7827:13;;;;;;;;;;;;;;;-1:-1:-1;;;7827:13:43;;-1:-1:-1;;;7827:13:43;-1:-1:-1;;;;;7827:19:43;;7842:4;-1:-1:-1;;;7827:19:43;;7739:107;:153;;;;;7873:10;7884:1;7873:13;;;;;;;;;;;;;;;-1:-1:-1;;;7873:13:43;;-1:-1:-1;;;7873:13:43;-1:-1:-1;;;;;7873:19:43;;7888:4;-1:-1:-1;;;7873:19:43;;7739:153;7731:211;;;;;;;-1:-1:-1;;;;;7731:211:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;7973:33;7992:10;8004:1;7973:18;:33::i;:::-;7953:53;;8030:31;8046:10;8058:2;8030:15;:31::i;:::-;8016:45;;8333:113;8419:26;8438:6;;1212:5;8419:18;;:26;;;;:::i;:::-;8392:8;;8333:81;;8392:21;;8405:7;8392:21;:12;:21;:::i;:::-;8333:41;1212:5;8333:21;8346:7;8333:8;;:12;;:21;;;;:::i;:::-;:25;:41;:25;:41;:::i;:113::-;8322:124;-1:-1:-1;8465:13:43;;;;8457:73;;;;;-1:-1:-1;;;;;8457:73:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8540:23;;-1:-1:-1;;;;;8540:18:43;;;:23;;;;;8559:3;;8540:23;;;;8559:3;8540:18;:23;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;8581:13:43;;;:48;;;;;;-1:-1:-1;;;;;8581:48:43;;;;;;;8615:4;8581:48;;;;;;;;;;;;:13;;;;;:26;;:48;;;;;;;;;;;;;;;;;;:13;:48;;;5:2:-1;;;;30:1;27;20:12;5:2;8581:48:43;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;8581:48:43;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;8581:48:43;8573:90;;;;;;;-1:-1:-1;;;;;8573:90:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8674:8:43;:15;;;;;;;;-1:-1:-1;;8699:8:43;:19;;;;;;;;-1:-1:-1;;;7486:1249:43:o;8935:88::-;1938:8;;-1:-1:-1;;;;;1938:8:43;1924:10;:22;1916:65;;;;;-1:-1:-1;;;;;1916:65:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;9000:6;:16;8935:88::o;3100:1727::-;3631:8;;3167:9;;3155;;;;;;3622:18;;3167:9;;3622:18;:8;:18;:::i;:::-;3609:8;;3600:18;;:4;;:18;:8;:18;:::i;:::-;:40;3596:774;;;3947:4;3935:16;;3977:4;3965:16;;3596:774;;;4032:8;;4023:18;;:4;;:18;:8;:18;:::i;:::-;4011:8;;4002:18;;:4;;:18;:8;:18;:::i;:::-;:39;3998:372;;;4108:4;4096:16;;4138:32;4161:8;;4138:18;4147:8;;4138:4;:8;;:18;;;;:::i;:32::-;4126:44;;3998:372;;;4252:4;4240:16;;4282:32;4305:8;;4282:18;4291:8;;4282:4;:8;;:18;;;;:::i;:32::-;4270:44;-1:-1:-1;4340:19:43;:4;4270:44;4340:19;:8;:19;:::i;:::-;4328:31;;3998:372;4402:13;;;:55;;;;;;4429:10;4402:55;;;;4441:4;4402:55;;;;;;;;;;;;-1:-1:-1;;;;;4402:13:43;;;;:26;;:55;;;;;;;;;;;;;;;;;:13;:55;;;5:2:-1;;;;30:1;27;20:12;5:2;4402:55:43;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4402:55:43;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;4402:55:43;4394:88;;;;;;;-1:-1:-1;;;;;4394:88:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;4492:8;:21;;;;;;4523:8;:21;;;;;;4555:18;:31;;;;;;4612:10;4492:8;4596:27;;;:15;:27;;;;;:40;;;;;;4751:13;;4747:74;;;4780:30;;:10;;:30;;;;;4800:9;;4780:30;;;;4800:9;4780:10;:30;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4780:30:43;4747:74;3100:1727;;;;;:::o;9134:99::-;1938:8;;-1:-1:-1;;;;;1938:8:43;1924:10;:22;1916:65;;;;;-1:-1:-1;;;;;1916:65:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;9206:8;:20;;-1:-1:-1;;9206:20:43;-1:-1:-1;;;;;9206:20:43;;;;;;;;;;9134:99::o;5896:653::-;6219:8;6230:117;6320:26;6339:6;;1212:5;6320:18;;:26;;;;:::i;:::-;6291:8;;6230:85;;6291:23;;6304:9;6291:23;:12;:23;:::i;:::-;6230:43;1212:5;6230:23;6244:8;;6230:9;:13;;:23;;;;:::i;:117::-;6219:128;-1:-1:-1;6366:14:43;;;;6358:47;;;;;-1:-1:-1;;;;;6358:47:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;6423:13;;;:38;;;;;;-1:-1:-1;;;;;6423:38:43;;;;;;;;;;;;;;;:13;;;;;:22;;:38;;;;;;;;;;;;;;;;;;:13;:38;;;5:2:-1;;;;30:1;27;20:12;5:2;6423:38:43;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;6423:38:43;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;6423:38:43;6415:71;;;;;;;-1:-1:-1;;;;;6415:71:43;;;;;;;;;;;;;;;;;;;;;;;;;;;;6496:8;:21;;6508:9;6496:21;;;6527:8;:15;;;;;;;;-1:-1:-1;;5896:653:43:o;203:380:61:-;263:9;489:7;;485:36;;;-1:-1:-1;513:1:61;506:8;;485:36;-1:-1:-1;531:7:61;;;536:2;531;:7;551:6;;;;;;;;:12;544:20;;;;203:380;;;;:::o;665:283::-;725:7;941:2;936;:7;;;;;;;;;665:283;-1:-1:-1;;;665:283:61:o;11845:322:68:-;11915:7;11983:19;11960:6;11969:2;11960:11;11942:6;:13;:30;;11934:39;;;;;;;;-1:-1:-1;;12061:30:68;12077:4;12061:30;12055:37;12094:27;12051:71;;;11845:322::o;12173:276::-;12240:7;12308:16;12285:6;12294:2;12285:11;12267:6;:13;:30;;12259:39;;;;;;;;-1:-1:-1;;12376:30:68;12392:4;12376:30;12370:37;;12173:276::o;1238:128:61:-;1319:7;;;1339;;;;1332:15;;;1060:116;1120:7;1142:8;;;;1135:16;;;;-1:-1:-1;1164:7:61;;;1060:116::o",
"source": "/**\n * @title BondingCurve\n * @author Yushi Huang - <huang@kleros.io>\n * This contract implements a bonding curve to provide liquidity to a token-ether market.\n * The token in question is an ERC20 token and will be referred to as \"TKN\" below.\n * Bug Bounties: This code hasn't undertaken a bug bounty program yet.\n */\n\npragma solidity ^0.4.24;\n\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport { MiniMeTokenERC20 as TokenContract } from \"../arbitration/ArbitrableTokens/MiniMeTokenERC20.sol\";\nimport { ApproveAndCallFallBack } from \"minimetoken/contracts/MiniMeToken.sol\";\nimport \"solidity-bytes-utils/contracts/BytesLib.sol\";\n\ncontract BondingCurve is ApproveAndCallFallBack {\n\n using SafeMath for uint;\n\n // **************************** //\n // * Contract variables * //\n // **************************** //\n\n // Variables which should not change after initialization.\n TokenContract public tokenContract;\n\n // Variables which are subject to the governance mechanism.\n // Spread factor charged when buying and selling. Divided by SPREAD_DIVISOR.\n // For example, 100 means 100/10000 = 1% spread.\n uint public spread; \n uint constant SPREAD_DIVISOR = 10000;\n address public governor; // Address of the governor contract.\n\n // Variables changing during day to day interaction.\n uint public totalETH; // The amount of Ether the bonding curve owns.\n uint public totalTKN; // The amount of bonded token the bonding curve owns.\n\n uint public totalDepositPoints;\n mapping (address=>uint) public depositPointMap; // Contribution of each market maker. Invariant: sum of all values == totalDepositPoints.\n\n // **************************** //\n // * Modifiers * //\n // **************************** //\n\n modifier onlyBy(address _account) {require(msg.sender == _account, \"Wrong caller.\"); _;}\n modifier onlyGovernor() {require(msg.sender == governor, \"Only callable by the governor.\"); _;}\n\n /** @dev Constructor.\n * @param _tokenContract The address of the token contract.\n * @param _governor The address of the governor contract.\n * @param _spread Spread.\n */\n constructor(TokenContract _tokenContract, address _governor, uint _spread) public {\n tokenContract = _tokenContract;\n governor = _governor;\n spread = _spread;\n }\n\n \n // ******************************** //\n // * Market Maker Functions * //\n // ******************************** //\n /** @dev Deposit ETH and TKN. The transaction value is the intended amount of ETH. A parameter designates the intended amount of TKN. The caller must have approved of at least this amount of TKN to this contract (using approve() method of ERC20 interface). The actually amount of ETH and TKN taken must be of certain ratio. If intended TKN is excessive, only the proper portion of the approved amount is take. If inteded ETH is excessive, it is refunded, in which case the caller account must accept payment. TRUSTED.\n * @param _tkn Intended amount of TKN to be deposited.\n */\n function deposit(uint _tkn) external payable {\n uint _eth = msg.value;\n\n // The actually deposited amounts of ETH and TKN must satisfy:\n // p / e = totalTKN / totalETH\n // We expect the numbers to be within a range in which the multiplications won't overflow uint256.\n uint actualETH; // Actual amount of ETH to be deposited.\n uint actualTKN; // Actual amount of TKN to be deposited.\n uint refundETH = 0; // Amount of ETH to be refunded.\n\n if (_tkn.mul(totalETH) == _eth.mul(totalTKN)) {\n // Note that initially totalETH==totalTKN==0 so the first deposit is handled here where it allows any amounts of TKN and ETH to be deposited. We expect the ratio to reflect the market price at the moment because otherwise there is an immediate arbitrage opportunity.\n actualETH = _eth;\n actualTKN = _tkn;\n } else if (_tkn.mul(totalETH) > _eth.mul(totalTKN)) {\n // There is excessive TKN.\n actualETH = _eth;\n actualTKN = _eth.mul(totalTKN).div(totalETH);\n } else {\n // There is excessive ETH.\n actualTKN = _tkn;\n actualETH = _tkn.mul(totalETH).div(totalTKN);\n refundETH = _eth.sub(actualETH);\n } \n\n require(tokenContract.transferFrom(msg.sender, this, actualTKN), \"TKN transfer failed.\");\n totalETH += actualETH;\n totalTKN += actualTKN;\n\n totalDepositPoints += actualETH;\n depositPointMap[msg.sender] += actualETH;\n\n // Refund ETH if necessary. No need to refund TKN because we transferred the actual amount.\n if (refundETH > 0) {\n msg.sender.transfer(refundETH);\n }\n }\n\n /** @dev Withdraw ETH and TKN deposited by the caller. \n * Maintain the ratio of totalETH / totalTKN unchanged. TRUSTED.\n */\n function withdraw() external {\n uint depositPoints = depositPointMap[msg.sender];\n\n uint ethWithdraw = totalETH.mul(depositPoints).div(totalDepositPoints);\n uint tknWithdraw = totalTKN.mul(depositPoints).div(totalDepositPoints);\n\n depositPointMap[msg.sender] = 0;\n totalDepositPoints -= depositPoints;\n\n require(tokenContract.transfer(msg.sender, tknWithdraw), \"TKN transfer failed.\");\n msg.sender.transfer(ethWithdraw);\n }\n\n // ************************ //\n // * User Functions * //\n // ************************ //\n /** @dev Buy TKN with ETH. TRUSTED.\n * @param _receiver The account the bought TKN is accredited to.\n * @param _minTKN Minimum amount of TKN expected in return. If the price of TKN relative to ETH hikes so much before the transaction is mined that the contract could not give minTKN TKN to the buyer, it will revert.\n */\n function buy(address _receiver, uint _minTKN) external payable {\n // Calculate the amount of TKN that should be paid to the buyer:\n // To maintain (totalETH+msg.value)*(totalTKN-tkn) == totalETH*totalTKN \n // we get tkn = msg.value * totalTKN / (totalETH+msg.value), then we charge the spread.\n uint tkn = msg.value.mul(totalTKN).mul(SPREAD_DIVISOR)\n .div(totalETH.add(msg.value)).div(SPREAD_DIVISOR.add(spread));\n\n require(tkn >= _minTKN, \"Price exceeds limit.\");\n require(tokenContract.transfer(_receiver, tkn), \"TKN transfer failed.\");\n totalETH += msg.value;\n totalTKN -= tkn;\n }\n\n // To sell TKN, the user must call approveAndCall() on the token account, with parameters: (address _spender, uint256 _amount, bytes _extraData).\n // _spender must be this contract.\n // _amount is the amount of TKN the user wishes to sell.\n // _extraData 0~3 bytes must be the string \"bcs1\".\n // 4~23 bytes is the recipient address of ETH.\n // 24~55 bytes is an uint256 representing the minimum amount of ETH the seller wishes to receive. If by the time the transaction is mined the price of TKN drops so that the contract could not give the seller at least this amount, the transaction is reverted.\n /** @dev Callback of approveAndCall - the only use case is to sell TKN. Should be called by the token contract. TRUSTED.\n * @param _from The address of seller.\n * @param _amount The amount of TKN to sell.\n * @param _extraData Packed bytes according to above spec.\n */\n function receiveApproval(address _from, uint _amount, address, bytes _extraData) public onlyBy(tokenContract) {\n require(_extraData.length == 56, \"extraData length is incorrect.\");\n\n // solium-disable-next-line indentation\n require(_extraData[0]==0x62 && // 'b'\n _extraData[1]==0x63 && // 'c'\n _extraData[2]==0x73 && // 's'\n _extraData[3]==0x31, // '1'\n \"Expect magic number.\");\n\n address recipient = BytesLib.toAddress(_extraData, 4);\n uint minETH = BytesLib.toUint(_extraData, 24);\n\n // Calculate the amount of ETH that should be paid to seller:\n // To maintain (totalETH - eth)*(totalTKN+_amount) == totalETH*totalTKN\n // we get eth = totalETH * _amount / (totalTKN + _amount)\n // Then charge a spread. \n uint eth = totalETH.mul(_amount).mul(SPREAD_DIVISOR)\n .div(totalTKN.add(_amount)).div(SPREAD_DIVISOR.add(spread));\n\n require(eth >= minETH, \"TKN price must be above minimum expected value.\");\n recipient.transfer(eth);\n require(tokenContract.transferFrom(_from, this, _amount), \"Bonded token transfer failed.\");\n\n totalETH -= eth;\n totalTKN += _amount; \n }\n\n // **************************** //\n // * Governor Functions * //\n // **************************** //\n\n /** @dev Setter for spread.\n * @param _spread The spread.\n */\n function setSpread(uint _spread) external onlyGovernor {\n spread = _spread;\n }\n\n /** @dev Setter for governor.\n * @param _governor The address of the governor contract.\n */\n function setGovernor(address _governor) external onlyGovernor {\n governor = _governor;\n }\n\n}\n",
"sourcePath": "/private/tmp/kleros-interaction/contracts/standard/bonding-curve/BondingCurve.sol",
"ast": {
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/bonding-curve/BondingCurve.sol",
"exportedSymbols": {
"BondingCurve": [
13762
]
},
"id": 13763,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 13293,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "324:24:43"
},
{
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"file": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"id": 13294,
"nodeType": "ImportDirective",
"scope": 13763,
"sourceUnit": 19847,
"src": "350:59:43",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "/private/tmp/kleros-interaction/contracts/standard/arbitration/ArbitrableTokens/MiniMeTokenERC20.sol",
"file": "../arbitration/ArbitrableTokens/MiniMeTokenERC20.sol",
"id": 13296,
"nodeType": "ImportDirective",
"scope": 13763,
"sourceUnit": 3767,
"src": "410:105:43",
"symbolAliases": [
{
"foreign": 13295,
"local": "TokenContract"
}
],
"unitAlias": ""
},
{
"absolutePath": "minimetoken/contracts/MiniMeToken.sol",
"file": "minimetoken/contracts/MiniMeToken.sol",
"id": 13298,
"nodeType": "ImportDirective",
"scope": 13763,
"sourceUnit": 19661,
"src": "516:79:43",
"symbolAliases": [
{
"foreign": 13297,
"local": null
}
],
"unitAlias": ""
},
{
"absolutePath": "solidity-bytes-utils/contracts/BytesLib.sol",
"file": "solidity-bytes-utils/contracts/BytesLib.sol",
"id": 13299,
"nodeType": "ImportDirective",
"scope": 13763,
"sourceUnit": 20625,
"src": "596:53:43",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 13300,
"name": "ApproveAndCallFallBack",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 18605,
"src": "676:22:43",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ApproveAndCallFallBack_$18605",
"typeString": "contract ApproveAndCallFallBack"
}
},
"id": 13301,
"nodeType": "InheritanceSpecifier",
"src": "676:22:43"
}
],
"contractDependencies": [
18605
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 13762,
"linearizedBaseContracts": [
13762,
18605
],
"name": "BondingCurve",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 13304,
"libraryName": {
"contractScope": null,
"id": 13302,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 19846,
"src": "712:8:43",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$19846",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "706:24:43",
"typeName": {
"id": 13303,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "725:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"constant": false,
"id": 13306,
"name": "tokenContract",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "917:34:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_MiniMeTokenERC20_$3766",
"typeString": "contract MiniMeTokenERC20"
},
"typeName": {
"contractScope": null,
"id": 13305,
"name": "TokenContract",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3766,
"src": "917:13:43",
"typeDescriptions": {
"typeIdentifier": "t_contract$_MiniMeTokenERC20_$3766",
"typeString": "contract MiniMeTokenERC20"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 13308,
"name": "spread",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1156:18:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13307,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1156:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": true,
"id": 13311,
"name": "SPREAD_DIVISOR",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1181:36:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13309,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1181:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": {
"argumentTypes": null,
"hexValue": "3130303030",
"id": 13310,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1212:5:43",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_10000_by_1",
"typeString": "int_const 10000"
},
"value": "10000"
},
"visibility": "internal"
},
{
"constant": false,
"id": 13313,
"name": "governor",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1223:23:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13312,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1223:7:43",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 13315,
"name": "totalETH",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1347:20:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13314,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1347:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 13317,
"name": "totalTKN",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1420:20:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13316,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1420:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 13319,
"name": "totalDepositPoints",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1501:30:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13318,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1501:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "public"
},
{
"constant": false,
"id": 13323,
"name": "depositPointMap",
"nodeType": "VariableDeclaration",
"scope": 13762,
"src": "1537:46:43",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"typeName": {
"id": 13322,
"keyType": {
"id": 13320,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1546:7:43",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "1537:23:43",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_uint256_$",
"typeString": "mapping(address => uint256)"
},
"valueType": {
"id": 13321,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "1555:4:43",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
"value": null,
"visibility": "public"
},
{
"body": {
"id": 13336,
"nodeType": "Block",
"src": "1832:54:43",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 13331,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 13328,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20639,
"src": "1841:3:43",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 13329,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1841:10:43",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rig