I have a pretty big contract with a few functions, some are designed for administrative goals. Here's a simplified example:
contract big_contract {
function user_function_1 (uint32 arg1, string arg2) returns (uint32) {
// ...
}
function user_function_2 (string arg1) returns (string){
// ...
}
function admin_function (bool arg1) {
// ...
}
}
The question is - how can I keep admin_function in the contract's code, but make it invisible for general users? I know, that usually, all you need is to add a few lines of code like if (msg.sender == owner) {...}, but I want to hide this function at all.
In my understanding, it's possible to do by editing ABI's code, but I'm not sure. So, in this example, I need to remove definition for admin_function and the contract will still work, just without capability to call admin_function. But for those, who have full ABI, admin_function will still be available.
[
// {
// "constant":false,
// "inputs":[
// {
// "name":"arg1",
// "type":"bool"
// }
// ],
// "name":"admin_function",
// "outputs":[
//
// ],
// "payable":false,
// "type":"function"
// },
{
"constant":false,
"inputs":[
{
"name":"arg1",
"type":"uint32"
},
{
"name":"arg2",
"type":"string"
}
],
"name":"user_function_1",
"outputs":[
{
"name":"",
"type":"uint32"
}
],
"payable":false,
"type":"function"
},
{
"constant":false,
"inputs":[
{
"name":"arg1",
"type":"string"
}
],
"name":"user_function_2",
"outputs":[
{
"name":"",
"type":"string"
}
],
"payable":false,
"type":"function"
}
]
Am I right or there are any other ways to make it work?