Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core-cairo/src/add-pausable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function addPausable(c: ContractBuilder, access: Access, pausableFns: Bas

const modules = defineModules( {
Pausable: {
path: 'openzeppelin/security/pausable',
path: 'openzeppelin.security.pausable.library',
useNamespace: true
},
});
Expand Down
14 changes: 7 additions & 7 deletions packages/core-cairo/src/custom.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.cairo_builtins import HashBuiltin␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -154,7 +154,7 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.cairo_builtins import HashBuiltin␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -201,8 +201,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.cairo_builtins import HashBuiltin␊
from openzeppelin.access.accesscontrol import AccessControl␊
from openzeppelin.utils.constants import DEFAULT_ADMIN_ROLE␊
from openzeppelin.access.accesscontrol.library import AccessControl␊
from openzeppelin.utils.constants.library import DEFAULT_ADMIN_ROLE␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -285,8 +285,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.cairo_builtins import HashBuiltin␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down
Binary file modified packages/core-cairo/src/custom.test.ts.snap
Binary file not shown.
30 changes: 15 additions & 15 deletions packages/core-cairo/src/erc20.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.bool import TRUE␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -518,9 +518,9 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.bool import TRUE␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.accesscontrol import AccessControl␊
from openzeppelin.utils.constants import DEFAULT_ADMIN_ROLE␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.accesscontrol.library import AccessControl␊
from openzeppelin.utils.constants.library import DEFAULT_ADMIN_ROLE␊
const PAUSER_ROLE = 0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862 # keccak256('PAUSER_ROLE')[0:251 bits]␊
Expand Down Expand Up @@ -758,8 +758,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.starknet.common.syscalls import get_caller_address␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -1261,7 +1261,7 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.bool import TRUE␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -1437,8 +1437,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.bool import TRUE␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.access.accesscontrol import AccessControl␊
from openzeppelin.utils.constants import DEFAULT_ADMIN_ROLE␊
from openzeppelin.access.accesscontrol.library import AccessControl␊
from openzeppelin.utils.constants.library import DEFAULT_ADMIN_ROLE␊
const MINTER_ROLE = 0x4f96f87f6963bb246f2c30526628466840c642dc5c50d5a67777c6cc0e44ab5 # keccak256('MINTER_ROLE')[0:251 bits]␊
Expand Down Expand Up @@ -1650,8 +1650,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.starknet.common.syscalls import get_caller_address␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
from openzeppelin.upgrades.library import Proxy␊
@external␊
Expand Down Expand Up @@ -1892,9 +1892,9 @@ Generated by [AVA](https://avajs.dev).
from starkware.starknet.common.syscalls import get_caller_address␊
from openzeppelin.token.erc20.library import ERC20␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.accesscontrol import AccessControl␊
from openzeppelin.utils.constants import DEFAULT_ADMIN_ROLE␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.accesscontrol.library import AccessControl␊
from openzeppelin.utils.constants.library import DEFAULT_ADMIN_ROLE␊
from openzeppelin.upgrades.library import Proxy␊
const PAUSER_ROLE = 0x65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862 # keccak256('PAUSER_ROLE')[0:251 bits]␊
Expand Down
Binary file modified packages/core-cairo/src/erc20.test.ts.snap
Binary file not shown.
2 changes: 1 addition & 1 deletion packages/core-cairo/src/erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function addMintable(c: ContractBuilder, access: Access) {

const modules = defineModules( {
ERC20: {
path: 'openzeppelin/token/erc20/library',
path: 'openzeppelin.token.erc20.library',
useNamespace: true
},

Expand Down
26 changes: 13 additions & 13 deletions packages/core-cairo/src/erc721.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.uint256 import Uint256␊
from openzeppelin.token.erc721.library import ERC721␊
from openzeppelin.introspection.ERC165 import ERC165␊
from openzeppelin.introspection.erc165.library import ERC165␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -169,7 +169,7 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.uint256 import Uint256␊
from openzeppelin.token.erc721.library import ERC721␊
from openzeppelin.introspection.ERC165 import ERC165␊
from openzeppelin.introspection.erc165.library import ERC165␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -333,9 +333,9 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.uint256 import Uint256␊
from openzeppelin.token.erc721.library import ERC721␊
from openzeppelin.introspection.ERC165 import ERC165␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.introspection.erc165.library import ERC165␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -545,8 +545,8 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.uint256 import Uint256␊
from openzeppelin.token.erc721.library import ERC721␊
from openzeppelin.introspection.ERC165 import ERC165␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.introspection.erc165.library import ERC165␊
from openzeppelin.access.ownable.library import Ownable␊
@constructor␊
func constructor{␊
Expand Down Expand Up @@ -732,9 +732,9 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.uint256 import Uint256␊
from openzeppelin.token.erc721.library import ERC721␊
from openzeppelin.introspection.ERC165 import ERC165␊
from openzeppelin.access.accesscontrol import AccessControl␊
from openzeppelin.utils.constants import DEFAULT_ADMIN_ROLE␊
from openzeppelin.introspection.erc165.library import ERC165␊
from openzeppelin.access.accesscontrol.library import AccessControl␊
from openzeppelin.utils.constants.library import DEFAULT_ADMIN_ROLE␊
const MINTER_ROLE = 0x4f96f87f6963bb246f2c30526628466840c642dc5c50d5a67777c6cc0e44ab5 # keccak256('MINTER_ROLE')[0:251 bits]␊
Expand Down Expand Up @@ -955,9 +955,9 @@ Generated by [AVA](https://avajs.dev).
from starkware.cairo.common.uint256 import Uint256␊
from openzeppelin.token.erc721.library import ERC721␊
from openzeppelin.introspection.ERC165 import ERC165␊
from openzeppelin.security.pausable import Pausable␊
from openzeppelin.access.ownable import Ownable␊
from openzeppelin.introspection.erc165.library import ERC165␊
from openzeppelin.security.pausable.library import Pausable␊
from openzeppelin.access.ownable.library import Ownable␊
from openzeppelin.upgrades.library import Proxy␊
@external␊
Expand Down
Binary file modified packages/core-cairo/src/erc721.test.ts.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/core-cairo/src/erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ function addMintable(c: ContractBuilder, access: Access) {

const modules = defineModules( {
ERC165: {
path: 'openzeppelin.introspection.ERC165',
path: 'openzeppelin.introspection.erc165.library',
useNamespace: true
},

ERC721: {
path: 'openzeppelin/token/erc721/library',
path: 'openzeppelin.token.erc721.library',
useNamespace: true
},
})
Expand Down
6 changes: 3 additions & 3 deletions packages/core-cairo/src/set-access-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ function importDefaultAdminRole(c: ContractBuilder) {

const modules = defineModules( {
Ownable: {
path: 'openzeppelin/access/ownable',
path: 'openzeppelin.access.ownable.library',
useNamespace: true
},
AccessControl: {
path: 'openzeppelin/access/accesscontrol',
path: 'openzeppelin.access.accesscontrol.library',
useNamespace: true
},
constants: {
path: 'openzeppelin/utils/constants',
path: 'openzeppelin.utils.constants.library',
useNamespace: false
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/core-cairo/src/set-upgradeable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function setUpgradeable(c: ContractBuilder, upgradeable: Upgradeable) {

const modules = defineModules( {
Proxy: {
path: 'openzeppelin/upgrades/library',
path: 'openzeppelin.upgrades.library',
useNamespace: true
},
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core-cairo/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function isAccessControlRequired(opts: GenericOptions) {

test('is access control required', async t => {
for (const contract of generateSources('all')) {
const regexOwnable = /(from openzeppelin.access.ownable import Ownable)/gm;
const regexOwnable = /(from openzeppelin.access.ownable.library import Ownable)/gm;

if (!contract.options.access) {
if (isAccessControlRequired(contract.options)) {
Expand Down