|
1 |
| -import type { AiFunctionDefinition, AiFunctionPropertyDefinition } from '../types/function-definition.ts'; |
| 1 | +import type { AiFunctionDefinition } from '../types/function-definition.ts'; |
2 | 2 | import { addFunctionPropertiesFrom } from './shared.ts';
|
3 |
| -import type { SolidityCommonOptions } from '../types/languages.ts'; |
4 |
| - |
5 |
| -const commonFunctionDescription = { |
6 |
| - access: { |
7 |
| - anyOf: [ |
8 |
| - { type: 'boolean', enum: [false] }, |
9 |
| - { type: 'string', enum: ['ownable', 'roles', 'managed'] }, |
10 |
| - ], |
11 |
| - description: |
12 |
| - 'The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. Managed enables a central contract to define a policy that allows certain callers to access certain functions.', |
13 |
| - }, |
14 |
| - |
15 |
| - upgradeable: { |
16 |
| - anyOf: [ |
17 |
| - { type: 'boolean', enum: [false] }, |
18 |
| - { type: 'string', enum: ['transparent', 'uups'] }, |
19 |
| - ], |
20 |
| - description: |
21 |
| - 'Whether the smart contract is upgradeable. Transparent uses more complex proxy with higher overhead, requires less changes in your contract.Can also be used with beacons. UUPS uses simpler proxy with less overhead, requires including extra code in your contract. Allows flexibility for authorizing upgrades.', |
22 |
| - }, |
23 |
| - |
24 |
| - info: { |
25 |
| - type: 'object', |
26 |
| - description: 'Metadata about the contract and author', |
27 |
| - properties: { |
28 |
| - securityContact: { |
29 |
| - type: 'string', |
30 |
| - description: |
31 |
| - 'Email where people can contact you to report security issues. Will only be visible if contract metadata is verified.', |
32 |
| - }, |
33 |
| - license: { |
34 |
| - type: 'string', |
35 |
| - description: 'The license used by the contract, default is "MIT"', |
36 |
| - }, |
37 |
| - }, |
38 |
| - }, |
39 |
| -} as const satisfies AiFunctionPropertyDefinition<SolidityCommonOptions>['properties']; |
| 3 | +import { commonFunctionDescription } from './solidity-shared.ts'; |
40 | 4 |
|
41 | 5 | export const erc20Function = {
|
42 | 6 | name: 'ERC20',
|
@@ -65,7 +29,7 @@ export const erc20Function = {
|
65 | 29 | },
|
66 | 30 | votes: {
|
67 | 31 | anyOf: [
|
68 |
| - { type: 'boolean', enum: [false] }, |
| 32 | + { type: 'boolean', enum: [false, true] }, |
69 | 33 | { type: 'string', enum: ['blocknumber', 'timestamp'] },
|
70 | 34 | ],
|
71 | 35 | description:
|
@@ -135,7 +99,7 @@ export const erc721Function = {
|
135 | 99 | { type: 'string', enum: ['blocknumber', 'timestamp'] },
|
136 | 100 | ],
|
137 | 101 | description:
|
138 |
| - 'Whether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps.', |
| 102 | + 'Whether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps (defaulting to block number if not specified).', |
139 | 103 | },
|
140 | 104 | },
|
141 | 105 | required: ['name', 'symbol'],
|
@@ -199,7 +163,7 @@ export const stablecoinFunction = {
|
199 | 163 | 'Whether to restrict certain users from transferring tokens, either via allowing or blocking them. This feature is experimental, not audited and is subject to change.',
|
200 | 164 | },
|
201 | 165 | upgradeable: {
|
202 |
| - type: 'string', |
| 166 | + type: 'boolean', |
203 | 167 | enum: [false],
|
204 | 168 | description: 'Upgradeability is not yet available for features that use @openzeppelin/community-contracts',
|
205 | 169 | },
|
@@ -270,8 +234,8 @@ export const governorFunction = {
|
270 | 234 | },
|
271 | 235 | timelock: {
|
272 | 236 | anyOf: [
|
273 |
| - { type: 'boolean', enum: [false] }, |
274 | 237 | { type: 'string', enum: ['openzeppelin', 'compound'] },
|
| 238 | + { type: 'boolean', enum: [false] }, |
275 | 239 | ],
|
276 | 240 | description: 'The type of timelock to use',
|
277 | 241 | },
|
|
0 commit comments