Skip to content

Commit 54c941d

Browse files
committed
refactoring bank to use JVCToken as official token. Added deps
1 parent 12a0e2f commit 54c941d

39 files changed

+181379
-163400
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// SPDX-License-Identifier: MIT
2+
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
3+
4+
pragma solidity ^0.8.20;
5+
6+
import {Context} from "../utils/Context.sol";
7+
8+
/**
9+
* @dev Contract module which provides a basic access control mechanism, where
10+
* there is an account (an owner) that can be granted exclusive access to
11+
* specific functions.
12+
*
13+
* The initial owner is set to the address provided by the deployer. This can
14+
* later be changed with {transferOwnership}.
15+
*
16+
* This module is used through inheritance. It will make available the modifier
17+
* `onlyOwner`, which can be applied to your functions to restrict their use to
18+
* the owner.
19+
*/
20+
abstract contract Ownable is Context {
21+
address private _owner;
22+
23+
/**
24+
* @dev The caller account is not authorized to perform an operation.
25+
*/
26+
error OwnableUnauthorizedAccount(address account);
27+
28+
/**
29+
* @dev The owner is not a valid owner account. (eg. `address(0)`)
30+
*/
31+
error OwnableInvalidOwner(address owner);
32+
33+
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
34+
35+
/**
36+
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
37+
*/
38+
constructor(address initialOwner) {
39+
if (initialOwner == address(0)) {
40+
revert OwnableInvalidOwner(address(0));
41+
}
42+
_transferOwnership(initialOwner);
43+
}
44+
45+
/**
46+
* @dev Throws if called by any account other than the owner.
47+
*/
48+
modifier onlyOwner() {
49+
_checkOwner();
50+
_;
51+
}
52+
53+
/**
54+
* @dev Returns the address of the current owner.
55+
*/
56+
function owner() public view virtual returns (address) {
57+
return _owner;
58+
}
59+
60+
/**
61+
* @dev Throws if the sender is not the owner.
62+
*/
63+
function _checkOwner() internal view virtual {
64+
if (owner() != _msgSender()) {
65+
revert OwnableUnauthorizedAccount(_msgSender());
66+
}
67+
}
68+
69+
/**
70+
* @dev Leaves the contract without owner. It will not be possible to call
71+
* `onlyOwner` functions. Can only be called by the current owner.
72+
*
73+
* NOTE: Renouncing ownership will leave the contract without an owner,
74+
* thereby disabling any functionality that is only available to the owner.
75+
*/
76+
function renounceOwnership() public virtual onlyOwner {
77+
_transferOwnership(address(0));
78+
}
79+
80+
/**
81+
* @dev Transfers ownership of the contract to a new account (`newOwner`).
82+
* Can only be called by the current owner.
83+
*/
84+
function transferOwnership(address newOwner) public virtual onlyOwner {
85+
if (newOwner == address(0)) {
86+
revert OwnableInvalidOwner(address(0));
87+
}
88+
_transferOwnership(newOwner);
89+
}
90+
91+
/**
92+
* @dev Transfers ownership of the contract to a new account (`newOwner`).
93+
* Internal function without access restriction.
94+
*/
95+
function _transferOwnership(address newOwner) internal virtual {
96+
address oldOwner = _owner;
97+
_owner = newOwner;
98+
emit OwnershipTransferred(oldOwner, newOwner);
99+
}
100+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"deploy": {
3+
"VM:-": {
4+
"linkReferences": {},
5+
"autoDeployLib": true
6+
},
7+
"main:1": {
8+
"linkReferences": {},
9+
"autoDeployLib": true
10+
},
11+
"ropsten:3": {
12+
"linkReferences": {},
13+
"autoDeployLib": true
14+
},
15+
"rinkeby:4": {
16+
"linkReferences": {},
17+
"autoDeployLib": true
18+
},
19+
"kovan:42": {
20+
"linkReferences": {},
21+
"autoDeployLib": true
22+
},
23+
"goerli:5": {
24+
"linkReferences": {},
25+
"autoDeployLib": true
26+
},
27+
"Custom": {
28+
"linkReferences": {},
29+
"autoDeployLib": true
30+
}
31+
},
32+
"data": {
33+
"bytecode": {
34+
"functionDebugData": {},
35+
"generatedSources": [],
36+
"linkReferences": {},
37+
"object": "",
38+
"opcodes": "",
39+
"sourceMap": ""
40+
},
41+
"deployedBytecode": {
42+
"functionDebugData": {},
43+
"generatedSources": [],
44+
"immutableReferences": {},
45+
"linkReferences": {},
46+
"object": "",
47+
"opcodes": "",
48+
"sourceMap": ""
49+
},
50+
"gasEstimates": null,
51+
"methodIdentifiers": {
52+
"owner()": "8da5cb5b",
53+
"renounceOwnership()": "715018a6",
54+
"transferOwnership(address)": "f2fde38b"
55+
}
56+
},
57+
"abi": [
58+
{
59+
"inputs": [
60+
{
61+
"internalType": "address",
62+
"name": "owner",
63+
"type": "address"
64+
}
65+
],
66+
"name": "OwnableInvalidOwner",
67+
"type": "error"
68+
},
69+
{
70+
"inputs": [
71+
{
72+
"internalType": "address",
73+
"name": "account",
74+
"type": "address"
75+
}
76+
],
77+
"name": "OwnableUnauthorizedAccount",
78+
"type": "error"
79+
},
80+
{
81+
"anonymous": false,
82+
"inputs": [
83+
{
84+
"indexed": true,
85+
"internalType": "address",
86+
"name": "previousOwner",
87+
"type": "address"
88+
},
89+
{
90+
"indexed": true,
91+
"internalType": "address",
92+
"name": "newOwner",
93+
"type": "address"
94+
}
95+
],
96+
"name": "OwnershipTransferred",
97+
"type": "event"
98+
},
99+
{
100+
"inputs": [],
101+
"name": "owner",
102+
"outputs": [
103+
{
104+
"internalType": "address",
105+
"name": "",
106+
"type": "address"
107+
}
108+
],
109+
"stateMutability": "view",
110+
"type": "function"
111+
},
112+
{
113+
"inputs": [],
114+
"name": "renounceOwnership",
115+
"outputs": [],
116+
"stateMutability": "nonpayable",
117+
"type": "function"
118+
},
119+
{
120+
"inputs": [
121+
{
122+
"internalType": "address",
123+
"name": "newOwner",
124+
"type": "address"
125+
}
126+
],
127+
"name": "transferOwnership",
128+
"outputs": [],
129+
"stateMutability": "nonpayable",
130+
"type": "function"
131+
}
132+
]
133+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"compiler": {
3+
"version": "0.8.26+commit.8a97fa7a"
4+
},
5+
"language": "Solidity",
6+
"output": {
7+
"abi": [
8+
{
9+
"inputs": [
10+
{
11+
"internalType": "address",
12+
"name": "owner",
13+
"type": "address"
14+
}
15+
],
16+
"name": "OwnableInvalidOwner",
17+
"type": "error"
18+
},
19+
{
20+
"inputs": [
21+
{
22+
"internalType": "address",
23+
"name": "account",
24+
"type": "address"
25+
}
26+
],
27+
"name": "OwnableUnauthorizedAccount",
28+
"type": "error"
29+
},
30+
{
31+
"anonymous": false,
32+
"inputs": [
33+
{
34+
"indexed": true,
35+
"internalType": "address",
36+
"name": "previousOwner",
37+
"type": "address"
38+
},
39+
{
40+
"indexed": true,
41+
"internalType": "address",
42+
"name": "newOwner",
43+
"type": "address"
44+
}
45+
],
46+
"name": "OwnershipTransferred",
47+
"type": "event"
48+
},
49+
{
50+
"inputs": [],
51+
"name": "owner",
52+
"outputs": [
53+
{
54+
"internalType": "address",
55+
"name": "",
56+
"type": "address"
57+
}
58+
],
59+
"stateMutability": "view",
60+
"type": "function"
61+
},
62+
{
63+
"inputs": [],
64+
"name": "renounceOwnership",
65+
"outputs": [],
66+
"stateMutability": "nonpayable",
67+
"type": "function"
68+
},
69+
{
70+
"inputs": [
71+
{
72+
"internalType": "address",
73+
"name": "newOwner",
74+
"type": "address"
75+
}
76+
],
77+
"name": "transferOwnership",
78+
"outputs": [],
79+
"stateMutability": "nonpayable",
80+
"type": "function"
81+
}
82+
],
83+
"devdoc": {
84+
"details": "Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. The initial owner is set to the address provided by the deployer. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.",
85+
"errors": {
86+
"OwnableInvalidOwner(address)": [
87+
{
88+
"details": "The owner is not a valid owner account. (eg. `address(0)`)"
89+
}
90+
],
91+
"OwnableUnauthorizedAccount(address)": [
92+
{
93+
"details": "The caller account is not authorized to perform an operation."
94+
}
95+
]
96+
},
97+
"kind": "dev",
98+
"methods": {
99+
"constructor": {
100+
"details": "Initializes the contract setting the address provided by the deployer as the initial owner."
101+
},
102+
"owner()": {
103+
"details": "Returns the address of the current owner."
104+
},
105+
"renounceOwnership()": {
106+
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
107+
},
108+
"transferOwnership(address)": {
109+
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
110+
}
111+
},
112+
"version": 1
113+
},
114+
"userdoc": {
115+
"kind": "user",
116+
"methods": {},
117+
"version": 1
118+
}
119+
},
120+
"settings": {
121+
"compilationTarget": {
122+
".deps/npm/@openzeppelin/contracts/access/Ownable.sol": "Ownable"
123+
},
124+
"evmVersion": "cancun",
125+
"libraries": {},
126+
"metadata": {
127+
"bytecodeHash": "ipfs"
128+
},
129+
"optimizer": {
130+
"enabled": true,
131+
"runs": 200
132+
},
133+
"remappings": []
134+
},
135+
"sources": {
136+
".deps/npm/@openzeppelin/contracts/access/Ownable.sol": {
137+
"keccak256": "0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb",
138+
"license": "MIT",
139+
"urls": [
140+
"bzz-raw://8ed324d3920bb545059d66ab97d43e43ee85fd3bd52e03e401f020afb0b120f6",
141+
"dweb:/ipfs/QmfEckWLmZkDDcoWrkEvMWhms66xwTLff9DDhegYpvHo1a"
142+
]
143+
},
144+
".deps/npm/@openzeppelin/contracts/utils/Context.sol": {
145+
"keccak256": "0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2",
146+
"license": "MIT",
147+
"urls": [
148+
"bzz-raw://6a708e8a5bdb1011c2c381c9a5cfd8a9a956d7d0a9dc1bd8bcdaf52f76ef2f12",
149+
"dweb:/ipfs/Qmax9WHBnVsZP46ZxEMNRQpLQnrdE4dK8LehML1Py8FowF"
150+
]
151+
}
152+
},
153+
"version": 1
154+
}

0 commit comments

Comments
 (0)