Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
Discount
Compiler Version
v0.8.10+commit.fc410830
Contract Source Code (Solidity)
/** *Submitted for verification at Arbiscan on 2022-05-17 */ // SPDX-License-Identifier: MIT pragma solidity =0.8.10; contract Discount { address public owner; mapping(address => CustomServiceFee) public serviceFees; uint256 constant MAX_SERVICE_FEE = 400; error OnlyOwner(); error WrongFeeValue(); struct CustomServiceFee { bool active; uint256 amount; } constructor() { owner = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08; } function isCustomFeeSet(address _user) public view returns (bool) { return serviceFees[_user].active; } function getCustomServiceFee(address _user) public view returns (uint256) { return serviceFees[_user].amount; } function setServiceFee(address _user, uint256 _fee) public { if (msg.sender != owner){ revert OnlyOwner(); } if (!(_fee >= MAX_SERVICE_FEE || _fee == 0)){ revert WrongFeeValue(); } serviceFees[_user] = CustomServiceFee({active: true, amount: _fee}); } function disableServiceFee(address _user) public { if (msg.sender != owner){ revert OnlyOwner(); } serviceFees[_user] = CustomServiceFee({active: false, amount: 0}); } }
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"WrongFeeValue","type":"error"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"disableServiceFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getCustomServiceFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isCustomFeeSet","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"serviceFees","outputs":[{"internalType":"bool","name":"active","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_fee","type":"uint256"}],"name":"setServiceFee","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50600080546001600160a01b03191673322d58b9e75a6918f7e7849aee0ff09369977e08179055610320806100466000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630938ee40146100675780636eeb5431146100b05780638da5cb5b146100eb578063b371deac14610116578063d0173c3314610152578063ef2fa16914610167575b600080fd5b61009461007536600461029e565b6001602081905260009182526040909120805491015460ff9091169082565b6040805192151583526020830191909152015b60405180910390f35b6100dd6100be36600461029e565b6001600160a01b03166000908152600160208190526040909120015490565b6040519081526020016100a7565b6000546100fe906001600160a01b031681565b6040516001600160a01b0390911681526020016100a7565b61014261012436600461029e565b6001600160a01b031660009081526001602052604090205460ff1690565b60405190151581526020016100a7565b61016561016036600461029e565b61017a565b005b6101656101753660046102c0565b6101e7565b6000546001600160a01b031633146101a557604051635fc483c560e01b815260040160405180910390fd5b604080518082018252600080825260208083018281526001600160a01b039590951682526001908190529290209051815460ff19169015151781559151910155565b6000546001600160a01b0316331461021257604051635fc483c560e01b815260040160405180910390fd5b61019081101580610221575080155b61023e5760405163fccb470d60e01b815260040160405180910390fd5b604080518082018252600180825260208083019485526001600160a01b0395909516600090815294819052919093209251835460ff19169015151783559051910155565b80356001600160a01b038116811461029957600080fd5b919050565b6000602082840312156102b057600080fd5b6102b982610282565b9392505050565b600080604083850312156102d357600080fd5b6102dc83610282565b94602093909301359350505056fea26469706673582212203eabfa89de49b210fc66e006dd84ce7ff52c9713211be8aaabd59c88ba226e1a64736f6c634300080a0033
Deployed ByteCode Sourcemap
61:1209:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;113:55;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;576:14:1;;569:22;551:41;;623:2;608:18;;601:34;;;;524:18;113:55:0;;;;;;;;581:125;;;;;;:::i;:::-;-1:-1:-1;;;;;673:18:0;646:7;673:18;;;:11;:18;;;;;;;;:25;;;581:125;;;;792:25:1;;;780:2;765:18;581:125:0;646:177:1;86:20:0;;;;;-1:-1:-1;;;;;86:20:0;;;;;;-1:-1:-1;;;;;992:32:1;;;974:51;;962:2;947:18;86:20:0;828:203:1;456:117:0;;;;;;:::i;:::-;-1:-1:-1;;;;;540:18:0;516:4;540:18;;;:11;:18;;;;;:25;;;;456:117;;;;1201:14:1;;1194:22;1176:41;;1164:2;1149:18;456:117:0;1036:187:1;1053:214:0;;;;;;:::i;:::-;;:::i;:::-;;714:331;;;;;;:::i;:::-;;:::i;1053:214::-;1131:5;;-1:-1:-1;;;;;1131:5:0;1117:10;:19;1113:69;;1159:11;;-1:-1:-1;;;1159:11:0;;;;;;;;;;;1113:69;1215:44;;;;;;;;-1:-1:-1;1215:44:0;;;;;;;;;;-1:-1:-1;;;;;1194:18:0;;;;;;1215:44;1194:18;;;;;;;:65;;;;-1:-1:-1;;1194:65:0;;;;;;;;;;;;1053:214::o;714:331::-;802:5;;-1:-1:-1;;;;;802:5:0;788:10;:19;784:69;;830:11;;-1:-1:-1;;;830:11:0;;;;;;;;;;;784:69;212:3;871:4;:23;;:36;;;-1:-1:-1;898:9:0;;871:36;865:93;;931:15;;-1:-1:-1;;;931:15:0;;;;;;;;;;;865:93;991:46;;;;;;;;1017:4;991:46;;;;;;;;;;-1:-1:-1;;;;;970:18:0;;;;-1:-1:-1;970:18:0;;;;;;;;;;;:67;;;;-1:-1:-1;;970:67:0;;;;;;;;;;;;714:331::o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:186::-;251:6;304:2;292:9;283:7;279:23;275:32;272:52;;;320:1;317;310:12;272:52;343:29;362:9;343:29;:::i;:::-;333:39;192:186;-1:-1:-1;;;192:186:1:o;1228:254::-;1296:6;1304;1357:2;1345:9;1336:7;1332:23;1328:32;1325:52;;;1373:1;1370;1363:12;1325:52;1396:29;1415:9;1396:29;:::i;:::-;1386:39;1472:2;1457:18;;;;1444:32;;-1:-1:-1;;;1228:254:1:o
Metadata Hash
3eabfa89de49b210fc66e006dd84ce7ff52c9713211be8aaabd59c88ba226e1a
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.