|
1 | 1 | # Solidity API
|
2 | 2 |
|
3 |
| -## MyStablecoinAllowlist |
4 |
| - |
5 |
| -### constructor |
6 |
| - |
7 |
| -```solidity |
8 |
| -constructor(address initialAuthority) public |
9 |
| -``` |
10 |
| - |
11 |
| -### allowUser |
12 |
| - |
13 |
| -```solidity |
14 |
| -function allowUser(address user) public |
15 |
| -``` |
16 |
| - |
17 |
| -### disallowUser |
18 |
| - |
19 |
| -```solidity |
20 |
| -function disallowUser(address user) public |
21 |
| -``` |
22 |
| - |
23 |
| -## ERC20Allowlist |
24 |
| - |
25 |
| -_Extension of {ERC20} that allows to implement an allowlist |
26 |
| -mechanism that can be managed by an authorized account with the |
27 |
| -{_disallowUser} and {_allowUser} functions. |
28 |
| - |
29 |
| -The allowlist provides the guarantee to the contract owner |
30 |
| -(e.g. a DAO or a well-configured multisig) that any account won't be |
31 |
| -able to execute transfers or approvals to other entities to operate |
32 |
| -on its behalf if {_allowUser} was not called with such account as an |
33 |
| -argument. Similarly, the account will be disallowed again if |
34 |
| -{_disallowUser} is called._ |
35 |
| - |
36 |
| -### _allowed |
37 |
| - |
38 |
| -```solidity |
39 |
| -mapping(address => bool) _allowed |
40 |
| -``` |
41 |
| - |
42 |
| -_Allowed status of addresses. True if allowed, False otherwise._ |
43 |
| - |
44 |
| -### UserAllowed |
45 |
| - |
46 |
| -```solidity |
47 |
| -event UserAllowed(address user) |
48 |
| -``` |
49 |
| - |
50 |
| -_Emitted when a `user` is allowed to transfer and approve._ |
51 |
| - |
52 |
| -### UserDisallowed |
53 |
| - |
54 |
| -```solidity |
55 |
| -event UserDisallowed(address user) |
56 |
| -``` |
57 |
| - |
58 |
| -_Emitted when a user is disallowed._ |
59 |
| - |
60 |
| -### ERC20Disallowed |
61 |
| - |
62 |
| -```solidity |
63 |
| -error ERC20Disallowed(address user) |
64 |
| -``` |
65 |
| - |
66 |
| -_The operation failed because the user is not allowed._ |
67 |
| - |
68 |
| -### allowed |
69 |
| - |
70 |
| -```solidity |
71 |
| -function allowed(address account) public virtual returns (bool) |
72 |
| -``` |
73 |
| - |
74 |
| -_Returns the allowed status of an account._ |
75 |
| - |
76 |
| -### _allowUser |
77 |
| - |
78 |
| -```solidity |
79 |
| -function _allowUser(address user) internal virtual returns (bool) |
80 |
| -``` |
81 |
| - |
82 |
| -_Allows a user to receive and transfer tokens, including minting and burning._ |
83 |
| - |
84 |
| -### _disallowUser |
85 |
| - |
86 |
| -```solidity |
87 |
| -function _disallowUser(address user) internal virtual returns (bool) |
88 |
| -``` |
89 |
| - |
90 |
| -_Disallows a user from receiving and transferring tokens, including minting and burning._ |
91 |
| - |
92 |
| -### _update |
93 |
| - |
94 |
| -```solidity |
95 |
| -function _update(address from, address to, uint256 value) internal virtual |
96 |
| -``` |
97 |
| - |
98 |
| -_See {ERC20-_update}._ |
99 |
| - |
100 |
| -### _approve |
101 |
| - |
102 |
| -```solidity |
103 |
| -function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual |
104 |
| -``` |
105 |
| - |
106 |
| -_See {ERC20-_approve}._ |
107 |
| - |
108 |
| -## MyStablecoin |
109 |
| - |
110 |
| -### constructor |
111 |
| - |
112 |
| -```solidity |
113 |
| -constructor(address initialAuthority) public |
114 |
| -``` |
115 |
| - |
116 |
| -### allowUser |
117 |
| - |
118 |
| -```solidity |
119 |
| -function allowUser(address user) public |
120 |
| -``` |
121 |
| - |
122 |
| -### disallowUser |
123 |
| - |
124 |
| -```solidity |
125 |
| -function disallowUser(address user) public |
126 |
| -``` |
127 |
| - |
128 | 3 | ## AccessManagerLight
|
129 | 4 |
|
130 | 5 | _Light version of an AccessManager contract that defines `bytes8` roles
|
@@ -323,6 +198,26 @@ WARNING: Implementing a signature validation algorithm is a security-sensitive o
|
323 | 198 | cryptographic verification. It is important to review and test thoroughly before deployment. Consider
|
324 | 199 | using one of the signature verification libraries ({ECDSA}, {P256} or {RSA})._
|
325 | 200 |
|
| 201 | +## MyStablecoinAllowlist |
| 202 | + |
| 203 | +### constructor |
| 204 | + |
| 205 | +```solidity |
| 206 | +constructor(address initialAuthority) public |
| 207 | +``` |
| 208 | + |
| 209 | +### allowUser |
| 210 | + |
| 211 | +```solidity |
| 212 | +function allowUser(address user) public |
| 213 | +``` |
| 214 | + |
| 215 | +### disallowUser |
| 216 | + |
| 217 | +```solidity |
| 218 | +function disallowUser(address user) public |
| 219 | +``` |
| 220 | + |
326 | 221 | ## ERC20CollateralMock
|
327 | 222 |
|
328 | 223 | ### constructor
|
@@ -399,6 +294,91 @@ IMPORTANT: The way this function identifies whether the implementation is a beac
|
399 | 294 | if it implements the {IBeacon-implementation} function. Consider that an actual implementation could
|
400 | 295 | define this function, mistakenly identifying it as a beacon._
|
401 | 296 |
|
| 297 | +## ERC20Allowlist |
| 298 | + |
| 299 | +_Extension of {ERC20} that allows to implement an allowlist |
| 300 | +mechanism that can be managed by an authorized account with the |
| 301 | +{_disallowUser} and {_allowUser} functions. |
| 302 | + |
| 303 | +The allowlist provides the guarantee to the contract owner |
| 304 | +(e.g. a DAO or a well-configured multisig) that any account won't be |
| 305 | +able to execute transfers or approvals to other entities to operate |
| 306 | +on its behalf if {_allowUser} was not called with such account as an |
| 307 | +argument. Similarly, the account will be disallowed again if |
| 308 | +{_disallowUser} is called._ |
| 309 | + |
| 310 | +### _allowed |
| 311 | + |
| 312 | +```solidity |
| 313 | +mapping(address => bool) _allowed |
| 314 | +``` |
| 315 | + |
| 316 | +_Allowed status of addresses. True if allowed, False otherwise._ |
| 317 | + |
| 318 | +### UserAllowed |
| 319 | + |
| 320 | +```solidity |
| 321 | +event UserAllowed(address user) |
| 322 | +``` |
| 323 | + |
| 324 | +_Emitted when a `user` is allowed to transfer and approve._ |
| 325 | + |
| 326 | +### UserDisallowed |
| 327 | + |
| 328 | +```solidity |
| 329 | +event UserDisallowed(address user) |
| 330 | +``` |
| 331 | + |
| 332 | +_Emitted when a user is disallowed._ |
| 333 | + |
| 334 | +### ERC20Disallowed |
| 335 | + |
| 336 | +```solidity |
| 337 | +error ERC20Disallowed(address user) |
| 338 | +``` |
| 339 | + |
| 340 | +_The operation failed because the user is not allowed._ |
| 341 | + |
| 342 | +### allowed |
| 343 | + |
| 344 | +```solidity |
| 345 | +function allowed(address account) public virtual returns (bool) |
| 346 | +``` |
| 347 | + |
| 348 | +_Returns the allowed status of an account._ |
| 349 | + |
| 350 | +### _allowUser |
| 351 | + |
| 352 | +```solidity |
| 353 | +function _allowUser(address user) internal virtual returns (bool) |
| 354 | +``` |
| 355 | + |
| 356 | +_Allows a user to receive and transfer tokens, including minting and burning._ |
| 357 | + |
| 358 | +### _disallowUser |
| 359 | + |
| 360 | +```solidity |
| 361 | +function _disallowUser(address user) internal virtual returns (bool) |
| 362 | +``` |
| 363 | + |
| 364 | +_Disallows a user from receiving and transferring tokens, including minting and burning._ |
| 365 | + |
| 366 | +### _update |
| 367 | + |
| 368 | +```solidity |
| 369 | +function _update(address from, address to, uint256 value) internal virtual |
| 370 | +``` |
| 371 | + |
| 372 | +_See {ERC20-_update}._ |
| 373 | + |
| 374 | +### _approve |
| 375 | + |
| 376 | +```solidity |
| 377 | +function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual |
| 378 | +``` |
| 379 | + |
| 380 | +_See {ERC20-_approve}._ |
| 381 | + |
402 | 382 | ## ERC20Blocklist
|
403 | 383 |
|
404 | 384 | _Extension of {ERC20} that allows to implement a blocklist
|
|
0 commit comments