-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add MinimumDeploymentFee #2140
Add MinimumDeploymentFee #2140
Conversation
@roman-khimov Please check it. |
@@ -44,6 +50,20 @@ internal override void OnPersist(ApplicationEngine engine) | |||
} | |||
} | |||
|
|||
[ContractMethod(0_01000000, CallFlags.ReadStates)] | |||
private long GetMinimumDeploymentFee(StoreView snapshot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe it's better to have this value in Policy
contract.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. This is a parameter related to contract deployment, and maybe it should be placed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think like @roman-khimov , it's related to the environment. But also it's ok too
@@ -10,7 +10,7 @@ namespace Neo.UnitTests.Extensions | |||
{ | |||
public static class NativeContractExtensions | |||
{ | |||
public static ContractState DeployContract(this StoreView snapshot, UInt160 sender, byte[] nefFile, byte[] manifest, long gas = ApplicationEngine.TestModeGas) | |||
public static ContractState DeployContract(this StoreView snapshot, UInt160 sender, byte[] nefFile, byte[] manifest, long gas = 200_00000000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's 100?
public static ContractState DeployContract(this StoreView snapshot, UInt160 sender, byte[] nefFile, byte[] manifest, long gas = 200_00000000) | |
public static ContractState DeployContract(this StoreView snapshot, UInt160 sender, byte[] nefFile, byte[] manifest, long gas = 100_00000000) |
@@ -44,6 +50,20 @@ internal override void OnPersist(ApplicationEngine engine) | |||
} | |||
} | |||
|
|||
[ContractMethod(0_01000000, CallFlags.ReadStates)] | |||
private long GetMinimumDeploymentFee(StoreView snapshot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think like @roman-khimov , it's related to the environment. But also it's ok too
Merge? |
@Tommo-L proposed to reduce the min fee to 1, what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can adjust the value later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be on the Police too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if it is just 1 GAS then I think it would be ok here.
I see we can adjust it later, but it needs the multi-signatures of committee. And 100GAS is still higher than Ethereum, which is about 0.04 ~ 0.2 ETH(~ 16GAS - 80GAS) for a simple ERC20 contract. |
I think this way will be better. DeployFee= baseFee + Factor * engine.StoragePrice * (nefFile.Length + manifest.Length) Like: Perhaps we can do a test with the Nep17 template. |
We should not adjust |
The size of NEP17 template is about 4KB, nef 2KB, manifest 2KB, which needs about 4GAS in the old way. |
I like the old way. If for malicious attack concern, we could increase that to some extent but should not be so high. |
Close #2001