starknet.js icon indicating copy to clipboard operation
starknet.js copied to clipboard

When I deployed an account on the main network contract error

Open leezijie opened this issue 3 years ago • 1 comments

`let keyPair = ec.genKeyPair() let starkPubKey = ec.getStarkKey(keyPair) const starkKeyInt = toBN(encode.removeHexPrefix(starkPubKey), 16);

const compiledArgentAccount = json.parse(
    fs.readFileSync("./docs/newaccount.json").toString("ascii")
)

const provider = new Provider({network:'mainnet-alpha'})
// const provider = new Provider({network:'goerli-alpha'})

const account = await provider.deployContract({
    contract: compiledArgentAccount,
    constructorCalldata:[starkKeyInt],
    addressSalt: starkPubKey,
})`

error logs: The contract class attempted to be deployed is not permitted

But I can deploy in the test network, do I need to apply for any permissions

leezijie avatar Aug 12 '22 11:08 leezijie

Hi! There's a whitelist of contacts for mainnet. Is this contract you want to deploy some custom contract? There's a form you can fill in order to add it for mainnet: https://forms.reform.app/starkware/SN-Alpha-Contract-Deployment/l894lu

ivpavici avatar Aug 12 '22 12:08 ivpavici

Hi! There's a whitelist of contacts for mainnet. Is this contract you want to deploy some custom contract? There's a form you can fill in order to add it for mainnet: https://forms.reform.app/starkware/SN-Alpha-Contract-Deployment/l894lu

Thanks a lot. I'm using the account contract code in the demo. I want to deploy it on the main network

leezijie avatar Aug 15 '22 02:08 leezijie

Hi! There's a whitelist of contacts for mainnet. Is this contract you want to deploy some custom contract? There's a form you can fill in order to add it for mainnet: https://forms.reform.app/starkware/SN-Alpha-Contract-Deployment/l894lu

I want to use this contract, but I don't have its source code, do you know its source code. https://github.com/0xs34n/starknet.js/blob/develop/mocks/Account.json

leezijie avatar Aug 15 '22 02:08 leezijie

afaik it is OpenZeppelin account implementation https://github.com/OpenZeppelin/cairo-contracts/tree/main/src/openzeppelin/account/presets

ivpavici avatar Aug 15 '22 08:08 ivpavici