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