Cleanup
This commit is contained in:
parent
d8147bd58e
commit
545887baec
@ -19,6 +19,7 @@
|
||||
│ │ └── ERC20.sol
|
||||
│ └── utils
|
||||
│ ├── MerkleProofLib.sol
|
||||
│ ├── Multicall.sol
|
||||
│ ├── ReentrancyGuard.sol
|
||||
│ └── SafeTransferLib.sol
|
||||
├── p2pix.sol
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../build-info/906fc0dd8b27e18481e135d1f328d0ae.json"
|
||||
}
|
||||
|
@ -8,25 +8,6 @@
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "user",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnerUpdated",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
@ -71,36 +52,10 @@
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"internalType": "address",
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "setOwner",
|
||||
"outputs": [],
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
}
|
||||
],
|
||||
"bytecode": "0x6080806040523461004f57600080546001600160a01b031916339081178255907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a361043e90816100558239f35b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826313af4035146102f6575081631a861d26146102ba5781634d2b1791146100ec575080638da5cb5b1461009c5763a4b345571461005c57600080fd5b3461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985760209051643a352944008152f35b5080fd5b503461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b8383346100985760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261009857823591620f4240838102908104840361028e578380029380850481149015171561028e57643a3529440093840180941161028e5760b58471010000000000000000000000000000000000811015610277575b8069010000000000000000006201000092101561026b575b6501000000000081101561025e575b6301000000811015610251575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146102255703900483018093116101f9576020838351908152f35b806011857f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b6024846012897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b916101a3565b60201c9160101b91610196565b851c9160201b91610187565b5068b500000000000000009050608085901c61016f565b6024826011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b50503461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985760209051620f42408152f35b8491346104045760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104045780359173ffffffffffffffffffffffffffffffffffffffff9182841680940361040057845492831633036103a55750507fffffffffffffffffffffffff00000000000000000000000000000000000000001681178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b9060206064927f08c379a0000000000000000000000000000000000000000000000000000000008352820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b8480fd5b8280fdfea2646970667358221220ebc26f1432d13f128c50ef3a8297ef65a17fc376c17056b77b447e21b462442464736f6c63430008130033",
|
||||
"deployedBytecode": "0x608060408181526004918236101561001657600080fd5b600092833560e01c91826313af4035146102f6575081631a861d26146102ba5781634d2b1791146100ec575080638da5cb5b1461009c5763a4b345571461005c57600080fd5b3461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985760209051643a352944008152f35b5080fd5b503461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b8383346100985760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261009857823591620f4240838102908104840361028e578380029380850481149015171561028e57643a3529440093840180941161028e5760b58471010000000000000000000000000000000000811015610277575b8069010000000000000000006201000092101561026b575b6501000000000081101561025e575b6301000000811015610251575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146102255703900483018093116101f9576020838351908152f35b806011857f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b6024846012897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b916101a3565b60201c9160101b91610196565b851c9160201b91610187565b5068b500000000000000009050608085901c61016f565b6024826011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b50503461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985760209051620f42408152f35b8491346104045760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104045780359173ffffffffffffffffffffffffffffffffffffffff9182841680940361040057845492831633036103a55750507fffffffffffffffffffffffff00000000000000000000000000000000000000001681178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b9060206064927f08c379a0000000000000000000000000000000000000000000000000000000008352820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b8480fd5b8280fdfea2646970667358221220ebc26f1432d13f128c50ef3a8297ef65a17fc376c17056b77b447e21b462442464736f6c63430008130033",
|
||||
"bytecode": "0x60808060405234610016576102c9908161001c8239f35b600080fdfe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033",
|
||||
"deployedBytecode": "0x6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033",
|
||||
"linkReferences": {},
|
||||
"deployedLinkReferences": {}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../../../build-info/b608b6eb28957aeb71328924500ce935.json"
|
||||
}
|
||||
|
@ -3,6 +3,11 @@
|
||||
"contractName": "Owned",
|
||||
"sourceName": "contracts/lib/auth/Owned.sol",
|
||||
"abi": [
|
||||
{
|
||||
"inputs": [],
|
||||
"name": "Unauthorized",
|
||||
"type": "error"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"_format": "hh-sol-dbg-1",
|
||||
"buildInfo": "../../build-info/cec3ec245aa8292dcd32990ec72987ab.json"
|
||||
"buildInfo": "../../build-info/b608b6eb28957aeb71328924500ce935.json"
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -2,9 +2,8 @@
|
||||
pragma solidity 0.8.19;
|
||||
|
||||
import { IReputation } from "./lib/interfaces/IReputation.sol";
|
||||
import { Owned } from "./lib/auth/Owned.sol";
|
||||
|
||||
contract Reputation is IReputation, Owned(msg.sender) {
|
||||
contract Reputation is IReputation {
|
||||
/// @dev Asymptote numerator constant value for the `limiter` fx.
|
||||
uint256 public constant maxLimit = 1e6;
|
||||
/// @dev Denominator's constant operand for the `limiter` fx.
|
||||
|
@ -4,6 +4,8 @@ pragma solidity >=0.8.4;
|
||||
/// @notice Simple single owner authorization mixin.
|
||||
/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/auth/Owned.sol)
|
||||
abstract contract Owned {
|
||||
error Unauthorized();
|
||||
|
||||
/*//////////////////////////////////////////////////////////////
|
||||
EVENTS
|
||||
//////////////////////////////////////////////////////////////*/
|
||||
@ -20,7 +22,7 @@ abstract contract Owned {
|
||||
address public owner;
|
||||
|
||||
modifier onlyOwner() virtual {
|
||||
require(msg.sender == owner, "UNAUTHORIZED");
|
||||
if (msg.sender != owner) revert Unauthorized();
|
||||
|
||||
_;
|
||||
}
|
||||
|
@ -74,17 +74,6 @@ const config: HardhatUserConfig = {
|
||||
goerli: process.env.ETHERSCAN_API_KEY || "",
|
||||
polygonMumbai: process.env.POLYGONSCAN_API_KEY || "",
|
||||
},
|
||||
// customChains: [
|
||||
// {
|
||||
// // network: {INSERT_NAME},
|
||||
// // chainId: {INSERT_ID},
|
||||
// // urls: {
|
||||
// // apiURL:
|
||||
// // "{INSERT_URL}",
|
||||
// // browserURL: "{INSERT_URL}",
|
||||
// // },
|
||||
// },
|
||||
// ],
|
||||
},
|
||||
gasReporter: {
|
||||
enabled: !!(
|
||||
|
@ -7,17 +7,11 @@ import type {
|
||||
BigNumberish,
|
||||
BytesLike,
|
||||
CallOverrides,
|
||||
ContractTransaction,
|
||||
Overrides,
|
||||
PopulatedTransaction,
|
||||
Signer,
|
||||
utils,
|
||||
} from "ethers";
|
||||
import type {
|
||||
FunctionFragment,
|
||||
Result,
|
||||
EventFragment,
|
||||
} from "@ethersproject/abi";
|
||||
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
||||
import type { Listener, Provider } from "@ethersproject/providers";
|
||||
import type {
|
||||
TypedEventFilter,
|
||||
@ -32,17 +26,10 @@ export interface ReputationInterface extends utils.Interface {
|
||||
"limiter(uint256)": FunctionFragment;
|
||||
"magicValue()": FunctionFragment;
|
||||
"maxLimit()": FunctionFragment;
|
||||
"owner()": FunctionFragment;
|
||||
"setOwner(address)": FunctionFragment;
|
||||
};
|
||||
|
||||
getFunction(
|
||||
nameOrSignatureOrTopic:
|
||||
| "limiter"
|
||||
| "magicValue"
|
||||
| "maxLimit"
|
||||
| "owner"
|
||||
| "setOwner"
|
||||
nameOrSignatureOrTopic: "limiter" | "magicValue" | "maxLimit"
|
||||
): FunctionFragment;
|
||||
|
||||
encodeFunctionData(
|
||||
@ -54,36 +41,14 @@ export interface ReputationInterface extends utils.Interface {
|
||||
values?: undefined
|
||||
): string;
|
||||
encodeFunctionData(functionFragment: "maxLimit", values?: undefined): string;
|
||||
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
||||
encodeFunctionData(
|
||||
functionFragment: "setOwner",
|
||||
values: [PromiseOrValue<string>]
|
||||
): string;
|
||||
|
||||
decodeFunctionResult(functionFragment: "limiter", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "magicValue", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "maxLimit", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
||||
decodeFunctionResult(functionFragment: "setOwner", data: BytesLike): Result;
|
||||
|
||||
events: {
|
||||
"OwnerUpdated(address,address)": EventFragment;
|
||||
};
|
||||
|
||||
getEvent(nameOrSignatureOrTopic: "OwnerUpdated"): EventFragment;
|
||||
events: {};
|
||||
}
|
||||
|
||||
export interface OwnerUpdatedEventObject {
|
||||
user: string;
|
||||
newOwner: string;
|
||||
}
|
||||
export type OwnerUpdatedEvent = TypedEvent<
|
||||
[string, string],
|
||||
OwnerUpdatedEventObject
|
||||
>;
|
||||
|
||||
export type OwnerUpdatedEventFilter = TypedEventFilter<OwnerUpdatedEvent>;
|
||||
|
||||
export interface Reputation extends BaseContract {
|
||||
connect(signerOrProvider: Signer | Provider | string): this;
|
||||
attach(addressOrName: string): this;
|
||||
@ -119,13 +84,6 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<[BigNumber]>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<[string]>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
};
|
||||
|
||||
limiter(
|
||||
@ -137,13 +95,6 @@ export interface Reputation extends BaseContract {
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<ContractTransaction>;
|
||||
|
||||
callStatic: {
|
||||
limiter(
|
||||
_userCredit: PromiseOrValue<BigNumberish>,
|
||||
@ -153,25 +104,9 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<string>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: CallOverrides
|
||||
): Promise<void>;
|
||||
};
|
||||
|
||||
filters: {
|
||||
"OwnerUpdated(address,address)"(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
OwnerUpdated(
|
||||
user?: PromiseOrValue<string> | null,
|
||||
newOwner?: PromiseOrValue<string> | null
|
||||
): OwnerUpdatedEventFilter;
|
||||
};
|
||||
filters: {};
|
||||
|
||||
estimateGas: {
|
||||
limiter(
|
||||
@ -182,13 +117,6 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<BigNumber>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<BigNumber>;
|
||||
};
|
||||
|
||||
populateTransaction: {
|
||||
@ -200,12 +128,5 @@ export interface Reputation extends BaseContract {
|
||||
magicValue(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
maxLimit(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
owner(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
||||
|
||||
setOwner(
|
||||
newOwner: PromiseOrValue<string>,
|
||||
overrides?: Overrides & { from?: PromiseOrValue<string> }
|
||||
): Promise<PopulatedTransaction>;
|
||||
};
|
||||
}
|
||||
|
@ -12,25 +12,6 @@ const _abi = [
|
||||
stateMutability: "nonpayable",
|
||||
type: "constructor",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "user",
|
||||
type: "address",
|
||||
},
|
||||
{
|
||||
indexed: true,
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "OwnerUpdated",
|
||||
type: "event",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
@ -76,36 +57,10 @@ const _abi = [
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [],
|
||||
name: "owner",
|
||||
outputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
stateMutability: "view",
|
||||
type: "function",
|
||||
},
|
||||
{
|
||||
inputs: [
|
||||
{
|
||||
internalType: "address",
|
||||
name: "newOwner",
|
||||
type: "address",
|
||||
},
|
||||
],
|
||||
name: "setOwner",
|
||||
outputs: [],
|
||||
stateMutability: "nonpayable",
|
||||
type: "function",
|
||||
},
|
||||
];
|
||||
|
||||
const _bytecode =
|
||||
"0x6080806040523461004f57600080546001600160a01b031916339081178255907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768180a361043e90816100558239f35b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826313af4035146102f6575081631a861d26146102ba5781634d2b1791146100ec575080638da5cb5b1461009c5763a4b345571461005c57600080fd5b3461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985760209051643a352944008152f35b5080fd5b503461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b8383346100985760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261009857823591620f4240838102908104840361028e578380029380850481149015171561028e57643a3529440093840180941161028e5760b58471010000000000000000000000000000000000811015610277575b8069010000000000000000006201000092101561026b575b6501000000000081101561025e575b6301000000811015610251575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146102255703900483018093116101f9576020838351908152f35b806011857f4e487b71000000000000000000000000000000000000000000000000000000006024945252fd5b6024846012897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b916101a3565b60201c9160101b91610196565b851c9160201b91610187565b5068b500000000000000009050608085901c61016f565b6024826011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b50503461009857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100985760209051620f42408152f35b8491346104045760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104045780359173ffffffffffffffffffffffffffffffffffffffff9182841680940361040057845492831633036103a55750507fffffffffffffffffffffffff00000000000000000000000000000000000000001681178255337f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d768380a380f35b9060206064927f08c379a0000000000000000000000000000000000000000000000000000000008352820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fd5b8480fd5b8280fdfea2646970667358221220ebc26f1432d13f128c50ef3a8297ef65a17fc376c17056b77b447e21b462442464736f6c63430008130033";
|
||||
"0x60808060405234610016576102c9908161001c8239f35b600080fdfe6080806040526004908136101561001557600080fd5b600091823560e01c9182631a861d2614610254575081634d2b179114610085575063a4b345571461004557600080fd5b3461008257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc360112610082576020604051643a352944008152f35b80fd5b82346100825760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261008257813591620f42408381029081048403610228578380029380850481149015171561022857643a352944009384018094116102285760b58471010000000000000000000000000000000000811015610211575b80690100000000000000000062010000921015610204575b650100000000008110156101f7575b63010000008110156101ea575b010260121c9360019480820401851c80820401851c80820401851c80820401851c80820401851c80820401851c80820401851c8080920410908181146101be57039004830180931161019257602083604051908152f35b9060116024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b6024856012867f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b60101c9160081b9161013b565b60201c9160101b9161012e565b60401c9160201b9161011f565b5068b500000000000000009050608085901c610107565b6024836011847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b83903461028f57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261028f5780620f424060209252f35b5080fdfea26469706673582212201f57ae0c5884bdde41f85c3510ca33502ea7408e92d2669d2cb4da374119f5e064736f6c63430008130033";
|
||||
|
||||
type ReputationConstructorParams =
|
||||
| [signer?: Signer]
|
||||
|
@ -7,6 +7,11 @@ import type { Provider } from "@ethersproject/providers";
|
||||
import type { Owned, OwnedInterface } from "../../../lib/auth/Owned";
|
||||
|
||||
const _abi = [
|
||||
{
|
||||
inputs: [],
|
||||
name: "Unauthorized",
|
||||
type: "error",
|
||||
},
|
||||
{
|
||||
anonymous: false,
|
||||
inputs: [
|
||||
|
File diff suppressed because one or more lines are too long
@ -179,7 +179,7 @@ describe("P2PIX", () => {
|
||||
|
||||
await expect(
|
||||
p2pix.connect(acc01).withdrawBalance(),
|
||||
).to.be.revertedWith(P2PixErrors.UNAUTHORIZED);
|
||||
).to.be.revertedWithCustomError(p2pix, P2PixErrors.Unauthorized);
|
||||
});
|
||||
it("should allow owner to change reputation instance", async () => {
|
||||
const tx = await p2pix.setReputation(acc03.address);
|
||||
@ -193,8 +193,9 @@ describe("P2PIX", () => {
|
||||
.to.emit(p2pix, "ReputationUpdated")
|
||||
.withArgs(acc03.address);
|
||||
expect(newRep).to.eq(acc03.address);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
});
|
||||
it("should allow owner to change defaultLockBlocks ", async () => {
|
||||
@ -211,8 +212,9 @@ describe("P2PIX", () => {
|
||||
.to.emit(p2pix, "LockBlocksUpdated")
|
||||
.withArgs(magicVal);
|
||||
expect(newVal).to.eq(magicVal);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
});
|
||||
it("should allow owner to add valid Bacen signers", async () => {
|
||||
@ -236,8 +238,9 @@ describe("P2PIX", () => {
|
||||
await expect(tx)
|
||||
.to.emit(p2pix, "ValidSignersUpdated")
|
||||
.withArgs([bob, alice]);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
});
|
||||
it("should allow owner to adjust tokenSettings", async () => {
|
||||
@ -274,11 +277,13 @@ describe("P2PIX", () => {
|
||||
.withArgs(owner.address, true);
|
||||
expect(newTokenState1).to.eq(false);
|
||||
expect(newTokenState2).to.eq(true);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
await expect(fail).to.be.revertedWith(
|
||||
P2PixErrors.UNAUTHORIZED,
|
||||
await expect(fail).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
P2PixErrors.Unauthorized,
|
||||
);
|
||||
await expect(fail2).to.be.revertedWithCustomError(
|
||||
p2pix,
|
||||
@ -293,7 +298,6 @@ describe("P2PIX", () => {
|
||||
multicall,
|
||||
P2PixErrors.CallFailed,
|
||||
)
|
||||
.withArgs(P2PixErrors.UNAUTHORIZED);
|
||||
});
|
||||
});
|
||||
describe("Deposit", async () => {
|
||||
|
@ -7,7 +7,7 @@ export enum P2PixErrors {
|
||||
AlreadyReleased = "AlreadyReleased",
|
||||
TxAlreadyUsed = "TxAlreadyUsed",
|
||||
InvalidSigner = "InvalidSigner",
|
||||
UNAUTHORIZED = "UNAUTHORIZED",
|
||||
Unauthorized = "Unauthorized",
|
||||
TokenDenied = "TokenDenied",
|
||||
NoTokens = "NoTokens",
|
||||
LengthMismatch = "LengthMismatch",
|
||||
|
Loading…
x
Reference in New Issue
Block a user